@fuf-stack/uniform 1.11.2 → 1.11.3
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.
- package/dist/Checkboxes/index.cjs +1 -1
- package/dist/Checkboxes/index.d.cts +1 -1
- package/dist/Checkboxes/index.d.ts +1 -1
- package/dist/Checkboxes/index.js +1 -1
- package/dist/{Checkboxes-BY4UK0Xf.js → Checkboxes-BvW4D5Nm.js} +3 -3
- package/dist/{Checkboxes-BY4UK0Xf.js.map → Checkboxes-BvW4D5Nm.js.map} +1 -1
- package/dist/{Checkboxes-DgCK-Wq-.cjs → Checkboxes-Cvdazf25.cjs} +4 -4
- package/dist/{Checkboxes-DgCK-Wq-.cjs.map → Checkboxes-Cvdazf25.cjs.map} +1 -1
- package/dist/FieldArray/index.cjs +1 -1
- package/dist/FieldArray/index.d.cts +1 -1
- package/dist/FieldArray/index.d.ts +1 -1
- package/dist/FieldArray/index.js +1 -1
- package/dist/{FieldArray-DBsyUQkU.cjs → FieldArray-CJpDgK_t.cjs} +7 -7
- package/dist/{FieldArray-DBsyUQkU.cjs.map → FieldArray-CJpDgK_t.cjs.map} +1 -1
- package/dist/{FieldArray-CDLaGvNj.js → FieldArray-omRNwxgy.js} +5 -5
- package/dist/{FieldArray-CDLaGvNj.js.map → FieldArray-omRNwxgy.js.map} +1 -1
- package/dist/FieldCard/index.cjs +1 -1
- package/dist/FieldCard/index.d.cts +1 -1
- package/dist/FieldCard/index.d.ts +1 -1
- package/dist/FieldCard/index.js +1 -1
- package/dist/{FieldCard-NKF358fO.cjs → FieldCard-Dt6QU7o7.cjs} +4 -4
- package/dist/{FieldCard-NKF358fO.cjs.map → FieldCard-Dt6QU7o7.cjs.map} +1 -1
- package/dist/{FieldCard-C1MCSbPW.js → FieldCard-Dyi-2qr6.js} +3 -3
- package/dist/{FieldCard-C1MCSbPW.js.map → FieldCard-Dyi-2qr6.js.map} +1 -1
- package/dist/{FieldCopyTestIdButton-BSYcSo2o.cjs → FieldCopyTestIdButton-By-hEZgA.cjs} +2 -2
- package/dist/{FieldCopyTestIdButton-BSYcSo2o.cjs.map → FieldCopyTestIdButton-By-hEZgA.cjs.map} +1 -1
- package/dist/{FieldCopyTestIdButton-DWPCDJ-s.js → FieldCopyTestIdButton-D9f1B-VS.js} +1 -1
- package/dist/{FieldCopyTestIdButton-DWPCDJ-s.js.map → FieldCopyTestIdButton-D9f1B-VS.js.map} +1 -1
- package/dist/{FieldValidationError-1hiDEFew.js → FieldValidationError-BYwitb_B.js} +1 -1
- package/dist/{FieldValidationError-1hiDEFew.js.map → FieldValidationError-BYwitb_B.js.map} +1 -1
- package/dist/{FieldValidationError-CE8R8qry.cjs → FieldValidationError-D64j5gnH.cjs} +2 -2
- package/dist/{FieldValidationError-CE8R8qry.cjs.map → FieldValidationError-D64j5gnH.cjs.map} +1 -1
- package/dist/Form/index.cjs +1 -1
- package/dist/Form/index.d.cts +1 -1
- package/dist/Form/index.d.ts +1 -1
- package/dist/Form/index.js +1 -1
- package/dist/{Form-DRNEwHsi.js → Form-B1fvbnxi.js} +3 -3
- package/dist/{Form-DRNEwHsi.js.map → Form-B1fvbnxi.js.map} +1 -1
- package/dist/{Form-BsD69fql.cjs → Form-CvnnGF45.cjs} +3 -3
- package/dist/{Form-BsD69fql.cjs.map → Form-CvnnGF45.cjs.map} +1 -1
- package/dist/{FormContext-CN9n_KdE.js → FormContext-Dl3k1r_k.js} +2 -2
- package/dist/{FormContext-CN9n_KdE.js.map → FormContext-Dl3k1r_k.js.map} +1 -1
- package/dist/{FormContext-Bb6d8hdG.cjs → FormContext-Lw4YL4-B.cjs} +2 -2
- package/dist/{FormContext-Bb6d8hdG.cjs.map → FormContext-Lw4YL4-B.cjs.map} +1 -1
- package/dist/Grid/index.cjs +1 -1
- package/dist/Grid/index.d.cts +1 -1
- package/dist/Grid/index.d.ts +1 -1
- package/dist/{Grid-D84e76CE.cjs → Grid-DezBAZbx.cjs} +2 -2
- package/dist/{Grid-D84e76CE.cjs.map → Grid-DezBAZbx.cjs.map} +1 -1
- package/dist/Input/index.cjs +1 -1
- package/dist/Input/index.d.cts +1 -1
- package/dist/Input/index.d.ts +1 -1
- package/dist/Input/index.js +1 -1
- package/dist/{Input-DeTpxiK_.cjs → Input-DR0gCf9q.cjs} +5 -4
- package/dist/Input-DR0gCf9q.cjs.map +1 -0
- package/dist/{Input-DXMWGTBh.js → Input-DksaHK1Y.js} +4 -3
- package/dist/Input-DksaHK1Y.js.map +1 -0
- package/dist/RadioBoxes/index.cjs +1 -1
- package/dist/RadioBoxes/index.d.cts +1 -1
- package/dist/RadioBoxes/index.d.ts +1 -1
- package/dist/RadioBoxes/index.js +1 -1
- package/dist/{RadioBoxes-BEln4a-B.js → RadioBoxes-DdIHH6B5.js} +2 -2
- package/dist/{RadioBoxes-BEln4a-B.js.map → RadioBoxes-DdIHH6B5.js.map} +1 -1
- package/dist/{RadioBoxes-gsQGqQCd.cjs → RadioBoxes-h-VLhJ9d.cjs} +3 -3
- package/dist/{RadioBoxes-gsQGqQCd.cjs.map → RadioBoxes-h-VLhJ9d.cjs.map} +1 -1
- package/dist/RadioTabs/index.cjs +1 -1
- package/dist/RadioTabs/index.d.cts +1 -1
- package/dist/RadioTabs/index.d.ts +1 -1
- package/dist/RadioTabs/index.js +1 -1
- package/dist/{RadioTabs-BYpP0tKA.cjs → RadioTabs-D6yF9jE3.cjs} +3 -3
- package/dist/{RadioTabs-BYpP0tKA.cjs.map → RadioTabs-D6yF9jE3.cjs.map} +1 -1
- package/dist/{RadioTabs-DLr9QiXI.js → RadioTabs-dLdlF91p.js} +2 -2
- package/dist/{RadioTabs-DLr9QiXI.js.map → RadioTabs-dLdlF91p.js.map} +1 -1
- package/dist/Radios/index.cjs +1 -1
- package/dist/Radios/index.d.cts +1 -1
- package/dist/Radios/index.d.ts +1 -1
- package/dist/Radios/index.js +1 -1
- package/dist/{Radios-BCOfnTke.cjs → Radios-D8alyG2f.cjs} +3 -3
- package/dist/{Radios-BCOfnTke.cjs.map → Radios-D8alyG2f.cjs.map} +1 -1
- package/dist/{Radios-DCXI2kMf.js → Radios-DiZ0Dfmp.js} +2 -2
- package/dist/{Radios-DCXI2kMf.js.map → Radios-DiZ0Dfmp.js.map} +1 -1
- package/dist/Select/index.cjs +1 -1
- package/dist/Select/index.d.cts +1 -1
- package/dist/Select/index.d.ts +1 -1
- package/dist/Select/index.js +1 -1
- package/dist/{Select-CyfEmWiD.js → Select-C9otN8uu.js} +3 -3
- package/dist/{Select-CyfEmWiD.js.map → Select-C9otN8uu.js.map} +1 -1
- package/dist/{Select-KnPGOO27.cjs → Select-DQVskslz.cjs} +4 -4
- package/dist/{Select-KnPGOO27.cjs.map → Select-DQVskslz.cjs.map} +1 -1
- package/dist/Slider/index.cjs +1 -1
- package/dist/Slider/index.d.cts +1 -1
- package/dist/Slider/index.d.ts +1 -1
- package/dist/Slider/index.js +1 -1
- package/dist/{Slider-C7xxYPgR.cjs → Slider-DwfyCQDM.cjs} +3 -3
- package/dist/{Slider-C7xxYPgR.cjs.map → Slider-DwfyCQDM.cjs.map} +1 -1
- package/dist/{Slider-Dlhb-9hC.js → Slider-meuLEC2k.js} +2 -2
- package/dist/{Slider-Dlhb-9hC.js.map → Slider-meuLEC2k.js.map} +1 -1
- package/dist/SubmitButton/index.cjs +1 -1
- package/dist/SubmitButton/index.d.cts +1 -1
- package/dist/SubmitButton/index.d.ts +1 -1
- package/dist/SubmitButton/index.js +1 -1
- package/dist/{SubmitButton-CUBItcBn.cjs → SubmitButton-B0kvUqkd.cjs} +3 -3
- package/dist/{SubmitButton-CUBItcBn.cjs.map → SubmitButton-B0kvUqkd.cjs.map} +1 -1
- package/dist/{SubmitButton-C5f6j0N4.js → SubmitButton-BHP9J9ml.js} +2 -2
- package/dist/{SubmitButton-C5f6j0N4.js.map → SubmitButton-BHP9J9ml.js.map} +1 -1
- package/dist/Switch/index.cjs +1 -1
- package/dist/Switch/index.d.cts +1 -1
- package/dist/Switch/index.d.ts +1 -1
- package/dist/Switch/index.js +1 -1
- package/dist/{Switch--m02Xcq8.js → Switch-DkciIYnD.js} +2 -2
- package/dist/{Switch--m02Xcq8.js.map → Switch-DkciIYnD.js.map} +1 -1
- package/dist/{Switch-6LyeZHJh.cjs → Switch-Ds0gDzjR.cjs} +3 -3
- package/dist/{Switch-6LyeZHJh.cjs.map → Switch-Ds0gDzjR.cjs.map} +1 -1
- package/dist/SwitchBox/index.cjs +1 -1
- package/dist/SwitchBox/index.d.cts +1 -1
- package/dist/SwitchBox/index.d.ts +1 -1
- package/dist/SwitchBox/index.js +1 -1
- package/dist/{SwitchBox-D0-e-pbM.js → SwitchBox-B6Z4rtWt.js} +2 -2
- package/dist/{SwitchBox-D0-e-pbM.js.map → SwitchBox-B6Z4rtWt.js.map} +1 -1
- package/dist/{SwitchBox-CtGiQdys.cjs → SwitchBox-B9JqwDtN.cjs} +3 -3
- package/dist/{SwitchBox-CtGiQdys.cjs.map → SwitchBox-B9JqwDtN.cjs.map} +1 -1
- package/dist/TextArea/index.cjs +1 -1
- package/dist/TextArea/index.d.cts +1 -1
- package/dist/TextArea/index.js +1 -1
- package/dist/{TextArea-PtdSABZS.cjs → TextArea-BqQtlPSV.cjs} +5 -4
- package/dist/{TextArea-PtdSABZS.cjs.map → TextArea-BqQtlPSV.cjs.map} +1 -1
- package/dist/{TextArea-BiSnvJ69.js → TextArea-DAx49KI6.js} +4 -3
- package/dist/{TextArea-BiSnvJ69.js.map → TextArea-DAx49KI6.js.map} +1 -1
- package/dist/helpers/index.cjs +2 -1
- package/dist/helpers/index.d.cts +164 -2
- package/dist/helpers/index.d.cts.map +1 -0
- package/dist/helpers/index.d.ts +164 -2
- package/dist/helpers/index.d.ts.map +1 -0
- package/dist/helpers/index.js +2 -2
- package/dist/{helpers-B-CJOBt3.js → helpers-CCINRgQk.js} +43 -2
- package/dist/helpers-CCINRgQk.js.map +1 -0
- package/dist/{helpers-B84E9vHd.cjs → helpers-nYTmL2gX.cjs} +49 -2
- package/dist/helpers-nYTmL2gX.cjs.map +1 -0
- package/dist/hooks/useClientValidation/index.cjs +1 -1
- package/dist/hooks/useClientValidation/index.d.cts +1 -1
- package/dist/hooks/useClientValidation/index.d.ts +1 -1
- package/dist/hooks/useClientValidation/index.js +1 -1
- package/dist/hooks/useController/index.cjs +1 -1
- package/dist/hooks/useController/index.d.cts +1 -1
- package/dist/hooks/useController/index.d.ts +2 -1
- package/dist/hooks/useController/index.js +1 -1
- package/dist/hooks/useFormContext/index.cjs +1 -1
- package/dist/hooks/useFormContext/index.d.cts +1 -1
- package/dist/hooks/useFormContext/index.d.ts +1 -1
- package/dist/hooks/useFormContext/index.js +1 -1
- package/dist/hooks/useInput/index.cjs +1 -1
- package/dist/hooks/useInputValueDebounce/index.cjs +1 -1
- package/dist/hooks/useInputValueDebounce/index.d.cts +1 -1
- package/dist/hooks/useInputValueDebounce/index.d.ts +1 -1
- package/dist/hooks/useInputValueDebounce/index.js +1 -1
- package/dist/hooks/useInputValueTransform/index.cjs +1 -1
- package/dist/hooks/useInputValueTransform/index.d.cts +1 -1
- package/dist/hooks/useInputValueTransform/index.d.ts +1 -1
- package/dist/hooks/useInputValueTransform/index.js +1 -1
- package/dist/hooks/useUniformField/index.cjs +1 -1
- package/dist/hooks/useUniformField/index.d.cts +1 -1
- package/dist/hooks/useUniformField/index.d.ts +3 -3
- package/dist/hooks/useUniformField/index.js +1 -1
- package/dist/hooks/useUniformFieldArray/index.cjs +1 -1
- package/dist/hooks/useUniformFieldArray/index.d.cts +1 -1
- package/dist/hooks/useUniformFieldArray/index.d.ts +4 -24
- package/dist/hooks/useUniformFieldArray/index.js +1 -1
- package/dist/hooks/useWatchUserChange/index.cjs +1 -1
- package/dist/hooks/useWatchUserChange/index.d.cts +1 -1
- package/dist/hooks/useWatchUserChange/index.d.ts +1 -1
- package/dist/hooks/useWatchUserChange/index.js +1 -1
- package/dist/{index-C1PUx1tH.d.ts → index-0wXxS5M7.d.ts} +7 -7
- package/dist/index-0wXxS5M7.d.ts.map +1 -0
- package/dist/{index-DvB46QAb.d.ts → index-1Egh73pR.d.ts} +3 -3
- package/dist/{index-DvB46QAb.d.ts.map → index-1Egh73pR.d.ts.map} +1 -1
- package/dist/{index-DmMenZfj.d.ts → index-3v_vja2i.d.ts} +6 -6
- package/dist/{index-DmMenZfj.d.ts.map → index-3v_vja2i.d.ts.map} +1 -1
- package/dist/{index-BTTo_ufh.d.ts → index-7mx-IcDp.d.ts} +3 -3
- package/dist/{index-BTTo_ufh.d.ts.map → index-7mx-IcDp.d.ts.map} +1 -1
- package/dist/{index-WogV9uVV.d.cts → index-BDV3JVoX.d.cts} +7 -7
- package/dist/{index-WogV9uVV.d.cts.map → index-BDV3JVoX.d.cts.map} +1 -1
- package/dist/{index-DxdaxM3o.d.cts → index-BFLKkqA3.d.ts} +2 -2
- package/dist/{index-Edx7MxXu.d.ts.map → index-BFLKkqA3.d.ts.map} +1 -1
- package/dist/{index-DG9C0kHA.d.ts → index-BGXgvZKr.d.ts} +35 -35
- package/dist/{index-DG9C0kHA.d.ts.map → index-BGXgvZKr.d.ts.map} +1 -1
- package/dist/{index-CVnn6mEI.d.ts → index-BSjUaHEO.d.cts} +4 -4
- package/dist/{index-BITJ-CZL.d.cts.map → index-BSjUaHEO.d.cts.map} +1 -1
- package/dist/{index-jmQP58tO.d.cts → index-B_aIzCcx.d.cts} +3 -3
- package/dist/{index-jmQP58tO.d.cts.map → index-B_aIzCcx.d.cts.map} +1 -1
- package/dist/{index-BITJ-CZL.d.cts → index-Bcppi5O7.d.ts} +4 -4
- package/dist/{index-CVnn6mEI.d.ts.map → index-Bcppi5O7.d.ts.map} +1 -1
- package/dist/{index-Bj_lpc5r.d.cts → index-C2A_i57R.d.cts} +21 -21
- package/dist/index-C2A_i57R.d.cts.map +1 -0
- package/dist/index-CFBmva_r.d.ts +1 -0
- package/dist/{index-CSBE6Et0.d.cts → index-CHNp5R5N.d.cts} +6 -6
- package/dist/{index-CSBE6Et0.d.cts.map → index-CHNp5R5N.d.cts.map} +1 -1
- package/dist/{index-BL0DnIzh.d.ts → index-CHXv_rNR.d.ts} +3 -3
- package/dist/{index-BL0DnIzh.d.ts.map → index-CHXv_rNR.d.ts.map} +1 -1
- package/dist/{index--E2ZsMya.d.ts → index-CTp4vdDb.d.ts} +6 -6
- package/dist/{index--E2ZsMya.d.ts.map → index-CTp4vdDb.d.ts.map} +1 -1
- package/dist/{index-F11geOHD.d.ts → index-CUn9q5KD.d.ts} +6 -6
- package/dist/{index-F11geOHD.d.ts.map → index-CUn9q5KD.d.ts.map} +1 -1
- package/dist/{index-BxA_pJWn.d.cts → index-CZyNkPDq.d.ts} +22 -22
- package/dist/{index-C-2nxT8D.d.ts.map → index-CZyNkPDq.d.ts.map} +1 -1
- package/dist/{index-C-2nxT8D.d.ts → index-CeYRsehb.d.cts} +22 -22
- package/dist/index-CeYRsehb.d.cts.map +1 -0
- package/dist/{index-DRij_w43.d.cts → index-CiF2KXB7.d.cts} +6 -6
- package/dist/{index-DRij_w43.d.cts.map → index-CiF2KXB7.d.cts.map} +1 -1
- package/dist/{index-DNkZrb7P.d.cts → index-CjJHVJwD.d.cts} +35 -35
- package/dist/{index-DNkZrb7P.d.cts.map → index-CjJHVJwD.d.cts.map} +1 -1
- package/dist/{index-D38wOL-M.d.ts → index-CnsR8nkm.d.cts} +34 -34
- package/dist/index-CnsR8nkm.d.cts.map +1 -0
- package/dist/{index-CGnr_e53.d.ts → index-CqGabrzW.d.cts} +38 -38
- package/dist/index-CqGabrzW.d.cts.map +1 -0
- package/dist/{index-CYdvpGJF.d.cts → index-CuvvZMop.d.cts} +3 -3
- package/dist/{index-CYdvpGJF.d.cts.map → index-CuvvZMop.d.cts.map} +1 -1
- package/dist/{index-BWNJdLDV.d.ts → index-DNFUttM8.d.ts} +21 -21
- package/dist/{index-BWNJdLDV.d.ts.map → index-DNFUttM8.d.ts.map} +1 -1
- package/dist/{index-BQDEnYTq.d.ts → index-DVRtBywt.d.ts} +1 -1
- package/dist/{index-BQDEnYTq.d.ts.map → index-DVRtBywt.d.ts.map} +1 -1
- package/dist/{index-oyX8xu0F.d.cts → index-D_WidR7r.d.cts} +6 -6
- package/dist/{index-oyX8xu0F.d.cts.map → index-D_WidR7r.d.cts.map} +1 -1
- package/dist/index-D_egu-QT.d.cts +264 -0
- package/dist/index-D_egu-QT.d.cts.map +1 -0
- package/dist/index-DajjPPWM.d.ts +264 -0
- package/dist/index-DajjPPWM.d.ts.map +1 -0
- package/dist/{index-Bo_n9sse.d.cts → index-DcYFLiul.d.cts} +48 -48
- package/dist/index-DcYFLiul.d.cts.map +1 -0
- package/dist/index-DnzC0GCS.d.ts.map +1 -1
- package/dist/{index-Edx7MxXu.d.ts → index-DvF_C1Bz.d.cts} +3 -3
- package/dist/{index-DxdaxM3o.d.cts.map → index-DvF_C1Bz.d.cts.map} +1 -1
- package/dist/{index-Cb0AgRRa.d.cts → index-cadUZZIY.d.cts} +3 -3
- package/dist/{index-Cb0AgRRa.d.cts.map → index-cadUZZIY.d.cts.map} +1 -1
- package/dist/{index-PU5WNOH9.d.cts → index-g9TZhGnE.d.cts} +3 -3
- package/dist/{index-PU5WNOH9.d.cts.map → index-g9TZhGnE.d.cts.map} +1 -1
- package/dist/index-lQ_hGQ08.d.cts +1 -0
- package/dist/{index-C0L7GvgN.d.cts → index-op7zETAQ.d.ts} +34 -34
- package/dist/index-op7zETAQ.d.ts.map +1 -0
- package/dist/{index-DoS0lVRe.d.cts → index-yVkU2v6b.d.ts} +37 -37
- package/dist/{index-CGnr_e53.d.ts.map → index-yVkU2v6b.d.ts.map} +1 -1
- package/dist/index.cjs +28 -27
- package/dist/index.d.cts +27 -27
- package/dist/index.d.ts +27 -26
- package/dist/index.js +26 -26
- package/dist/partials/FieldCopyTestIdButton/index.cjs +1 -1
- package/dist/partials/FieldCopyTestIdButton/index.d.cts +1 -1
- package/dist/partials/FieldCopyTestIdButton/index.d.ts +1 -1
- package/dist/partials/FieldCopyTestIdButton/index.js +1 -1
- package/dist/partials/FieldValidationError/index.cjs +1 -1
- package/dist/partials/FieldValidationError/index.d.cts +1 -1
- package/dist/partials/FieldValidationError/index.d.ts +1 -1
- package/dist/partials/FieldValidationError/index.js +1 -1
- package/dist/{useClientValidation-DJ4JuN_9.d.ts → useClientValidation-Bg0q3Axc.d.ts} +3 -3
- package/dist/{useClientValidation-DJ4JuN_9.d.ts.map → useClientValidation-Bg0q3Axc.d.ts.map} +1 -1
- package/dist/{useClientValidation-BnnscAEe.js → useClientValidation-BrTtRnqi.js} +3 -3
- package/dist/{useClientValidation-BnnscAEe.js.map → useClientValidation-BrTtRnqi.js.map} +1 -1
- package/dist/{useClientValidation-BQqwz628.d.cts → useClientValidation-BvPDQmf6.d.cts} +3 -3
- package/dist/{useClientValidation-BQqwz628.d.cts.map → useClientValidation-BvPDQmf6.d.cts.map} +1 -1
- package/dist/{useClientValidation-CmYVGlLr.cjs → useClientValidation-CdC7lEYP.cjs} +4 -4
- package/dist/{useClientValidation-CmYVGlLr.cjs.map → useClientValidation-CdC7lEYP.cjs.map} +1 -1
- package/dist/{useController-C_MZLZIp.d.cts → useController-BArZd2Vp.d.cts} +1 -1
- package/dist/{useController-C_MZLZIp.d.cts.map → useController-BArZd2Vp.d.cts.map} +1 -1
- package/dist/{useController-CkmO5CLh.cjs → useController-BBxji1nQ.cjs} +3 -3
- package/dist/{useController-CkmO5CLh.cjs.map → useController-BBxji1nQ.cjs.map} +1 -1
- package/dist/{useController-hjpJQf0w.d.ts → useController-MVHJ7WFp.d.ts} +1 -1
- package/dist/{useController-hjpJQf0w.d.ts.map → useController-MVHJ7WFp.d.ts.map} +1 -1
- package/dist/{useController-CumIERks.js → useController-g0AlWM__.js} +3 -3
- package/dist/{useController-CumIERks.js.map → useController-g0AlWM__.js.map} +1 -1
- package/dist/{useFormContext-B083Y-kw.d.cts → useFormContext--yod5xzQ.d.cts} +3 -3
- package/dist/useFormContext--yod5xzQ.d.cts.map +1 -0
- package/dist/{useFormContext-JCm1UR_e.js → useFormContext-BFoXZNkp.js} +3 -3
- package/dist/{useFormContext-JCm1UR_e.js.map → useFormContext-BFoXZNkp.js.map} +1 -1
- package/dist/{useFormContext-Bp0EODoO.cjs → useFormContext-CEr3zcL6.cjs} +3 -3
- package/dist/{useFormContext-Bp0EODoO.cjs.map → useFormContext-CEr3zcL6.cjs.map} +1 -1
- package/dist/{useFormContext-B2TS6xq0.d.ts → useFormContext-Cw6aAhos.d.ts} +3 -3
- package/dist/useFormContext-Cw6aAhos.d.ts.map +1 -0
- package/dist/{useInputValueDebounce-B5b-v8Hc.d.cts → useInputValueDebounce-DI1C6oaU.d.cts} +5 -1
- package/dist/useInputValueDebounce-DI1C6oaU.d.cts.map +1 -0
- package/dist/{useInputValueDebounce-DaH5ONlQ.js → useInputValueDebounce-Dop_8_OK.js} +12 -3
- package/dist/useInputValueDebounce-Dop_8_OK.js.map +1 -0
- package/dist/{useInputValueDebounce-BcUyaS94.cjs → useInputValueDebounce-TiNR4jtG.cjs} +13 -4
- package/dist/useInputValueDebounce-TiNR4jtG.cjs.map +1 -0
- package/dist/{useInputValueDebounce-DoRuSF6R.d.ts → useInputValueDebounce-fhmVn1aO.d.ts} +5 -1
- package/dist/useInputValueDebounce-fhmVn1aO.d.ts.map +1 -0
- package/dist/{useInputValueTransform-DFPA3KVy.cjs → useInputValueTransform-BNmfaj5D.cjs} +4 -3
- package/dist/{useInputValueTransform-DFPA3KVy.cjs.map → useInputValueTransform-BNmfaj5D.cjs.map} +1 -1
- package/dist/{useInputValueTransform-D7LfyYRe.d.ts → useInputValueTransform-BV8o0PMI.d.cts} +3 -2
- package/dist/useInputValueTransform-BV8o0PMI.d.cts.map +1 -0
- package/dist/{useInputValueTransform-aiIf8lq5.js → useInputValueTransform-CMNC21vX.js} +3 -2
- package/dist/{useInputValueTransform-aiIf8lq5.js.map → useInputValueTransform-CMNC21vX.js.map} +1 -1
- package/dist/{useInputValueTransform-BID-CQ-y.d.cts → useInputValueTransform-Cc0qEsnS.d.ts} +3 -2
- package/dist/useInputValueTransform-Cc0qEsnS.d.ts.map +1 -0
- package/dist/{useUniformField-B2OZ-Z1G.d.cts → useUniformField-B2zQtEbr.d.cts} +4 -4
- package/dist/{useUniformField-B2OZ-Z1G.d.cts.map → useUniformField-B2zQtEbr.d.cts.map} +1 -1
- package/dist/{useUniformField-gU4qYUwL.js → useUniformField-BKVVns0E.js} +34 -8
- package/dist/useUniformField-BKVVns0E.js.map +1 -0
- package/dist/{useUniformField-Bj23Kvbs.cjs → useUniformField-D6fwSjrH.cjs} +35 -9
- package/dist/useUniformField-D6fwSjrH.cjs.map +1 -0
- package/dist/{useUniformField-CwEHonNe.d.ts → useUniformField-RxZqXMuD.d.ts} +4 -4
- package/dist/{useUniformField-CwEHonNe.d.ts.map → useUniformField-RxZqXMuD.d.ts.map} +1 -1
- package/dist/{useUniformFieldArray-CXoWvu6m.d.ts → useUniformFieldArray-B_c55CnX.d.ts} +4 -4
- package/dist/useUniformFieldArray-B_c55CnX.d.ts.map +1 -0
- package/dist/{useUniformFieldArray-B5PyxL1P.js → useUniformFieldArray-BwE634m6.js} +4 -4
- package/dist/useUniformFieldArray-BwE634m6.js.map +1 -0
- package/dist/{useUniformFieldArray-G1lokW7x.cjs → useUniformFieldArray-Byfmzq97.cjs} +5 -5
- package/dist/useUniformFieldArray-Byfmzq97.cjs.map +1 -0
- package/dist/{useUniformFieldArray-qtJMEosJ.d.cts → useUniformFieldArray-WRuIMhw6.d.cts} +4 -4
- package/dist/useUniformFieldArray-WRuIMhw6.d.cts.map +1 -0
- package/dist/{useWatchUserChange-BAdiqg2q.d.ts → useWatchUserChange-Bf5JKDJJ.d.ts} +1 -1
- package/dist/{useWatchUserChange-BAdiqg2q.d.ts.map → useWatchUserChange-Bf5JKDJJ.d.ts.map} +1 -1
- package/dist/{useWatchUserChange-COVdHmki.d.cts → useWatchUserChange-Br4Q7syM.d.cts} +1 -1
- package/dist/{useWatchUserChange-COVdHmki.d.cts.map → useWatchUserChange-Br4Q7syM.d.cts.map} +1 -1
- package/dist/{useWatchUserChange-BnxYE-0b.cjs → useWatchUserChange-TMfaTCcp.cjs} +3 -3
- package/dist/{useWatchUserChange-BnxYE-0b.cjs.map → useWatchUserChange-TMfaTCcp.cjs.map} +1 -1
- package/dist/{useWatchUserChange-C1ezpj0t.js → useWatchUserChange-fZy6nGtD.js} +2 -2
- package/dist/{useWatchUserChange-C1ezpj0t.js.map → useWatchUserChange-fZy6nGtD.js.map} +1 -1
- package/package.json +3 -3
- package/dist/Input-DXMWGTBh.js.map +0 -1
- package/dist/Input-DeTpxiK_.cjs.map +0 -1
- package/dist/helpers-B-CJOBt3.js.map +0 -1
- package/dist/helpers-B84E9vHd.cjs.map +0 -1
- package/dist/index-Bj_lpc5r.d.cts.map +0 -1
- package/dist/index-Bo_n9sse.d.cts.map +0 -1
- package/dist/index-BxA_pJWn.d.cts.map +0 -1
- package/dist/index-C0L7GvgN.d.cts.map +0 -1
- package/dist/index-C1PUx1tH.d.ts.map +0 -1
- package/dist/index-CADnFWHq.d.ts +0 -264
- package/dist/index-CADnFWHq.d.ts.map +0 -1
- package/dist/index-D38wOL-M.d.ts.map +0 -1
- package/dist/index-DoS0lVRe.d.cts.map +0 -1
- package/dist/index-G0IgQWoU.d.cts +0 -134
- package/dist/index-G0IgQWoU.d.cts.map +0 -1
- package/dist/index-UjKqRe-8.d.ts +0 -134
- package/dist/index-UjKqRe-8.d.ts.map +0 -1
- package/dist/index-sJZ434Sg.d.cts +0 -264
- package/dist/index-sJZ434Sg.d.cts.map +0 -1
- package/dist/useFormContext-B083Y-kw.d.cts.map +0 -1
- package/dist/useFormContext-B2TS6xq0.d.ts.map +0 -1
- package/dist/useInputValueDebounce-B5b-v8Hc.d.cts.map +0 -1
- package/dist/useInputValueDebounce-BcUyaS94.cjs.map +0 -1
- package/dist/useInputValueDebounce-DaH5ONlQ.js.map +0 -1
- package/dist/useInputValueDebounce-DoRuSF6R.d.ts.map +0 -1
- package/dist/useInputValueTransform-BID-CQ-y.d.cts.map +0 -1
- package/dist/useInputValueTransform-D7LfyYRe.d.ts.map +0 -1
- package/dist/useUniformField-Bj23Kvbs.cjs.map +0 -1
- package/dist/useUniformField-gU4qYUwL.js.map +0 -1
- package/dist/useUniformFieldArray-B5PyxL1P.js.map +0 -1
- package/dist/useUniformFieldArray-CXoWvu6m.d.ts.map +0 -1
- package/dist/useUniformFieldArray-G1lokW7x.cjs.map +0 -1
- package/dist/useUniformFieldArray-qtJMEosJ.d.cts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldArray-CDLaGvNj.js","names":["SortDragHandle","Grid","ElementActionsMenu","ElementRemoveButton","FieldValidationError","FieldArrayLabel","SortContext","FieldArrayElement","FieldArrayValidationError","ElementAppendButton","FieldArray"],"sources":["../src/FieldArray/subcomponents/ElementAppendButton.tsx","../src/FieldArray/subcomponents/ElementActionsMenu.tsx","../src/FieldArray/subcomponents/ElementRemoveButton.tsx","../src/FieldArray/subcomponents/SortDragHandle.tsx","../src/FieldArray/subcomponents/FieldArrayElement.tsx","../src/FieldArray/subcomponents/FieldArrayLabel.tsx","../src/FieldArray/subcomponents/FieldArrayValidationError.tsx","../src/FieldArray/subcomponents/SortContext.tsx","../src/FieldArray/FieldArray.tsx","../src/FieldArray/index.ts"],"sourcesContent":["import type { ClassValue } from '@fuf-stack/pixel-utils';\n\nimport { FaPlus } from 'react-icons/fa';\n\nimport { cn } from '@fuf-stack/pixel-utils';\nimport { Button } from '@fuf-stack/pixels';\n\ninterface ElementAppendButtonProps {\n /** text of the append element button */\n appendButtonText?: string;\n /** CSS class name */\n className?: ClassValue;\n /** click handler */\n onClick: () => void;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\nconst ElementAppendButton = ({\n appendButtonText = 'Add Element',\n className = undefined,\n onClick,\n testId = undefined,\n}: ElementAppendButtonProps) => {\n return (\n <Button\n disableAnimation\n className={cn(className)}\n onClick={onClick}\n size=\"sm\"\n testId={testId}\n variant=\"light\"\n >\n <FaPlus />\n <span>{appendButtonText}</span>\n </Button>\n );\n};\n\nexport default ElementAppendButton;\n","import type { ClassValue } from '@fuf-stack/pixel-utils';\nimport type { MenuItem } from '@fuf-stack/pixels';\nimport type { Key } from 'react';\nimport type { FieldArrayElementMethods } from './FieldArrayElement';\n\nimport { FaCopy, FaTimes } from 'react-icons/fa';\nimport { VscInsert } from 'react-icons/vsc';\n\nimport { cn } from '@fuf-stack/pixel-utils';\nimport { Menu } from '@fuf-stack/pixels';\n\nexport interface ElementActionsMenuProps {\n /** CSS class name */\n className?: ClassValue;\n /** Whether duplicate action is available */\n duplicate?: boolean;\n /** Whether insert after action is available */\n insertAfter?: boolean;\n /** Whether to show remove button (false when last element is not deletable) */\n showRemove?: boolean;\n /** Field array operation methods */\n methods: FieldArrayElementMethods;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\n/**\n * Menu component for field array element actions (remove, duplicate, insert after)\n */\nconst ElementActionsMenu = ({\n className = undefined,\n duplicate = false,\n insertAfter = false,\n showRemove = true,\n methods,\n testId = undefined,\n}: ElementActionsMenuProps) => {\n const handleAction = (key: Key) => {\n switch (key) {\n case 'remove':\n methods.remove();\n break;\n case 'duplicate':\n methods.duplicate();\n break;\n case 'insertAfter':\n methods.insert();\n break;\n default:\n break;\n }\n };\n\n // Build menu items based on available actions\n const menuItems: MenuItem[] = [];\n\n if (duplicate) {\n menuItems.push({\n key: 'duplicate',\n label: 'Duplicate',\n icon: <FaCopy />,\n });\n }\n\n if (insertAfter) {\n menuItems.push({\n key: 'insertAfter',\n label: 'Insert After',\n icon: <VscInsert />,\n });\n }\n\n if (showRemove) {\n menuItems.push({\n key: 'remove',\n className: 'text-danger',\n label: 'Remove',\n icon: <FaTimes />,\n });\n }\n\n return (\n <Menu\n ariaLabel=\"Element actions\"\n items={menuItems}\n onAction={handleAction}\n placement=\"right\"\n testId={testId}\n triggerButtonProps={{\n className: cn(className),\n disableRipple: true,\n size: 'md',\n variant: 'light',\n }}\n />\n );\n};\n\nexport default ElementActionsMenu;\n","import type { ClassValue } from '@fuf-stack/pixel-utils';\n\nimport { FaTimes } from 'react-icons/fa';\n\nimport { motion } from '@fuf-stack/pixel-motion';\nimport { cn } from '@fuf-stack/pixel-utils';\nimport { Button } from '@fuf-stack/pixels';\n\ninterface ElementRemoveButtonProps {\n /** CSS class name */\n className?: ClassValue;\n /** Globally disable animations (used for first render or prefers-reduced-motion) */\n disableAnimation?: boolean;\n /** click handler */\n onClick: () => void;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\nconst ElementRemoveButton = ({\n className = undefined,\n disableAnimation = false,\n onClick,\n testId = undefined,\n}: ElementRemoveButtonProps) => {\n const button = (\n <Button\n ariaLabel=\"remove element\"\n className={cn(className)}\n color=\"danger\"\n icon={<FaTimes />}\n onClick={onClick}\n size=\"sm\"\n testId={testId}\n variant=\"light\"\n />\n );\n\n if (disableAnimation) {\n return button;\n }\n\n return (\n <motion.div\n animate={{ opacity: 1, width: 'auto' }}\n className=\"flex\"\n exit={{ opacity: 0, width: 0 }}\n initial={{ opacity: 0, width: 0 }}\n transition={{ duration: 0.2 }}\n >\n {button}\n </motion.div>\n );\n};\n\nexport default ElementRemoveButton;\n","import type { ClassValue } from '@fuf-stack/pixel-utils';\n\nimport { FaGripVertical } from 'react-icons/fa';\n\nimport { useSortable } from '@dnd-kit/sortable';\n\nimport { cn } from '@fuf-stack/pixel-utils';\n\ninterface SortDragHandleProps {\n /** Optional CSS class name */\n className?: ClassValue;\n /** Unique identifier for sortable item */\n id: string | number;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\n/**\n * Drag handle component that integrates with dnd-kit sortable functionality.\n * Renders a vertical grip icon that can be used to reorder items.\n */\nconst SortDragHandle = ({\n className = undefined,\n id,\n testId = undefined,\n}: SortDragHandleProps) => {\n // Get dnd-kit sortable attributes and listeners\n const { attributes, listeners } = useSortable({ id });\n\n return (\n <div\n className={cn(className)}\n data-testid={testId}\n {...attributes}\n {...listeners}\n >\n <FaGripVertical />\n </div>\n );\n};\n\nexport default SortDragHandle;\n","import type { Variants as MotionVariants } from '@fuf-stack/pixel-motion';\nimport type { ClassValue } from '@fuf-stack/pixel-utils';\nimport type { FieldArrayFeatures } from '../types';\n\nimport { useState } from 'react';\n\nimport { useSortable } from '@dnd-kit/sortable';\nimport { CSS } from '@dnd-kit/utilities';\n\nimport { AnimatePresence, motion } from '@fuf-stack/pixel-motion';\nimport { cn } from '@fuf-stack/pixel-utils';\n\nimport { Grid } from '../../Grid';\nimport ElementActionsMenu from './ElementActionsMenu';\nimport ElementRemoveButton from './ElementRemoveButton';\nimport SortDragHandle from './SortDragHandle';\n\nexport interface FieldArrayElementMethods {\n /** Add new element at end */\n append: () => void;\n /** Clone current element */\n duplicate: () => void;\n /** Add new element after current */\n insert: () => void;\n /** Remove current element */\n remove: () => void;\n}\n\ninterface FieldArrayElementProps extends FieldArrayFeatures {\n /** Form elements to render inside array element */\n children: React.ReactNode;\n /** CSS class names for component parts */\n className: {\n /** Class of wrapper grid inside the li that wraps the rendered element fields directly */\n elementFieldsGrid?: ClassValue;\n /** Class for the li (performs motion animations) */\n listItem?: ClassValue;\n /** Class for the li inner div (wraps the rendered element fields) */\n listItemInner?: ClassValue;\n /** Class for the actions menu button */\n actionsMenuButton?: ClassValue;\n /** Class for the remove element button (when menu is not used) */\n removeButton?: ClassValue;\n /** Class for the drag handle when sorting enabled */\n sortDragHandle?: ClassValue;\n };\n /** Globally disable animations for this item (used for first render or prefers-reduced-motion) */\n disableAnimation?: boolean;\n /** Bottom margin for elements (for backwards compatibility) */\n elementMarginBottom?: React.CSSProperties['marginBottom'];\n /** All fields in the form array */\n fields: Record<'id', string>[];\n /** Unique identifier for drag/drop */\n id: string | number;\n /** Field index in array */\n index: number;\n /** Prevent deletion of last remaining element */\n lastNotDeletable?: boolean;\n /** Field array operation methods */\n methods: FieldArrayElementMethods;\n /** HTML data-testid of the element */\n testId?: string;\n}\n\n/**\n * Form array element component using react-hook-form with drag-drop sorting\n * and validation capabilities. Animations when elements are added or removed\n * improve the user experience and provide a better visual feedback.\n */\nconst FieldArrayElement = ({\n children,\n className,\n disableAnimation = false,\n duplicate = false,\n elementMarginBottom: _elementMarginBottom = undefined,\n fields,\n id,\n index: _index,\n insertAfter = false,\n lastNotDeletable = true,\n methods,\n sortable = false,\n testId = undefined,\n}: FieldArrayElementProps) => {\n // Apply transform styles when sortable is enabled for smooth drag animations\n // transform: handles the item's position during drag\n // transition: controls the animation timing when dropping\n const { setNodeRef, transform, transition, isDragging } = useSortable({ id });\n const sortingStyle = sortable\n ? {\n transform: CSS.Translate.toString(transform),\n transition,\n zIndex: isDragging ? 50 : undefined,\n }\n : undefined;\n\n // Local visibility to allow exit animation before removing from RHF state\n const [isVisible, setIsVisible] = useState(true);\n\n // Motion variants for the list item\n const listItemMotionVariants: MotionVariants = {\n hidden: { opacity: 0, height: 0, marginBottom: 0 },\n visible: {\n opacity: 1,\n height: 'auto',\n transition: { duration: 0.2, ease: 'circOut' },\n // push last visible item down to overlap with append button (hide double border)\n marginBottom: '-1px',\n },\n exit: {\n opacity: 0,\n height: 0,\n marginBottom: 0,\n transition: {\n // on exit first fade out, then shrink\n opacity: { duration: 0.1, ease: 'circOut' },\n height: { delay: 0.1, duration: 0.2, ease: 'circOut' },\n },\n },\n };\n\n // Height animation handled on <motion.li> using overflow hidden\n return (\n <AnimatePresence\n mode=\"wait\"\n // remove from RHF state after exit animation\n onExitComplete={() => {\n methods.remove();\n }}\n >\n {isVisible ? (\n <motion.li\n key={id}\n ref={setNodeRef}\n animate={disableAnimation ? undefined : 'visible'}\n className={cn(className.listItem)}\n data-dragging={isDragging}\n data-testid={`${testId}_element`}\n exit={disableAnimation ? undefined : 'exit'}\n initial={disableAnimation ? false : 'hidden'}\n style={sortingStyle}\n variants={disableAnimation ? undefined : listItemMotionVariants}\n >\n <div className={cn(className.listItemInner)}>\n {/** sorting drag handle */}\n {sortable ? (\n <SortDragHandle\n className={className.sortDragHandle}\n id={id}\n testId={`${testId}_sort_drag_handle`}\n />\n ) : null}\n\n {/** render element fields in Grid component */}\n <Grid\n className={cn(className.elementFieldsGrid)}\n testId={`${testId}_element_fields_grid`}\n >\n {/* render actual fields */}\n {children}\n </Grid>\n\n {/** actions menu when duplicate or insertAfter is enabled */}\n {duplicate || insertAfter ? (\n <ElementActionsMenu\n className={className.actionsMenuButton}\n duplicate={duplicate}\n insertAfter={insertAfter}\n showRemove={!(lastNotDeletable && fields.length === 1)}\n testId={`${testId}_actions_menu`}\n methods={{\n ...methods,\n remove: () => {\n if (disableAnimation) {\n methods.remove();\n } else {\n setIsVisible(false);\n }\n },\n }}\n />\n ) : (\n <>\n {/** remove element button (when menu is not used) */}\n <AnimatePresence initial={false}>\n {lastNotDeletable && fields.length === 1 ? null : (\n <ElementRemoveButton\n key=\"remove-button\"\n className={className.removeButton}\n disableAnimation={disableAnimation}\n testId={`${testId}_remove_button`}\n onClick={() => {\n if (disableAnimation) {\n methods.remove();\n } else {\n setIsVisible(false);\n }\n }}\n />\n )}\n </AnimatePresence>\n </>\n )}\n </div>\n </motion.li>\n ) : null}\n </AnimatePresence>\n );\n};\n\nexport default FieldArrayElement;\n","import type { ReactNode } from 'react';\n\nimport { cn } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../../hooks/useUniformField';\n\nexport interface FieldArrayLabelProps {\n /** CSS class name */\n className?: string;\n /** Label content */\n label: ReactNode;\n /** Field name */\n name: string;\n}\n\n/**\n * Renders the label for a FieldArray component.\n *\n * This component handles displaying the array label with proper accessibility\n * attributes using the label props from useUniformField.\n */\nconst FieldArrayLabel = ({\n className = undefined,\n label: _label,\n name,\n}: FieldArrayLabelProps) => {\n const { error, getLabelProps, invalid, label } = useUniformField({\n name,\n label: _label,\n });\n\n // when no label is provided, don't render anything\n if (!_label) {\n return null;\n }\n\n // @ts-expect-error - error._errors exists but not typed\n const hasErrors = invalid && error?._errors;\n\n return (\n <div\n {...getLabelProps()}\n aria-level={3}\n role=\"heading\"\n className={cn(getLabelProps()?.className, className, {\n // when there are no array level errors, the label should have foreground color\n 'text-foreground!': !hasErrors,\n })}\n >\n {label}\n </div>\n );\n};\n\nexport default FieldArrayLabel;\n","import {\n AnimatePresence,\n motion,\n useReducedMotion,\n} from '@fuf-stack/pixel-motion';\nimport { cn } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../../hooks/useUniformField';\nimport FieldValidationError from '../../partials/FieldValidationError/FieldValidationError';\n\nexport interface FieldArrayValidationErrorProps {\n /** Field name */\n name: string;\n}\n\n/**\n * Renders array-level validation errors for FieldArray.\n *\n * This component handles validation errors that apply to the entire array\n * (e.g., \"Array must contain at least 3 elements\", \"Array elements are not unique\"),\n * as opposed to field-level errors which apply to individual array elements.\n *\n * The component wraps errors in the proper accessibility markup and animates\n * them in/out using Framer Motion when they appear or are resolved.\n */\nconst FieldArrayValidationError = ({\n name,\n}: FieldArrayValidationErrorProps) => {\n const {\n error,\n getErrorMessageProps,\n getHelperWrapperProps,\n invalid,\n testId,\n } = useUniformField({\n name,\n });\n\n // disable all animation if user prefers reduced motion\n const disableAnimation = useReducedMotion();\n\n // @ts-expect-error - error._errors exists but not typed\n const hasErrors = invalid && error?._errors;\n\n return (\n <AnimatePresence initial={!disableAnimation}>\n {hasErrors ? (\n <motion.div\n key=\"field-array-errors\"\n exit={disableAnimation ? undefined : { opacity: 0, height: 0 }}\n initial={disableAnimation ? false : { height: 0, opacity: 0 }}\n style={{ overflow: 'hidden' }}\n transition={{ duration: 0.2, ease: 'circOut' }}\n animate={\n disableAnimation ? undefined : { opacity: 1, height: 'auto' }\n }\n >\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 add padding\n 'block px-3 py-2',\n )}\n >\n <div {...getErrorMessageProps()}>\n <FieldValidationError\n // @ts-expect-error - error._errors exists but not typed\n error={error._errors}\n testId={testId}\n />\n </div>\n </div>\n </motion.div>\n ) : null}\n </AnimatePresence>\n );\n};\n\nexport default FieldArrayValidationError;\n","import type { DragEndEvent } from '@dnd-kit/core';\nimport type { ReactNode } from 'react';\nimport type { UseFieldArrayMove } from 'react-hook-form';\n\nimport { useFormContext } from 'react-hook-form';\n\nimport {\n closestCenter,\n DndContext,\n KeyboardSensor,\n PointerSensor,\n useSensor,\n useSensors,\n} from '@dnd-kit/core';\nimport {\n restrictToVerticalAxis,\n restrictToWindowEdges,\n} from '@dnd-kit/modifiers';\nimport {\n SortableContext,\n verticalListSortingStrategy,\n} from '@dnd-kit/sortable';\n\ninterface SortContextProps {\n /** child components */\n children: ReactNode;\n /** Array of objects containing unique IDs for sortable items */\n fields: Record<'id', string>[];\n /** name of the field array */\n name: string;\n /** react-hook-form's move function to update field array indices */\n move: UseFieldArrayMove;\n /** enable/disable sorting functionality */\n sortable: boolean;\n}\n\n/**\n * A wrapper component that provides drag-and-drop sorting functionality for field arrays\n * using dnd-kit and react-hook-form.\n *\n * This component integrates with react-hook-form's field arrays to enable vertical\n * drag-and-drop reordering of form fields. It supports both pointer (mouse/touch)\n * and keyboard interactions for accessibility.\n */\nconst SortContext = ({\n children,\n fields,\n move,\n name,\n sortable,\n}: SortContextProps): ReactNode => {\n const { trigger } = useFormContext();\n\n // Initialize sensors for both pointer (mouse/touch) and keyboard interactions\n const sensors = useSensors(\n useSensor(PointerSensor),\n useSensor(KeyboardSensor),\n );\n\n // Early return if sorting is disabled\n if (!sortable) {\n return children;\n }\n\n /**\n * Handles the end of a drag operation by updating field positions\n * @param event - The drag end event containing active and over elements\n */\n const handleDragEnd = (event: DragEndEvent) => {\n const { active, over } = event;\n\n // Only move if dropping over a different item\n if (active.id !== over?.id) {\n // Find the indices of the dragged item and drop target\n const oldIndex = fields.findIndex((field) => {\n return field.id === active.id;\n });\n const newIndex = fields.findIndex((field) => {\n return field.id === over?.id;\n });\n // Update the field array order using react-hook-form's move function\n move(oldIndex, newIndex);\n\n // Finally trigger validation for the array field,\n // so validation errors are updated for the new order\n trigger(name);\n }\n };\n\n return (\n <DndContext\n collisionDetection={closestCenter}\n modifiers={[restrictToVerticalAxis, restrictToWindowEdges]}\n onDragEnd={handleDragEnd}\n sensors={sensors}\n >\n <SortableContext\n strategy={verticalListSortingStrategy}\n items={fields.map((field) => {\n return field.id;\n })}\n >\n {children}\n </SortableContext>\n </DndContext>\n );\n};\n\nexport default SortContext;\n","import type { FieldArrayElementMethods } from './subcomponents/FieldArrayElement';\nimport type { FieldArrayProps } from './types';\n\nimport { cn, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { flatArrayKey } from '../helpers';\nimport { useUniformFieldArray } from '../hooks/useUniformFieldArray';\nimport ElementAppendButton from './subcomponents/ElementAppendButton';\nimport FieldArrayElement from './subcomponents/FieldArrayElement';\nimport FieldArrayLabel from './subcomponents/FieldArrayLabel';\nimport FieldArrayValidationError from './subcomponents/FieldArrayValidationError';\nimport SortContext from './subcomponents/SortContext';\n\nexport const fieldArrayVariants = tv({\n slots: {\n /** base class for the field array wrapper */\n base: [\n // base styles\n 'overflow-hidden rounded-small border border-divider bg-content1',\n // divider between items\n 'divide-y divide-divider',\n ],\n /** class for the actions menu button */\n actionsMenuButton: [\n // base styles\n 'flex items-center justify-center text-default-600',\n // fixed height/no round corners/center align\n 'h-full rounded-none',\n // focus styles - inset ring\n 'outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus',\n ],\n /** class for the append button */\n appendButton: [\n // base styles\n 'w-full justify-start rounded-b-small rounded-t-none font-semibold',\n // match label height (p-3 = 12px vertical padding + text-base line height)\n '!h-[48px] !min-h-0',\n // focus styles - inset ring with rounded bottom corners to match container\n 'outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus',\n ],\n /** class for the element fields grid */\n elementFieldsGrid: ['w-full grow p-3'],\n /** class for the label */\n label: [\n // override HeroUI label positioning and display\n 'pointer-events-auto! static! z-auto! block! w-full!',\n // reset any transforms or translations\n 'translate-x-0! translate-y-0! transform-none!',\n // card header styling - use text-medium (16px) instead of text-base for correct 48px height\n 'rounded-t-small p-3 font-semibold text-medium',\n ],\n /** class for the list */\n list: ['overflow-hidden'],\n /** class for the list wrapper */\n listWrapper: ['overflow-hidden'],\n /** class for the list item (performs motion animations) */\n listItem: [\n // base styles\n 'group relative flex flex-row',\n // overlap borders by shifting first item up 1px (similar to how last item overlaps with append button)\n 'first:-mt-px',\n ],\n /** class for the list item inner */\n listItemInner: [\n // base styles\n 'flex w-full flex-row items-stretch divide-divider bg-content1',\n // x division and borders\n 'divide-x divide-solid border-b border-t border-divider',\n ],\n /** class for the remove button */\n removeButton: [\n // base styles\n 'flex items-center justify-center',\n // fixed height/no round corners\n '!h-full !min-h-0 !rounded-none px-3',\n // focus styles - inset ring\n 'outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus',\n ],\n /** class for the sort drag handle */\n sortDragHandle: [\n // base styles\n 'flex cursor-grab items-center justify-center px-2 text-default-600 transition-colors',\n // hover and dragging state\n 'hover:bg-default-100 active:cursor-grabbing group-data-[dragging=true]:bg-default-100',\n // focus styles - inset ring\n 'outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus',\n ],\n },\n variants: {\n hasLabel: {\n false: {\n // focus styles - when there is no label, the first item actions menu button should have rounded top right corners\n actionsMenuButton:\n 'group-[:first-child]:!rounded-tr-small group-[:first-child]:group-data-[dragging=true]:!rounded-tr-none',\n // focus styles - when there is no label, the first item remove button focus ring should have rounded top right corners\n removeButton:\n 'group-[:first-child]:!rounded-tr-small group-[:first-child]:group-data-[dragging=true]:!rounded-tr-none',\n // focus styles - when there is no label, the first item sort drag handle focus ring should have rounded top left corners\n sortDragHandle:\n 'group-[:first-child]:rounded-tl-small group-[:first-child]:group-data-[dragging=true]:rounded-tl-none',\n },\n },\n },\n});\n\n/**\n * FieldArray component based in [RHF useFieldArray](https://react-hook-form.com/docs/usefieldarray)\n */\nconst FieldArray = ({\n appendButtonText = 'Add Element',\n children,\n className: _className = undefined,\n duplicate = false,\n elementInitialValue: _elementInitialValue = null,\n elementMarginBottom = undefined,\n flat = false,\n insertAfter = false,\n lastElementNotRemovable = false,\n name,\n sortable = false,\n ...uniformFieldProps\n}: FieldArrayProps) => {\n const {\n fields,\n append,\n remove,\n insert,\n move,\n disableAnimation,\n elementInitialValue,\n getValues,\n testId,\n } = useUniformFieldArray({\n name,\n flat,\n elementInitialValue: _elementInitialValue,\n lastElementNotRemovable,\n ...uniformFieldProps,\n });\n\n // className from slots\n const variants = fieldArrayVariants({ hasLabel: !!uniformFieldProps.label });\n const className = variantsToClassNames(variants, _className, 'base');\n\n return (\n <div className={className.base}>\n {/* field array label */}\n <FieldArrayLabel\n className={className.label}\n label={uniformFieldProps.label}\n name={name}\n />\n\n {fields.length ? (\n /* list wrapper */\n <div className={cn(className.listWrapper)}>\n {/* sortable context */}\n <SortContext\n fields={fields}\n move={move}\n name={name}\n sortable={sortable}\n >\n {/* list container */}\n <ul className={className.list} data-testid={testId}>\n {/* fields / list elements */}\n {fields.map((field, index) => {\n const elementName = flat\n ? `${name}.${index}.${flatArrayKey}`\n : `${name}.${index}`;\n const elementTestId = `${testId}_${index}`;\n\n // create methods for element\n const elementMethods: FieldArrayElementMethods = {\n append: () => {\n append(elementInitialValue);\n },\n duplicate: () => {\n const values = getValues(name);\n const currentValue = (values as unknown[])[index];\n const nextValue = flat\n ? { [flatArrayKey]: currentValue }\n : currentValue;\n insert(index + 1, nextValue);\n },\n insert: () => {\n insert(index + 1, elementInitialValue);\n },\n remove: () => {\n remove(index);\n },\n };\n\n return (\n <FieldArrayElement\n key={field.id}\n className={className}\n disableAnimation={disableAnimation}\n duplicate={duplicate}\n elementMarginBottom={elementMarginBottom}\n fields={fields}\n id={field.id}\n index={index}\n insertAfter={insertAfter}\n lastNotDeletable={lastElementNotRemovable}\n methods={elementMethods}\n sortable={sortable}\n testId={elementTestId}\n >\n {children({\n index,\n length: fields.length,\n methods: elementMethods,\n name: elementName,\n testId: elementTestId,\n })}\n </FieldArrayElement>\n );\n })}\n </ul>\n </SortContext>\n </div>\n ) : null}\n\n {/* top level field array errors */}\n <FieldArrayValidationError name={name} />\n\n {/* append elements button */}\n <ElementAppendButton\n appendButtonText={appendButtonText}\n className={className.appendButton}\n testId={`${testId}_append_button`}\n onClick={() => {\n append(elementInitialValue);\n }}\n />\n </div>\n );\n};\n\nexport default FieldArray;\n","import FieldArray from './FieldArray';\n\nexport type * from './types';\n\nexport { FieldArray };\n\nexport default FieldArray;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAkBA,MAAM,uBAAuB,EAC3B,mBAAmB,eACnB,YAAY,QACZ,SACA,SAAS,aACqB;AAC9B,QACE,qBAAC;EACC;EACA,WAAW,GAAG,UAAU;EACf;EACT,MAAK;EACG;EACR,SAAQ;aAER,oBAAC,WAAS,EACV,oBAAC,oBAAM,mBAAwB;GACxB;;AAIb,kCAAe;;;;;;;ACVf,MAAM,sBAAsB,EAC1B,YAAY,QACZ,YAAY,OACZ,cAAc,OACd,aAAa,MACb,SACA,SAAS,aACoB;CAC7B,MAAM,gBAAgB,QAAa;AACjC,UAAQ,KAAR;GACE,KAAK;AACH,YAAQ,QAAQ;AAChB;GACF,KAAK;AACH,YAAQ,WAAW;AACnB;GACF,KAAK;AACH,YAAQ,QAAQ;AAChB;GACF,QACE;;;CAKN,MAAM,YAAwB,EAAE;AAEhC,KAAI,UACF,WAAU,KAAK;EACb,KAAK;EACL,OAAO;EACP,MAAM,oBAAC,WAAS;EACjB,CAAC;AAGJ,KAAI,YACF,WAAU,KAAK;EACb,KAAK;EACL,OAAO;EACP,MAAM,oBAAC,cAAY;EACpB,CAAC;AAGJ,KAAI,WACF,WAAU,KAAK;EACb,KAAK;EACL,WAAW;EACX,OAAO;EACP,MAAM,oBAAC,YAAU;EAClB,CAAC;AAGJ,QACE,oBAAC;EACC,WAAU;EACV,OAAO;EACP,UAAU;EACV,WAAU;EACF;EACR,oBAAoB;GAClB,WAAW,GAAG,UAAU;GACxB,eAAe;GACf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["SortDragHandle","Grid","ElementActionsMenu","ElementRemoveButton","FieldValidationError","FieldArrayLabel","SortContext","FieldArrayElement","FieldArrayValidationError","ElementAppendButton","FieldArray"],"sources":["../src/FieldArray/subcomponents/ElementAppendButton.tsx","../src/FieldArray/subcomponents/ElementActionsMenu.tsx","../src/FieldArray/subcomponents/ElementRemoveButton.tsx","../src/FieldArray/subcomponents/SortDragHandle.tsx","../src/FieldArray/subcomponents/FieldArrayElement.tsx","../src/FieldArray/subcomponents/FieldArrayLabel.tsx","../src/FieldArray/subcomponents/FieldArrayValidationError.tsx","../src/FieldArray/subcomponents/SortContext.tsx","../src/FieldArray/FieldArray.tsx","../src/FieldArray/index.ts"],"sourcesContent":["import type { ClassValue } from '@fuf-stack/pixel-utils';\n\nimport { FaPlus } from 'react-icons/fa';\n\nimport { cn } from '@fuf-stack/pixel-utils';\nimport { Button } from '@fuf-stack/pixels';\n\ninterface ElementAppendButtonProps {\n /** text of the append element button */\n appendButtonText?: string;\n /** CSS class name */\n className?: ClassValue;\n /** click handler */\n onClick: () => void;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\nconst ElementAppendButton = ({\n appendButtonText = 'Add Element',\n className = undefined,\n onClick,\n testId = undefined,\n}: ElementAppendButtonProps) => {\n return (\n <Button\n disableAnimation\n className={cn(className)}\n onClick={onClick}\n size=\"sm\"\n testId={testId}\n variant=\"light\"\n >\n <FaPlus />\n <span>{appendButtonText}</span>\n </Button>\n );\n};\n\nexport default ElementAppendButton;\n","import type { ClassValue } from '@fuf-stack/pixel-utils';\nimport type { MenuItem } from '@fuf-stack/pixels';\nimport type { Key } from 'react';\nimport type { FieldArrayElementMethods } from './FieldArrayElement';\n\nimport { FaCopy, FaTimes } from 'react-icons/fa';\nimport { VscInsert } from 'react-icons/vsc';\n\nimport { cn } from '@fuf-stack/pixel-utils';\nimport { Menu } from '@fuf-stack/pixels';\n\nexport interface ElementActionsMenuProps {\n /** CSS class name */\n className?: ClassValue;\n /** Whether duplicate action is available */\n duplicate?: boolean;\n /** Whether insert after action is available */\n insertAfter?: boolean;\n /** Whether to show remove button (false when last element is not deletable) */\n showRemove?: boolean;\n /** Field array operation methods */\n methods: FieldArrayElementMethods;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\n/**\n * Menu component for field array element actions (remove, duplicate, insert after)\n */\nconst ElementActionsMenu = ({\n className = undefined,\n duplicate = false,\n insertAfter = false,\n showRemove = true,\n methods,\n testId = undefined,\n}: ElementActionsMenuProps) => {\n const handleAction = (key: Key) => {\n switch (key) {\n case 'remove':\n methods.remove();\n break;\n case 'duplicate':\n methods.duplicate();\n break;\n case 'insertAfter':\n methods.insert();\n break;\n default:\n break;\n }\n };\n\n // Build menu items based on available actions\n const menuItems: MenuItem[] = [];\n\n if (duplicate) {\n menuItems.push({\n key: 'duplicate',\n label: 'Duplicate',\n icon: <FaCopy />,\n });\n }\n\n if (insertAfter) {\n menuItems.push({\n key: 'insertAfter',\n label: 'Insert After',\n icon: <VscInsert />,\n });\n }\n\n if (showRemove) {\n menuItems.push({\n key: 'remove',\n className: 'text-danger',\n label: 'Remove',\n icon: <FaTimes />,\n });\n }\n\n return (\n <Menu\n ariaLabel=\"Element actions\"\n items={menuItems}\n onAction={handleAction}\n placement=\"right\"\n testId={testId}\n triggerButtonProps={{\n className: cn(className),\n disableRipple: true,\n size: 'md',\n variant: 'light',\n }}\n />\n );\n};\n\nexport default ElementActionsMenu;\n","import type { ClassValue } from '@fuf-stack/pixel-utils';\n\nimport { FaTimes } from 'react-icons/fa';\n\nimport { motion } from '@fuf-stack/pixel-motion';\nimport { cn } from '@fuf-stack/pixel-utils';\nimport { Button } from '@fuf-stack/pixels';\n\ninterface ElementRemoveButtonProps {\n /** CSS class name */\n className?: ClassValue;\n /** Globally disable animations (used for first render or prefers-reduced-motion) */\n disableAnimation?: boolean;\n /** click handler */\n onClick: () => void;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\nconst ElementRemoveButton = ({\n className = undefined,\n disableAnimation = false,\n onClick,\n testId = undefined,\n}: ElementRemoveButtonProps) => {\n const button = (\n <Button\n ariaLabel=\"remove element\"\n className={cn(className)}\n color=\"danger\"\n icon={<FaTimes />}\n onClick={onClick}\n size=\"sm\"\n testId={testId}\n variant=\"light\"\n />\n );\n\n if (disableAnimation) {\n return button;\n }\n\n return (\n <motion.div\n animate={{ opacity: 1, width: 'auto' }}\n className=\"flex\"\n exit={{ opacity: 0, width: 0 }}\n initial={{ opacity: 0, width: 0 }}\n transition={{ duration: 0.2 }}\n >\n {button}\n </motion.div>\n );\n};\n\nexport default ElementRemoveButton;\n","import type { ClassValue } from '@fuf-stack/pixel-utils';\n\nimport { FaGripVertical } from 'react-icons/fa';\n\nimport { useSortable } from '@dnd-kit/sortable';\n\nimport { cn } from '@fuf-stack/pixel-utils';\n\ninterface SortDragHandleProps {\n /** Optional CSS class name */\n className?: ClassValue;\n /** Unique identifier for sortable item */\n id: string | number;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\n/**\n * Drag handle component that integrates with dnd-kit sortable functionality.\n * Renders a vertical grip icon that can be used to reorder items.\n */\nconst SortDragHandle = ({\n className = undefined,\n id,\n testId = undefined,\n}: SortDragHandleProps) => {\n // Get dnd-kit sortable attributes and listeners\n const { attributes, listeners } = useSortable({ id });\n\n return (\n <div\n className={cn(className)}\n data-testid={testId}\n {...attributes}\n {...listeners}\n >\n <FaGripVertical />\n </div>\n );\n};\n\nexport default SortDragHandle;\n","import type { Variants as MotionVariants } from '@fuf-stack/pixel-motion';\nimport type { ClassValue } from '@fuf-stack/pixel-utils';\nimport type { FieldArrayFeatures } from '../types';\n\nimport { useState } from 'react';\n\nimport { useSortable } from '@dnd-kit/sortable';\nimport { CSS } from '@dnd-kit/utilities';\n\nimport { AnimatePresence, motion } from '@fuf-stack/pixel-motion';\nimport { cn } from '@fuf-stack/pixel-utils';\n\nimport { Grid } from '../../Grid';\nimport ElementActionsMenu from './ElementActionsMenu';\nimport ElementRemoveButton from './ElementRemoveButton';\nimport SortDragHandle from './SortDragHandle';\n\nexport interface FieldArrayElementMethods {\n /** Add new element at end */\n append: () => void;\n /** Clone current element */\n duplicate: () => void;\n /** Add new element after current */\n insert: () => void;\n /** Remove current element */\n remove: () => void;\n}\n\ninterface FieldArrayElementProps extends FieldArrayFeatures {\n /** Form elements to render inside array element */\n children: React.ReactNode;\n /** CSS class names for component parts */\n className: {\n /** Class of wrapper grid inside the li that wraps the rendered element fields directly */\n elementFieldsGrid?: ClassValue;\n /** Class for the li (performs motion animations) */\n listItem?: ClassValue;\n /** Class for the li inner div (wraps the rendered element fields) */\n listItemInner?: ClassValue;\n /** Class for the actions menu button */\n actionsMenuButton?: ClassValue;\n /** Class for the remove element button (when menu is not used) */\n removeButton?: ClassValue;\n /** Class for the drag handle when sorting enabled */\n sortDragHandle?: ClassValue;\n };\n /** Globally disable animations for this item (used for first render or prefers-reduced-motion) */\n disableAnimation?: boolean;\n /** Bottom margin for elements (for backwards compatibility) */\n elementMarginBottom?: React.CSSProperties['marginBottom'];\n /** All fields in the form array */\n fields: Record<'id', string>[];\n /** Unique identifier for drag/drop */\n id: string | number;\n /** Field index in array */\n index: number;\n /** Prevent deletion of last remaining element */\n lastNotDeletable?: boolean;\n /** Field array operation methods */\n methods: FieldArrayElementMethods;\n /** HTML data-testid of the element */\n testId?: string;\n}\n\n/**\n * Form array element component using react-hook-form with drag-drop sorting\n * and validation capabilities. Animations when elements are added or removed\n * improve the user experience and provide a better visual feedback.\n */\nconst FieldArrayElement = ({\n children,\n className,\n disableAnimation = false,\n duplicate = false,\n elementMarginBottom: _elementMarginBottom = undefined,\n fields,\n id,\n index: _index,\n insertAfter = false,\n lastNotDeletable = true,\n methods,\n sortable = false,\n testId = undefined,\n}: FieldArrayElementProps) => {\n // Apply transform styles when sortable is enabled for smooth drag animations\n // transform: handles the item's position during drag\n // transition: controls the animation timing when dropping\n const { setNodeRef, transform, transition, isDragging } = useSortable({ id });\n const sortingStyle = sortable\n ? {\n transform: CSS.Translate.toString(transform),\n transition,\n zIndex: isDragging ? 50 : undefined,\n }\n : undefined;\n\n // Local visibility to allow exit animation before removing from RHF state\n const [isVisible, setIsVisible] = useState(true);\n\n // Motion variants for the list item\n const listItemMotionVariants: MotionVariants = {\n hidden: { opacity: 0, height: 0, marginBottom: 0 },\n visible: {\n opacity: 1,\n height: 'auto',\n transition: { duration: 0.2, ease: 'circOut' },\n // push last visible item down to overlap with append button (hide double border)\n marginBottom: '-1px',\n },\n exit: {\n opacity: 0,\n height: 0,\n marginBottom: 0,\n transition: {\n // on exit first fade out, then shrink\n opacity: { duration: 0.1, ease: 'circOut' },\n height: { delay: 0.1, duration: 0.2, ease: 'circOut' },\n },\n },\n };\n\n // Height animation handled on <motion.li> using overflow hidden\n return (\n <AnimatePresence\n mode=\"wait\"\n // remove from RHF state after exit animation\n onExitComplete={() => {\n methods.remove();\n }}\n >\n {isVisible ? (\n <motion.li\n key={id}\n ref={setNodeRef}\n animate={disableAnimation ? undefined : 'visible'}\n className={cn(className.listItem)}\n data-dragging={isDragging}\n data-testid={`${testId}_element`}\n exit={disableAnimation ? undefined : 'exit'}\n initial={disableAnimation ? false : 'hidden'}\n style={sortingStyle}\n variants={disableAnimation ? undefined : listItemMotionVariants}\n >\n <div className={cn(className.listItemInner)}>\n {/** sorting drag handle */}\n {sortable ? (\n <SortDragHandle\n className={className.sortDragHandle}\n id={id}\n testId={`${testId}_sort_drag_handle`}\n />\n ) : null}\n\n {/** render element fields in Grid component */}\n <Grid\n className={cn(className.elementFieldsGrid)}\n testId={`${testId}_element_fields_grid`}\n >\n {/* render actual fields */}\n {children}\n </Grid>\n\n {/** actions menu when duplicate or insertAfter is enabled */}\n {duplicate || insertAfter ? (\n <ElementActionsMenu\n className={className.actionsMenuButton}\n duplicate={duplicate}\n insertAfter={insertAfter}\n showRemove={!(lastNotDeletable && fields.length === 1)}\n testId={`${testId}_actions_menu`}\n methods={{\n ...methods,\n remove: () => {\n if (disableAnimation) {\n methods.remove();\n } else {\n setIsVisible(false);\n }\n },\n }}\n />\n ) : (\n <>\n {/** remove element button (when menu is not used) */}\n <AnimatePresence initial={false}>\n {lastNotDeletable && fields.length === 1 ? null : (\n <ElementRemoveButton\n key=\"remove-button\"\n className={className.removeButton}\n disableAnimation={disableAnimation}\n testId={`${testId}_remove_button`}\n onClick={() => {\n if (disableAnimation) {\n methods.remove();\n } else {\n setIsVisible(false);\n }\n }}\n />\n )}\n </AnimatePresence>\n </>\n )}\n </div>\n </motion.li>\n ) : null}\n </AnimatePresence>\n );\n};\n\nexport default FieldArrayElement;\n","import type { ReactNode } from 'react';\n\nimport { cn } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../../hooks/useUniformField';\n\nexport interface FieldArrayLabelProps {\n /** CSS class name */\n className?: string;\n /** Label content */\n label: ReactNode;\n /** Field name */\n name: string;\n}\n\n/**\n * Renders the label for a FieldArray component.\n *\n * This component handles displaying the array label with proper accessibility\n * attributes using the label props from useUniformField.\n */\nconst FieldArrayLabel = ({\n className = undefined,\n label: _label,\n name,\n}: FieldArrayLabelProps) => {\n const { error, getLabelProps, invalid, label } = useUniformField({\n name,\n label: _label,\n });\n\n // when no label is provided, don't render anything\n if (!_label) {\n return null;\n }\n\n // @ts-expect-error - error._errors exists but not typed\n const hasErrors = invalid && error?._errors;\n\n return (\n <div\n {...getLabelProps()}\n aria-level={3}\n role=\"heading\"\n className={cn(getLabelProps()?.className, className, {\n // when there are no array level errors, the label should have foreground color\n 'text-foreground!': !hasErrors,\n })}\n >\n {label}\n </div>\n );\n};\n\nexport default FieldArrayLabel;\n","import {\n AnimatePresence,\n motion,\n useReducedMotion,\n} from '@fuf-stack/pixel-motion';\nimport { cn } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../../hooks/useUniformField';\nimport FieldValidationError from '../../partials/FieldValidationError/FieldValidationError';\n\nexport interface FieldArrayValidationErrorProps {\n /** Field name */\n name: string;\n}\n\n/**\n * Renders array-level validation errors for FieldArray.\n *\n * This component handles validation errors that apply to the entire array\n * (e.g., \"Array must contain at least 3 elements\", \"Array elements are not unique\"),\n * as opposed to field-level errors which apply to individual array elements.\n *\n * The component wraps errors in the proper accessibility markup and animates\n * them in/out using Framer Motion when they appear or are resolved.\n */\nconst FieldArrayValidationError = ({\n name,\n}: FieldArrayValidationErrorProps) => {\n const {\n error,\n getErrorMessageProps,\n getHelperWrapperProps,\n invalid,\n testId,\n } = useUniformField({\n name,\n });\n\n // disable all animation if user prefers reduced motion\n const disableAnimation = useReducedMotion();\n\n // @ts-expect-error - error._errors exists but not typed\n const hasErrors = invalid && error?._errors;\n\n return (\n <AnimatePresence initial={!disableAnimation}>\n {hasErrors ? (\n <motion.div\n key=\"field-array-errors\"\n exit={disableAnimation ? undefined : { opacity: 0, height: 0 }}\n initial={disableAnimation ? false : { height: 0, opacity: 0 }}\n style={{ overflow: 'hidden' }}\n transition={{ duration: 0.2, ease: 'circOut' }}\n animate={\n disableAnimation ? undefined : { opacity: 1, height: 'auto' }\n }\n >\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 add padding\n 'block px-3 py-2',\n )}\n >\n <div {...getErrorMessageProps()}>\n <FieldValidationError\n // @ts-expect-error - error._errors exists but not typed\n error={error._errors}\n testId={testId}\n />\n </div>\n </div>\n </motion.div>\n ) : null}\n </AnimatePresence>\n );\n};\n\nexport default FieldArrayValidationError;\n","import type { DragEndEvent } from '@dnd-kit/core';\nimport type { ReactNode } from 'react';\nimport type { UseFieldArrayMove } from 'react-hook-form';\n\nimport { useFormContext } from 'react-hook-form';\n\nimport {\n closestCenter,\n DndContext,\n KeyboardSensor,\n PointerSensor,\n useSensor,\n useSensors,\n} from '@dnd-kit/core';\nimport {\n restrictToVerticalAxis,\n restrictToWindowEdges,\n} from '@dnd-kit/modifiers';\nimport {\n SortableContext,\n verticalListSortingStrategy,\n} from '@dnd-kit/sortable';\n\ninterface SortContextProps {\n /** child components */\n children: ReactNode;\n /** Array of objects containing unique IDs for sortable items */\n fields: Record<'id', string>[];\n /** name of the field array */\n name: string;\n /** react-hook-form's move function to update field array indices */\n move: UseFieldArrayMove;\n /** enable/disable sorting functionality */\n sortable: boolean;\n}\n\n/**\n * A wrapper component that provides drag-and-drop sorting functionality for field arrays\n * using dnd-kit and react-hook-form.\n *\n * This component integrates with react-hook-form's field arrays to enable vertical\n * drag-and-drop reordering of form fields. It supports both pointer (mouse/touch)\n * and keyboard interactions for accessibility.\n */\nconst SortContext = ({\n children,\n fields,\n move,\n name,\n sortable,\n}: SortContextProps): ReactNode => {\n const { trigger } = useFormContext();\n\n // Initialize sensors for both pointer (mouse/touch) and keyboard interactions\n const sensors = useSensors(\n useSensor(PointerSensor),\n useSensor(KeyboardSensor),\n );\n\n // Early return if sorting is disabled\n if (!sortable) {\n return children;\n }\n\n /**\n * Handles the end of a drag operation by updating field positions\n * @param event - The drag end event containing active and over elements\n */\n const handleDragEnd = (event: DragEndEvent) => {\n const { active, over } = event;\n\n // Only move if dropping over a different item\n if (active.id !== over?.id) {\n // Find the indices of the dragged item and drop target\n const oldIndex = fields.findIndex((field) => {\n return field.id === active.id;\n });\n const newIndex = fields.findIndex((field) => {\n return field.id === over?.id;\n });\n // Update the field array order using react-hook-form's move function\n move(oldIndex, newIndex);\n\n // Finally trigger validation for the array field,\n // so validation errors are updated for the new order\n trigger(name);\n }\n };\n\n return (\n <DndContext\n collisionDetection={closestCenter}\n modifiers={[restrictToVerticalAxis, restrictToWindowEdges]}\n onDragEnd={handleDragEnd}\n sensors={sensors}\n >\n <SortableContext\n strategy={verticalListSortingStrategy}\n items={fields.map((field) => {\n return field.id;\n })}\n >\n {children}\n </SortableContext>\n </DndContext>\n );\n};\n\nexport default SortContext;\n","import type { FieldArrayElementMethods } from './subcomponents/FieldArrayElement';\nimport type { FieldArrayProps } from './types';\n\nimport { cn, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { flatArrayKey } from '../helpers';\nimport { useUniformFieldArray } from '../hooks/useUniformFieldArray';\nimport ElementAppendButton from './subcomponents/ElementAppendButton';\nimport FieldArrayElement from './subcomponents/FieldArrayElement';\nimport FieldArrayLabel from './subcomponents/FieldArrayLabel';\nimport FieldArrayValidationError from './subcomponents/FieldArrayValidationError';\nimport SortContext from './subcomponents/SortContext';\n\nexport const fieldArrayVariants = tv({\n slots: {\n /** base class for the field array wrapper */\n base: [\n // base styles\n 'overflow-hidden rounded-small border border-divider bg-content1',\n // divider between items\n 'divide-y divide-divider',\n ],\n /** class for the actions menu button */\n actionsMenuButton: [\n // base styles\n 'flex items-center justify-center text-default-600',\n // fixed height/no round corners/center align\n 'h-full rounded-none',\n // focus styles - inset ring\n 'outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus',\n ],\n /** class for the append button */\n appendButton: [\n // base styles\n 'w-full justify-start rounded-b-small rounded-t-none font-semibold',\n // match label height (p-3 = 12px vertical padding + text-base line height)\n '!h-[48px] !min-h-0',\n // focus styles - inset ring with rounded bottom corners to match container\n 'outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus',\n ],\n /** class for the element fields grid */\n elementFieldsGrid: ['w-full grow p-3'],\n /** class for the label */\n label: [\n // override HeroUI label positioning and display\n 'pointer-events-auto! static! z-auto! block! w-full!',\n // reset any transforms or translations\n 'translate-x-0! translate-y-0! transform-none!',\n // card header styling - use text-medium (16px) instead of text-base for correct 48px height\n 'rounded-t-small p-3 font-semibold text-medium',\n ],\n /** class for the list */\n list: ['overflow-hidden'],\n /** class for the list wrapper */\n listWrapper: ['overflow-hidden'],\n /** class for the list item (performs motion animations) */\n listItem: [\n // base styles\n 'group relative flex flex-row',\n // overlap borders by shifting first item up 1px (similar to how last item overlaps with append button)\n 'first:-mt-px',\n ],\n /** class for the list item inner */\n listItemInner: [\n // base styles\n 'flex w-full flex-row items-stretch divide-divider bg-content1',\n // x division and borders\n 'divide-x divide-solid border-b border-t border-divider',\n ],\n /** class for the remove button */\n removeButton: [\n // base styles\n 'flex items-center justify-center',\n // fixed height/no round corners\n '!h-full !min-h-0 !rounded-none px-3',\n // focus styles - inset ring\n 'outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus',\n ],\n /** class for the sort drag handle */\n sortDragHandle: [\n // base styles\n 'flex cursor-grab items-center justify-center px-2 text-default-600 transition-colors',\n // hover and dragging state\n 'hover:bg-default-100 active:cursor-grabbing group-data-[dragging=true]:bg-default-100',\n // focus styles - inset ring\n 'outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus',\n ],\n },\n variants: {\n hasLabel: {\n false: {\n // focus styles - when there is no label, the first item actions menu button should have rounded top right corners\n actionsMenuButton:\n 'group-[:first-child]:!rounded-tr-small group-[:first-child]:group-data-[dragging=true]:!rounded-tr-none',\n // focus styles - when there is no label, the first item remove button focus ring should have rounded top right corners\n removeButton:\n 'group-[:first-child]:!rounded-tr-small group-[:first-child]:group-data-[dragging=true]:!rounded-tr-none',\n // focus styles - when there is no label, the first item sort drag handle focus ring should have rounded top left corners\n sortDragHandle:\n 'group-[:first-child]:rounded-tl-small group-[:first-child]:group-data-[dragging=true]:rounded-tl-none',\n },\n },\n },\n});\n\n/**\n * FieldArray component based in [RHF useFieldArray](https://react-hook-form.com/docs/usefieldarray)\n */\nconst FieldArray = ({\n appendButtonText = 'Add Element',\n children,\n className: _className = undefined,\n duplicate = false,\n elementInitialValue: _elementInitialValue = null,\n elementMarginBottom = undefined,\n flat = false,\n insertAfter = false,\n lastElementNotRemovable = false,\n name,\n sortable = false,\n ...uniformFieldProps\n}: FieldArrayProps) => {\n const {\n fields,\n append,\n remove,\n insert,\n move,\n disableAnimation,\n elementInitialValue,\n getValues,\n testId,\n } = useUniformFieldArray({\n name,\n flat,\n elementInitialValue: _elementInitialValue,\n lastElementNotRemovable,\n ...uniformFieldProps,\n });\n\n // className from slots\n const variants = fieldArrayVariants({ hasLabel: !!uniformFieldProps.label });\n const className = variantsToClassNames(variants, _className, 'base');\n\n return (\n <div className={className.base}>\n {/* field array label */}\n <FieldArrayLabel\n className={className.label}\n label={uniformFieldProps.label}\n name={name}\n />\n\n {fields.length ? (\n /* list wrapper */\n <div className={cn(className.listWrapper)}>\n {/* sortable context */}\n <SortContext\n fields={fields}\n move={move}\n name={name}\n sortable={sortable}\n >\n {/* list container */}\n <ul className={className.list} data-testid={testId}>\n {/* fields / list elements */}\n {fields.map((field, index) => {\n const elementName = flat\n ? `${name}.${index}.${flatArrayKey}`\n : `${name}.${index}`;\n const elementTestId = `${testId}_${index}`;\n\n // create methods for element\n const elementMethods: FieldArrayElementMethods = {\n append: () => {\n append(elementInitialValue);\n },\n duplicate: () => {\n const values = getValues(name);\n const currentValue = (values as unknown[])[index];\n const nextValue = flat\n ? { [flatArrayKey]: currentValue }\n : currentValue;\n insert(index + 1, nextValue);\n },\n insert: () => {\n insert(index + 1, elementInitialValue);\n },\n remove: () => {\n remove(index);\n },\n };\n\n return (\n <FieldArrayElement\n key={field.id}\n className={className}\n disableAnimation={disableAnimation}\n duplicate={duplicate}\n elementMarginBottom={elementMarginBottom}\n fields={fields}\n id={field.id}\n index={index}\n insertAfter={insertAfter}\n lastNotDeletable={lastElementNotRemovable}\n methods={elementMethods}\n sortable={sortable}\n testId={elementTestId}\n >\n {children({\n index,\n length: fields.length,\n methods: elementMethods,\n name: elementName,\n testId: elementTestId,\n })}\n </FieldArrayElement>\n );\n })}\n </ul>\n </SortContext>\n </div>\n ) : null}\n\n {/* top level field array errors */}\n <FieldArrayValidationError name={name} />\n\n {/* append elements button */}\n <ElementAppendButton\n appendButtonText={appendButtonText}\n className={className.appendButton}\n testId={`${testId}_append_button`}\n onClick={() => {\n append(elementInitialValue);\n }}\n />\n </div>\n );\n};\n\nexport default FieldArray;\n","import FieldArray from './FieldArray';\n\nexport type * from './types';\n\nexport { FieldArray };\n\nexport default FieldArray;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAkBA,MAAM,uBAAuB,EAC3B,mBAA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OAAO,UAAU;OAC5B,MAAM,cAAc,OAChB,GAAG,KAAK,GAAG,MAAM,GAAG,iBACpB,GAAG,KAAK,GAAG;OACf,MAAM,gBAAgB,GAAG,OAAO,GAAG;OAGnC,MAAM,iBAA2C;QAC/C,cAAc;AACZ,gBAAO,oBAAoB;;QAE7B,iBAAiB;SAEf,MAAM,eADS,UAAU,KAAK,CACa;SAC3C,MAAM,YAAY,OACd,GAAG,eAAe,cAAc,GAChC;AACJ,gBAAO,QAAQ,GAAG,UAAU;;QAE9B,cAAc;AACZ,gBAAO,QAAQ,GAAG,oBAAoB;;QAExC,cAAc;AACZ,gBAAO,MAAM;;QAEhB;AAED,cACE,oBAACC;QAEY;QACO;QACP;QACU;QACb;QACR,IAAI,MAAM;QACH;QACM;QACb,kBAAkB;QAClB,SAAS;QACC;QACV,QAAQ;kBAEP,SAAS;SACR;SACA,QAAQ,OAAO;SACf,SAAS;SACT,MAAM;SACN,QAAQ;SACT,CAAC;UApBG,MAAM,GAqBO;QAEtB;OACC;MACO;KACV,GACJ;GAGJ,oBAACC,qCAAgC,OAAQ;GAGzC,oBAACC;IACmB;IAClB,WAAW,UAAU;IACrB,QAAQ,GAAG,OAAO;IAClB,eAAe;AACb,YAAO,oBAAoB;;KAE7B;;GACE;;AAIV,2BAAe;;;;AC1Of,yBAAeC"}
|
package/dist/FieldCard/index.cjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as FieldCardProps, r as fieldCardVariants, t as FieldCard } from "../index-
|
|
1
|
+
import { n as FieldCardProps, r as fieldCardVariants, t as FieldCard } from "../index-CiF2KXB7.cjs";
|
|
2
2
|
export { FieldCard, FieldCardProps, fieldCardVariants };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as FieldCardProps, r as fieldCardVariants, t as FieldCard } from "../index
|
|
1
|
+
import { n as FieldCardProps, r as fieldCardVariants, t as FieldCard } from "../index-CTp4vdDb.js";
|
|
2
2
|
export { FieldCard, FieldCardProps, fieldCardVariants };
|
package/dist/FieldCard/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const require_FormContext = require('./FormContext-
|
|
2
|
-
const require_FieldValidationError = require('./FieldValidationError-
|
|
3
|
-
const require_useUniformField = require('./useUniformField-
|
|
1
|
+
const require_FormContext = require('./FormContext-Lw4YL4-B.cjs');
|
|
2
|
+
const require_FieldValidationError = require('./FieldValidationError-D64j5gnH.cjs');
|
|
3
|
+
const require_useUniformField = require('./useUniformField-D6fwSjrH.cjs');
|
|
4
4
|
let _fuf_stack_pixel_utils = require("@fuf-stack/pixel-utils");
|
|
5
5
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
6
|
let _fuf_stack_pixel_motion = require("@fuf-stack/pixel-motion");
|
|
@@ -130,4 +130,4 @@ Object.defineProperty(exports, 'fieldCardVariants', {
|
|
|
130
130
|
return fieldCardVariants;
|
|
131
131
|
}
|
|
132
132
|
});
|
|
133
|
-
//# sourceMappingURL=FieldCard-
|
|
133
|
+
//# sourceMappingURL=FieldCard-Dt6QU7o7.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldCard-
|
|
1
|
+
{"version":3,"file":"FieldCard-Dt6QU7o7.cjs","names":["useUniformField","AnimatePresence","motion","FieldValidationError","useUniformField","FieldCardValidationError"],"sources":["../src/FieldCard/subcomponents/FieldCardValidationError.tsx","../src/FieldCard/FieldCard.tsx"],"sourcesContent":["import {\n AnimatePresence,\n motion,\n useReducedMotion,\n} from '@fuf-stack/pixel-motion';\nimport { cn } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../../hooks/useUniformField';\nimport FieldValidationError from '../../partials/FieldValidationError/FieldValidationError';\n\nexport interface FieldCardValidationErrorProps {\n /** CSS class name for the error footer wrapper */\n className?: string;\n /** Field name */\n name: string;\n}\n\n/**\n * Renders validation errors in the footer of a FieldCard component.\n *\n * This component handles displaying field-level validation errors with proper\n * accessibility attributes and animates them in/out using Framer Motion.\n */\nconst FieldCardValidationError = ({\n className = undefined,\n name,\n}: FieldCardValidationErrorProps) => {\n const {\n error,\n getErrorMessageProps,\n getHelperWrapperProps,\n invalid,\n testId,\n } = useUniformField({\n name,\n });\n\n // disable all animation if user prefers reduced motion\n const disableAnimation = useReducedMotion();\n\n // @ts-expect-error - error._errors exists but not typed\n const hasErrors = invalid && error?._errors;\n\n return (\n <AnimatePresence initial={!disableAnimation}>\n {hasErrors ? (\n <motion.div\n key=\"field-card-errors\"\n exit={disableAnimation ? undefined : { opacity: 0, height: 0 }}\n initial={disableAnimation ? false : { height: 0, opacity: 0 }}\n style={{ overflow: 'hidden' }}\n transition={{ duration: 0.2, ease: 'circOut' }}\n animate={\n disableAnimation ? undefined : { opacity: 1, height: 'auto' }\n }\n >\n <div\n {...getHelperWrapperProps()}\n className={cn(getHelperWrapperProps()?.className, className)}\n >\n <div {...getErrorMessageProps()}>\n <FieldValidationError\n // @ts-expect-error - error._errors exists but not typed\n error={error._errors}\n testId={testId}\n />\n </div>\n </div>\n </motion.div>\n ) : null}\n </AnimatePresence>\n );\n};\n\nexport default FieldCardValidationError;\n","import type { TVClassName } from '@fuf-stack/pixel-utils';\nimport type { ReactNode } from 'react';\n\nimport { cn, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../hooks/useUniformField';\nimport FieldCardValidationError from './subcomponents/FieldCardValidationError';\n\nexport const fieldCardVariants = tv({\n slots: {\n /** base class for the field card wrapper */\n base: [\n // base styles\n 'overflow-hidden rounded-small border bg-content1',\n ],\n /** class for the label/header */\n label: [\n // override HeroUI label positioning and display\n 'pointer-events-auto! static! z-auto! block! w-full!',\n // reset any transforms or translations\n 'translate-x-0! translate-y-0! transform-none!',\n // card header styling - use text-medium (16px) for proper header size\n 'rounded-t-small border-b p-3 font-semibold text-medium',\n ],\n /** class for the content */\n content: [\n // same as p-3 of Card component\n 'p-3',\n // default grid for form components (see Grid component)\n 'grid gap-4',\n ],\n /** class for the error footer wrapper */\n errorFooter: [\n 'border-t',\n // force helper to be visible and add padding\n 'block px-3 py-2',\n ],\n },\n variants: {\n invalid: {\n true: {\n base: 'border-danger',\n label: 'border-danger text-danger',\n errorFooter: 'border-danger',\n },\n false: {\n base: 'border-divider',\n label: 'border-divider text-foreground',\n errorFooter: 'border-divider',\n },\n },\n },\n defaultVariants: {\n invalid: false,\n },\n});\n\ntype ClassName = TVClassName<typeof fieldCardVariants>;\n\nexport interface FieldCardProps {\n /** Content to render inside the card */\n children: ReactNode;\n /** CSS class name */\n className?: ClassName;\n /** Label content for the card header */\n label: ReactNode;\n /** Field name for validation */\n name: string;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\n/**\n * FieldCard component - A card-styled container with label header and error footer\n *\n * Displays form field content in a card layout with:\n * - Label/title in the header\n * - Content in the body\n * - Validation errors in the footer\n * - Danger outline when validation errors exist\n */\nconst FieldCard = ({\n children,\n className: _className = undefined,\n name,\n ...uniformFieldProps\n}: FieldCardProps) => {\n const { error, getLabelProps, invalid, label } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n // @ts-expect-error - error._errors exists but not typed\n const hasErrors = invalid && error?._errors;\n\n // className from slots\n const variants = fieldCardVariants({ invalid: hasErrors });\n const className = variantsToClassNames(variants, _className, 'base');\n\n return (\n <div className={className.base}>\n {/* card header with label */}\n {label ? (\n <div\n {...getLabelProps()}\n aria-level={3}\n className={cn(getLabelProps()?.className, className.label)}\n role=\"heading\"\n >\n {label}\n </div>\n ) : null}\n\n {/* card content */}\n <div className={className.content}>{children}</div>\n\n {/* card footer with validation errors */}\n <FieldCardValidationError className={className.errorFooter} name={name} />\n </div>\n );\n};\n\nexport default FieldCard;\n"],"mappings":";;;;;;;;;;;;;;AAuBA,MAAM,4BAA4B,EAChC,YAAY,QACZ,WACmC;CACnC,MAAM,EACJ,OACA,sBACA,uBACA,SACA,WACEA,wCAAgB,EAClB,MACD,CAAC;CAGF,MAAM,kEAAqC;CAG3C,MAAM,YAAY,WAA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AEJ;KACG,GACJ;GAGJ,2CAAC;IAAI,WAAW,UAAU;IAAU;KAAe;GAGnD,2CAACC;IAAyB,WAAW,UAAU;IAAmB;KAAQ;;GACtE;;AAIV,wBAAe"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as FieldValidationError_default } from "./FieldValidationError-
|
|
2
|
-
import { t as useUniformField } from "./useUniformField-
|
|
1
|
+
import { n as FieldValidationError_default } from "./FieldValidationError-BYwitb_B.js";
|
|
2
|
+
import { t as useUniformField } from "./useUniformField-BKVVns0E.js";
|
|
3
3
|
import { cn, tv, variantsToClassNames } from "@fuf-stack/pixel-utils";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { AnimatePresence, motion, useReducedMotion } from "@fuf-stack/pixel-motion";
|
|
@@ -118,4 +118,4 @@ var FieldCard_default = FieldCard;
|
|
|
118
118
|
|
|
119
119
|
//#endregion
|
|
120
120
|
export { fieldCardVariants as n, FieldCard_default as t };
|
|
121
|
-
//# sourceMappingURL=FieldCard-
|
|
121
|
+
//# sourceMappingURL=FieldCard-Dyi-2qr6.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldCard-
|
|
1
|
+
{"version":3,"file":"FieldCard-Dyi-2qr6.js","names":["FieldValidationError","FieldCardValidationError"],"sources":["../src/FieldCard/subcomponents/FieldCardValidationError.tsx","../src/FieldCard/FieldCard.tsx"],"sourcesContent":["import {\n AnimatePresence,\n motion,\n useReducedMotion,\n} from '@fuf-stack/pixel-motion';\nimport { cn } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../../hooks/useUniformField';\nimport FieldValidationError from '../../partials/FieldValidationError/FieldValidationError';\n\nexport interface FieldCardValidationErrorProps {\n /** CSS class name for the error footer wrapper */\n className?: string;\n /** Field name */\n name: string;\n}\n\n/**\n * Renders validation errors in the footer of a FieldCard component.\n *\n * This component handles displaying field-level validation errors with proper\n * accessibility attributes and animates them in/out using Framer Motion.\n */\nconst FieldCardValidationError = ({\n className = undefined,\n name,\n}: FieldCardValidationErrorProps) => {\n const {\n error,\n getErrorMessageProps,\n getHelperWrapperProps,\n invalid,\n testId,\n } = useUniformField({\n name,\n });\n\n // disable all animation if user prefers reduced motion\n const disableAnimation = useReducedMotion();\n\n // @ts-expect-error - error._errors exists but not typed\n const hasErrors = invalid && error?._errors;\n\n return (\n <AnimatePresence initial={!disableAnimation}>\n {hasErrors ? (\n <motion.div\n key=\"field-card-errors\"\n exit={disableAnimation ? undefined : { opacity: 0, height: 0 }}\n initial={disableAnimation ? false : { height: 0, opacity: 0 }}\n style={{ overflow: 'hidden' }}\n transition={{ duration: 0.2, ease: 'circOut' }}\n animate={\n disableAnimation ? undefined : { opacity: 1, height: 'auto' }\n }\n >\n <div\n {...getHelperWrapperProps()}\n className={cn(getHelperWrapperProps()?.className, className)}\n >\n <div {...getErrorMessageProps()}>\n <FieldValidationError\n // @ts-expect-error - error._errors exists but not typed\n error={error._errors}\n testId={testId}\n />\n </div>\n </div>\n </motion.div>\n ) : null}\n </AnimatePresence>\n );\n};\n\nexport default FieldCardValidationError;\n","import type { TVClassName } from '@fuf-stack/pixel-utils';\nimport type { ReactNode } from 'react';\n\nimport { cn, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../hooks/useUniformField';\nimport FieldCardValidationError from './subcomponents/FieldCardValidationError';\n\nexport const fieldCardVariants = tv({\n slots: {\n /** base class for the field card wrapper */\n base: [\n // base styles\n 'overflow-hidden rounded-small border bg-content1',\n ],\n /** class for the label/header */\n label: [\n // override HeroUI label positioning and display\n 'pointer-events-auto! static! z-auto! block! w-full!',\n // reset any transforms or translations\n 'translate-x-0! translate-y-0! transform-none!',\n // card header styling - use text-medium (16px) for proper header size\n 'rounded-t-small border-b p-3 font-semibold text-medium',\n ],\n /** class for the content */\n content: [\n // same as p-3 of Card component\n 'p-3',\n // default grid for form components (see Grid component)\n 'grid gap-4',\n ],\n /** class for the error footer wrapper */\n errorFooter: [\n 'border-t',\n // force helper to be visible and add padding\n 'block px-3 py-2',\n ],\n },\n variants: {\n invalid: {\n true: {\n base: 'border-danger',\n label: 'border-danger text-danger',\n errorFooter: 'border-danger',\n },\n false: {\n base: 'border-divider',\n label: 'border-divider text-foreground',\n errorFooter: 'border-divider',\n },\n },\n },\n defaultVariants: {\n invalid: false,\n },\n});\n\ntype ClassName = TVClassName<typeof fieldCardVariants>;\n\nexport interface FieldCardProps {\n /** Content to render inside the card */\n children: ReactNode;\n /** CSS class name */\n className?: ClassName;\n /** Label content for the card header */\n label: ReactNode;\n /** Field name for validation */\n name: string;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\n/**\n * FieldCard component - A card-styled container with label header and error footer\n *\n * Displays form field content in a card layout with:\n * - Label/title in the header\n * - Content in the body\n * - Validation errors in the footer\n * - Danger outline when validation errors exist\n */\nconst FieldCard = ({\n children,\n className: _className = undefined,\n name,\n ...uniformFieldProps\n}: FieldCardProps) => {\n const { error, getLabelProps, invalid, label } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n // @ts-expect-error - error._errors exists but not typed\n const hasErrors = invalid && error?._errors;\n\n // className from slots\n const variants = fieldCardVariants({ invalid: hasErrors });\n const className = variantsToClassNames(variants, _className, 'base');\n\n return (\n <div className={className.base}>\n {/* card header with label */}\n {label ? (\n <div\n {...getLabelProps()}\n aria-level={3}\n className={cn(getLabelProps()?.className, className.label)}\n role=\"heading\"\n >\n {label}\n </div>\n ) : null}\n\n {/* card content */}\n <div className={className.content}>{children}</div>\n\n {/* card footer with validation errors */}\n <FieldCardValidationError className={className.errorFooter} name={name} />\n </div>\n );\n};\n\nexport default FieldCard;\n"],"mappings":";;;;;;;;;;;;;AAuBA,MAAM,4BAA4B,EAChC,YAAY,QACZ,WACmC;CACnC,MAAM,EACJ,OACA,sBACA,uBACA,SACA,WACE,gBAAgB,EAClB,MACD,CAAC;CAGF,MAAM,mBAAmB,kBAAkB;CAG3C,MAAM,YA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UAAU,MAAM;IAC1D,MAAK;cAEJ;KACG,GACJ;GAGJ,oBAAC;IAAI,WAAW,UAAU;IAAU;KAAe;GAGnD,oBAACC;IAAyB,WAAW,UAAU;IAAmB;KAAQ;;GACtE;;AAIV,wBAAe"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_FormContext = require('./FormContext-
|
|
1
|
+
const require_FormContext = require('./FormContext-Lw4YL4-B.cjs');
|
|
2
2
|
let _fuf_stack_pixel_utils = require("@fuf-stack/pixel-utils");
|
|
3
3
|
let _fuf_stack_pixels = require("@fuf-stack/pixels");
|
|
4
4
|
let react_icons_fa6 = require("react-icons/fa6");
|
|
@@ -38,4 +38,4 @@ Object.defineProperty(exports, 'FieldCopyTestIdButton_default$1', {
|
|
|
38
38
|
return FieldCopyTestIdButton_default$1;
|
|
39
39
|
}
|
|
40
40
|
});
|
|
41
|
-
//# sourceMappingURL=FieldCopyTestIdButton-
|
|
41
|
+
//# sourceMappingURL=FieldCopyTestIdButton-By-hEZgA.cjs.map
|
package/dist/{FieldCopyTestIdButton-BSYcSo2o.cjs.map → FieldCopyTestIdButton-By-hEZgA.cjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldCopyTestIdButton-
|
|
1
|
+
{"version":3,"file":"FieldCopyTestIdButton-By-hEZgA.cjs","names":["Button","FaBullseye","FieldCopyTestIdButton"],"sources":["../src/partials/FieldCopyTestIdButton/FieldCopyTestIdButton.tsx","../src/partials/FieldCopyTestIdButton/index.ts"],"sourcesContent":["import { FaBullseye } from 'react-icons/fa6';\n\nimport { cn } from '@fuf-stack/pixel-utils';\nimport { Button } from '@fuf-stack/pixels';\n\nexport interface FieldCopyTestIdButtonProps {\n /** CSS class name */\n className?: string;\n /** HTML data-testid attribute used in e2e tests */\n testId: string;\n}\n\nconst FieldCopyTestIdButton = ({\n className = undefined,\n testId,\n}: FieldCopyTestIdButtonProps) => {\n const copyToClipboard = () => {\n navigator.clipboard.writeText(testId).catch((err) => {\n console.error('Error copying TestId to clipboard', err);\n });\n };\n\n return (\n <Button\n className={cn(className, 'pointer-events-auto')}\n icon={<FaBullseye />}\n onClick={copyToClipboard}\n size=\"sm\"\n variant=\"light\"\n />\n );\n};\nexport default FieldCopyTestIdButton;\n","import FieldCopyTestIdButton from './FieldCopyTestIdButton';\n\nexport type { FieldCopyTestIdButtonProps } from './FieldCopyTestIdButton';\n\nexport { FieldCopyTestIdButton };\n\nexport default FieldCopyTestIdButton;\n"],"mappings":";;;;;;;AAYA,MAAM,yBAAyB,EAC7B,YAAY,QACZ,aACgC;CAChC,MAAM,wBAAwB;AAC5B,YAAU,UAAU,UAAU,OAAO,CAAC,OAAO,QAAQ;AACnD,WAAQ,MAAM,qCAAqC,IAAI;IACvD;;AAGJ,QACE,2CAACA;EACC,0CAAc,WAAW,sBAAsB;EAC/C,MAAM,2CAACC,+BAAa;EACpB,SAAS;EACT,MAAK;EACL,SAAQ;GACR;;AAGN,sCAAe;;;;AC1Bf,oCAAeC"}
|
|
@@ -26,4 +26,4 @@ var FieldCopyTestIdButton_default = FieldCopyTestIdButton_default$1;
|
|
|
26
26
|
|
|
27
27
|
//#endregion
|
|
28
28
|
export { FieldCopyTestIdButton_default$1 as n, FieldCopyTestIdButton_default as t };
|
|
29
|
-
//# sourceMappingURL=FieldCopyTestIdButton-
|
|
29
|
+
//# sourceMappingURL=FieldCopyTestIdButton-D9f1B-VS.js.map
|
package/dist/{FieldCopyTestIdButton-DWPCDJ-s.js.map → FieldCopyTestIdButton-D9f1B-VS.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldCopyTestIdButton-
|
|
1
|
+
{"version":3,"file":"FieldCopyTestIdButton-D9f1B-VS.js","names":["FieldCopyTestIdButton"],"sources":["../src/partials/FieldCopyTestIdButton/FieldCopyTestIdButton.tsx","../src/partials/FieldCopyTestIdButton/index.ts"],"sourcesContent":["import { FaBullseye } from 'react-icons/fa6';\n\nimport { cn } from '@fuf-stack/pixel-utils';\nimport { Button } from '@fuf-stack/pixels';\n\nexport interface FieldCopyTestIdButtonProps {\n /** CSS class name */\n className?: string;\n /** HTML data-testid attribute used in e2e tests */\n testId: string;\n}\n\nconst FieldCopyTestIdButton = ({\n className = undefined,\n testId,\n}: FieldCopyTestIdButtonProps) => {\n const copyToClipboard = () => {\n navigator.clipboard.writeText(testId).catch((err) => {\n console.error('Error copying TestId to clipboard', err);\n });\n };\n\n return (\n <Button\n className={cn(className, 'pointer-events-auto')}\n icon={<FaBullseye />}\n onClick={copyToClipboard}\n size=\"sm\"\n variant=\"light\"\n />\n );\n};\nexport default FieldCopyTestIdButton;\n","import FieldCopyTestIdButton from './FieldCopyTestIdButton';\n\nexport type { FieldCopyTestIdButtonProps } from './FieldCopyTestIdButton';\n\nexport { FieldCopyTestIdButton };\n\nexport default FieldCopyTestIdButton;\n"],"mappings":";;;;;;AAYA,MAAM,yBAAyB,EAC7B,YAAY,QACZ,aACgC;CAChC,MAAM,wBAAwB;AAC5B,YAAU,UAAU,UAAU,OAAO,CAAC,OAAO,QAAQ;AACnD,WAAQ,MAAM,qCAAqC,IAAI;IACvD;;AAGJ,QACE,oBAAC;EACC,WAAW,GAAG,WAAW,sBAAsB;EAC/C,MAAM,oBAAC,eAAa;EACpB,SAAS;EACT,MAAK;EACL,SAAQ;GACR;;AAGN,sCAAe;;;;AC1Bf,oCAAeA"}
|
|
@@ -50,4 +50,4 @@ var FieldValidationError_default = FieldValidationError_default$1;
|
|
|
50
50
|
|
|
51
51
|
//#endregion
|
|
52
52
|
export { FieldValidationError_default$1 as n, FieldValidationError_default as t };
|
|
53
|
-
//# sourceMappingURL=FieldValidationError-
|
|
53
|
+
//# sourceMappingURL=FieldValidationError-BYwitb_B.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldValidationError-
|
|
1
|
+
{"version":3,"file":"FieldValidationError-BYwitb_B.js","names":["FieldValidationError"],"sources":["../src/partials/FieldValidationError/FieldValidationError.tsx","../src/partials/FieldValidationError/index.ts"],"sourcesContent":["import type { FieldError } from 'react-hook-form';\n\nimport {\n AnimatePresence,\n motion,\n useReducedMotion,\n} from '@fuf-stack/pixel-motion';\nimport { slugify } from '@fuf-stack/pixel-utils';\n\nexport interface FieldValidationErrorProps {\n /** CSS class name */\n className?: string;\n /** Field errors */\n error?: FieldError[];\n /** HTML data-testid attribute used in e2e tests */\n testId: string;\n}\n\n/**\n * Renders a validation error of a field\n */\nconst FieldValidationError = ({\n className = undefined,\n error = undefined,\n testId,\n}: FieldValidationErrorProps) => {\n // disable all animation if user prefers reduced motion\n const disableAnimation = useReducedMotion();\n\n return (\n <ul\n aria-label={`Validation errors of field ${testId}`}\n className={className}\n data-testid={slugify(`${testId}_error`)}\n >\n <AnimatePresence initial={!disableAnimation}>\n {error?.map(({ message }, i) => {\n return (\n <motion.li\n key={slugify(`${testId}_error_${i}`)}\n exit={disableAnimation ? undefined : { opacity: 0, height: 0 }}\n initial={disableAnimation ? false : { height: 0, opacity: 0 }}\n style={{ overflow: 'hidden' }}\n transition={{ duration: 0.2, ease: 'circOut' }}\n animate={\n disableAnimation ? undefined : { opacity: 1, height: 'auto' }\n }\n >\n {/* wrap in div to apply padding and animation does not jump */}\n <div className=\"px-1 pt-1\">{message}</div>\n </motion.li>\n );\n })}\n </AnimatePresence>\n </ul>\n );\n};\n\nexport default FieldValidationError;\n","import FieldValidationError from './FieldValidationError';\n\nexport type { FieldValidationErrorProps } from './FieldValidationError';\n\nexport { FieldValidationError };\n\nexport default FieldValidationError;\n"],"mappings":";;;;;;;;AAqBA,MAAM,wBAAwB,EAC5B,YAAY,QACZ,QAAQ,QACR,aAC+B;CAE/B,MAAM,mBAAmB,kBAAkB;AAE3C,QACE,oBAAC;EACC,cAAY,8BAA8B;EAC/B;EACX,eAAa,QAAQ,GAAG,OAAO,QAAQ;YAEvC,oBAAC;GAAgB,SAAS,CAAC;aACxB,OAAO,KAAK,EAAE,WAAW,MAAM;AAC9B,WACE,oBAAC,OAAO;KAEN,MAAM,mBAAmB,SAAY;MAAE,SAAS;MAAG,QAAQ;MAAG;KAC9D,SAAS,mBAAmB,QAAQ;MAAE,QAAQ;MAAG,SAAS;MAAG;KAC7D,OAAO,EAAE,UAAU,UAAU;KAC7B,YAAY;MAAE,UAAU;MAAK,MAAM;MAAW;KAC9C,SACE,mBAAmB,SAAY;MAAE,SAAS;MAAG,QAAQ;MAAQ;eAI/D,oBAAC;MAAI,WAAU;gBAAa;OAAc;OAVrC,QAAQ,GAAG,OAAO,SAAS,IAAI,CAW1B;KAEd;IACc;GACf;;AAIT,qCAAe;;;;ACpDf,mCAAeA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_FormContext = require('./FormContext-
|
|
1
|
+
const require_FormContext = require('./FormContext-Lw4YL4-B.cjs');
|
|
2
2
|
let _fuf_stack_pixel_utils = require("@fuf-stack/pixel-utils");
|
|
3
3
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
4
4
|
let _fuf_stack_pixel_motion = require("@fuf-stack/pixel-motion");
|
|
@@ -62,4 +62,4 @@ Object.defineProperty(exports, 'FieldValidationError_default$1', {
|
|
|
62
62
|
return FieldValidationError_default$1;
|
|
63
63
|
}
|
|
64
64
|
});
|
|
65
|
-
//# sourceMappingURL=FieldValidationError-
|
|
65
|
+
//# sourceMappingURL=FieldValidationError-D64j5gnH.cjs.map
|
package/dist/{FieldValidationError-CE8R8qry.cjs.map → FieldValidationError-D64j5gnH.cjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldValidationError-
|
|
1
|
+
{"version":3,"file":"FieldValidationError-D64j5gnH.cjs","names":["AnimatePresence","motion","FieldValidationError"],"sources":["../src/partials/FieldValidationError/FieldValidationError.tsx","../src/partials/FieldValidationError/index.ts"],"sourcesContent":["import type { FieldError } from 'react-hook-form';\n\nimport {\n AnimatePresence,\n motion,\n useReducedMotion,\n} from '@fuf-stack/pixel-motion';\nimport { slugify } from '@fuf-stack/pixel-utils';\n\nexport interface FieldValidationErrorProps {\n /** CSS class name */\n className?: string;\n /** Field errors */\n error?: FieldError[];\n /** HTML data-testid attribute used in e2e tests */\n testId: string;\n}\n\n/**\n * Renders a validation error of a field\n */\nconst FieldValidationError = ({\n className = undefined,\n error = undefined,\n testId,\n}: FieldValidationErrorProps) => {\n // disable all animation if user prefers reduced motion\n const disableAnimation = useReducedMotion();\n\n return (\n <ul\n aria-label={`Validation errors of field ${testId}`}\n className={className}\n data-testid={slugify(`${testId}_error`)}\n >\n <AnimatePresence initial={!disableAnimation}>\n {error?.map(({ message }, i) => {\n return (\n <motion.li\n key={slugify(`${testId}_error_${i}`)}\n exit={disableAnimation ? undefined : { opacity: 0, height: 0 }}\n initial={disableAnimation ? false : { height: 0, opacity: 0 }}\n style={{ overflow: 'hidden' }}\n transition={{ duration: 0.2, ease: 'circOut' }}\n animate={\n disableAnimation ? undefined : { opacity: 1, height: 'auto' }\n }\n >\n {/* wrap in div to apply padding and animation does not jump */}\n <div className=\"px-1 pt-1\">{message}</div>\n </motion.li>\n );\n })}\n </AnimatePresence>\n </ul>\n );\n};\n\nexport default FieldValidationError;\n","import FieldValidationError from './FieldValidationError';\n\nexport type { FieldValidationErrorProps } from './FieldValidationError';\n\nexport { FieldValidationError };\n\nexport default FieldValidationError;\n"],"mappings":";;;;;;;;;AAqBA,MAAM,wBAAwB,EAC5B,YAAY,QACZ,QAAQ,QACR,aAC+B;CAE/B,MAAM,kEAAqC;AAE3C,QACE,2CAAC;EACC,cAAY,8BAA8B;EAC/B;EACX,mDAAqB,GAAG,OAAO,QAAQ;YAEvC,2CAACA;GAAgB,SAAS,CAAC;aACxB,OAAO,KAAK,EAAE,WAAW,MAAM;AAC9B,WACE,2CAACC,+BAAO;KAEN,MAAM,mBAAmB,SAAY;MAAE,SAAS;MAAG,QAAQ;MAAG;KAC9D,SAAS,mBAAmB,QAAQ;MAAE,QAAQ;MAAG,SAAS;MAAG;KAC7D,OAAO,EAAE,UAAU,UAAU;KAC7B,YAAY;MAAE,UAAU;MAAK,MAAM;MAAW;KAC9C,SACE,mBAAmB,SAAY;MAAE,SAAS;MAAG,QAAQ;MAAQ;eAI/D,2CAAC;MAAI,WAAU;gBAAa;OAAc;2CAV7B,GAAG,OAAO,SAAS,IAAI,CAW1B;KAEd;IACc;GACf;;AAIT,qCAAe;;;;ACpDf,mCAAeC"}
|
package/dist/Form/index.cjs
CHANGED
package/dist/Form/index.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as FormProps, t as Form } from "../index-
|
|
1
|
+
import { n as FormProps, t as Form } from "../index-B_aIzCcx.cjs";
|
|
2
2
|
export { Form, Form as default, FormProps };
|
package/dist/Form/index.d.ts
CHANGED
package/dist/Form/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as FormContext_default } from "./FormContext-
|
|
2
|
-
import { n as useFormContext } from "./useFormContext-
|
|
1
|
+
import { t as FormContext_default } from "./FormContext-Dl3k1r_k.js";
|
|
2
|
+
import { n as useFormContext } from "./useFormContext-BFoXZNkp.js";
|
|
3
3
|
import { cn, slugify } from "@fuf-stack/pixel-utils";
|
|
4
4
|
import { useEffect, useState } from "react";
|
|
5
5
|
import { FaBug, FaBullseye } from "react-icons/fa6";
|
|
@@ -116,4 +116,4 @@ var Form_default = Form_default$1;
|
|
|
116
116
|
|
|
117
117
|
//#endregion
|
|
118
118
|
export { Form_default$1 as n, Form_default as t };
|
|
119
|
-
//# sourceMappingURL=Form-
|
|
119
|
+
//# sourceMappingURL=Form-B1fvbnxi.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form-
|
|
1
|
+
{"version":3,"file":"Form-B1fvbnxi.js","names":["FormProvider","FormDebugViewer","Form"],"sources":["../src/Form/subcomponents/FormDebugViewer.tsx","../src/Form/Form.tsx","../src/Form/index.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\nimport { FaTimes } from 'react-icons/fa';\nimport { FaBug, FaBullseye } from 'react-icons/fa6';\n\nimport { cn } from '@fuf-stack/pixel-utils';\nimport { Button } from '@fuf-stack/pixels/Button';\nimport { Card } from '@fuf-stack/pixels/Card';\nimport { Json } from '@fuf-stack/pixels/Json';\n\nimport { useFormContext } from '../../hooks/useFormContext';\n\n// import Json css (theme)\nimport '@fuf-stack/pixels/Json.css';\n\ninterface FormDebugViewerProps {\n /** CSS class name */\n className?: string;\n}\n\n/** Renders a form debug panel with information about the current form state */\nconst FormDebugViewer = ({ className = undefined }: FormDebugViewerProps) => {\n const {\n debugMode,\n formState: { isValid, isSubmitting, submitCount, isSubmitSuccessful },\n getValues,\n setDebugMode,\n validation: { errors },\n subscribe,\n } = useFormContext();\n\n const showDebugButton = debugMode === 'off';\n const showDebugCard = debugMode === 'debug' || debugMode === 'debug-testids';\n const showDebugTestIds = debugMode === 'debug-testids';\n\n // Use subscribe instead of watch() to avoid triggering re-renders on parent components.\n // This component manages its own state and only updates itself when form values change.\n const [values, setValues] = useState<Record<string, unknown>>({});\n\n useEffect(() => {\n // Only subscribe when debug card is visible\n if (!showDebugCard) {\n return undefined;\n }\n\n // Initialize with current values when debug card is opened\n setValues(getValues() ?? {});\n\n const subscription = subscribe({\n formState: { values: true },\n callback: (state) => {\n setValues(state.values ?? {});\n },\n });\n\n return () => {\n subscription();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [showDebugCard]);\n\n if (showDebugButton) {\n return (\n <Button\n ariaLabel=\"Enable form debug mode\"\n className=\"fixed bottom-2.5 right-2.5 w-5 text-default-400\"\n icon={<FaBug />}\n variant=\"light\"\n onClick={() => {\n setDebugMode('debug');\n }}\n />\n );\n }\n\n // do not show card\n if (!showDebugCard) {\n return null;\n }\n\n return (\n <Card\n className={cn(className)}\n header={\n <div className=\"flex w-full flex-row justify-between\">\n <span className=\"text-lg\">Debug Mode</span>\n <Button\n color=\"danger\"\n icon={<FaTimes />}\n size=\"sm\"\n variant=\"light\"\n onClick={() => {\n setDebugMode('off');\n }}\n />\n </div>\n }\n >\n <Button\n className=\"mb-4 ml-auto mr-auto\"\n icon={<FaBullseye />}\n variant={showDebugTestIds ? 'solid' : 'light'}\n onClick={() => {\n setDebugMode(debugMode === 'debug' ? 'debug-testids' : 'debug');\n }}\n >\n {showDebugTestIds ? 'Hide CopyButton' : 'Show CopyButton'}\n </Button>\n <Json\n value={{\n values,\n errors: errors ?? null,\n submit: {\n isValid,\n isSubmitting,\n isSubmitSuccessful,\n submitCount,\n },\n }}\n />\n </Card>\n );\n};\n\nexport default FormDebugViewer;\n","import type { VetoInstance } from '@fuf-stack/veto';\nimport type { ReactNode } from 'react';\nimport type { FieldValues, SubmitHandler } from 'react-hook-form';\nimport type { DebugModeSettings } from './subcomponents/FormContext';\n\nimport { cn, slugify } from '@fuf-stack/pixel-utils';\n\nimport FormProvider from './subcomponents/FormContext';\nimport FormDebugViewer from './subcomponents/FormDebugViewer';\n\nconst IS_TEST = process.env.NODE_ENV === 'test';\n\nexport interface FormProps {\n /** form children */\n children: ReactNode | ReactNode[];\n /** CSS class name */\n className?: string | string[];\n /** settings for from debug mode */\n debug?: DebugModeSettings;\n /** initial form values */\n initialValues?: FieldValues;\n /** name of the form */\n name?: string;\n /** form submit handler */\n onSubmit: SubmitHandler<FieldValues>;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** veto validation schema */\n validation?: VetoInstance;\n /** when the validation should be triggered */\n validationTrigger?: 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all';\n}\n\n/**\n * Form component that has to wrap every uniform\n */\nconst Form = ({\n children,\n className = undefined,\n debug = undefined,\n initialValues = undefined,\n name = undefined,\n onSubmit,\n testId = undefined,\n validation = undefined,\n validationTrigger = 'all',\n}: FormProps) => {\n return (\n <FormProvider\n debugModeSettings={debug}\n initialValues={initialValues}\n onSubmit={onSubmit}\n validation={validation}\n validationTrigger={validationTrigger}\n >\n {({ handleSubmit, isValid }) => {\n return (\n <div className=\"flex w-full flex-row justify-between gap-6\">\n <form\n className={cn('grow', className)}\n data-form-is-valid={isValid}\n data-testid={slugify(testId ?? name ?? '')}\n name={name}\n onSubmit={handleSubmit}\n >\n {children}\n </form>\n {/* render debug viewer when not in test environment and debug not disabled */}\n {!IS_TEST && !debug?.disable && (\n <FormDebugViewer className=\"w-96 shrink\" />\n )}\n </div>\n );\n }}\n </FormProvider>\n );\n};\n\nexport default Form;\n","import Form from './Form';\n\nexport type { FormProps } from './Form';\n\nexport { Form };\n\nexport default Form;\n"],"mappings":";;;;;;;;;;;;;;AAoBA,MAAM,mBAAmB,EAAE,YAAY,aAAsC;CAC3E,MAAM,EACJ,WACA,WAAW,EAAE,SAAS,cAAc,aAAa,sBACjD,WACA,cACA,YAAY,EAAE,UACd,cACE,gBAAgB;CAEpB,MAAM,kBAAkB,cAAc;CACtC,MAAM,gBAAgB,cAAc,WAAW,cAAc;CAC7D,MAAM,mBAAmB,cAAc;CAIvC,MAAM,CAAC,QAAQ,aAAa,SAAkC,EAAE,CAAC;AAEjE,iBAAgB;AAEd,MAAI,CAAC,cACH;AAIF,YAAU,WAAW,IAAI,EAAE,CAAC;EAE5B,MAAM,eAAe,UAAU;GAC7B,WAAW,EAAE,QAAQ,MAAM;GAC3B,WAAW,UAAU;AACnB,cAAU,MAAM,UAAU,EAAE,CAAC;;GAEhC,CAAC;AAEF,eAAa;AACX,iBAAc;;IAGf,CAAC,cAAc,CAAC;AAEnB,KAAI,gBACF,QACE,oBAAC;EACC,WAAU;EACV,WAAU;EACV,MAAM,oBAAC,UAAQ;EACf,SAAQ;EACR,eAAe;AACb,gBAAa,QAAQ;;GAEvB;AAKN,KAAI,CAAC,cACH,QAAO;AAGT,QACE,qBAAC;EACC,WAAW,GAAG,UAAU;EACxB,QACE,qBAAC;GAAI,WAAU;cACb,oBAAC;IAAK,WAAU;cAAU;KAAiB,EAC3C,oBAAC;IACC,OAAM;IACN,MAAM,oBAAC,YAAU;IACjB,MAAK;IACL,SAAQ;IACR,eAAe;AACb,kBAAa,MAAM;;KAErB;IACE;aAGR,oBAAC;GACC,WAAU;GACV,MAAM,oBAAC,eAAa;GACpB,SAAS,mBAAmB,UAAU;GACtC,eAAe;AACb,iBAAa,cAAc,UAAU,kBAAkB,QAAQ;;aAGhE,mBAAmB,oBAAoB;IACjC,EACT,oBAAC,QACC,OAAO;GACL;GACA,QAAQ,UAAU;GAClB,QAAQ;IACN;IACA;IACA;IACA;IACD;GACF,GACD;GACG;;AAIX,8BAAe;;;;ACjHf,MAAM,UAAU,QAAQ,IAAI,aAAa;;;;AA0BzC,MAAM,QAAQ,EACZ,UACA,YAAY,QACZ,QAAQ,QACR,gBAAgB,QAChB,OAAO,QACP,UACA,SAAS,QACT,aAAa,QACb,oBAAoB,YACL;AACf,QACE,oBAACA;EACC,mBAAmB;EACJ;EACL;EACE;EACO;aAEjB,EAAE,cAAc,cAAc;AAC9B,UACE,qBAAC;IAAI,WAAU;eACb,oBAAC;KACC,WAAW,GAAG,QAAQ,UAAU;KAChC,sBAAoB;KACpB,eAAa,QAAQ,UAAU,QAAQ,GAAG;KACpC;KACN,UAAU;KAET;MACI,EAEN,CAAC,WAAW,CAAC,OAAO,WACnB,oBAACC,2BAAgB,WAAU,gBAAgB;KAEzC;;GAGG;;AAInB,qBAAe;;;;ACxEf,mBAAeC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_FormContext = require('./FormContext-
|
|
2
|
-
const require_useFormContext = require('./useFormContext-
|
|
1
|
+
const require_FormContext = require('./FormContext-Lw4YL4-B.cjs');
|
|
2
|
+
const require_useFormContext = require('./useFormContext-CEr3zcL6.cjs');
|
|
3
3
|
let _fuf_stack_pixel_utils = require("@fuf-stack/pixel-utils");
|
|
4
4
|
let react = require("react");
|
|
5
5
|
let react_icons_fa6 = require("react-icons/fa6");
|
|
@@ -127,4 +127,4 @@ Object.defineProperty(exports, 'Form_default$1', {
|
|
|
127
127
|
return Form_default$1;
|
|
128
128
|
}
|
|
129
129
|
});
|
|
130
|
-
//# sourceMappingURL=Form-
|
|
130
|
+
//# sourceMappingURL=Form-CvnnGF45.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form-
|
|
1
|
+
{"version":3,"file":"Form-CvnnGF45.cjs","names":["useFormContext","Button","FaBug","Card","FaTimes","FaBullseye","Json","FormProvider","FormDebugViewer","Form"],"sources":["../src/Form/subcomponents/FormDebugViewer.tsx","../src/Form/Form.tsx","../src/Form/index.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\nimport { FaTimes } from 'react-icons/fa';\nimport { FaBug, FaBullseye } from 'react-icons/fa6';\n\nimport { cn } from '@fuf-stack/pixel-utils';\nimport { Button } from '@fuf-stack/pixels/Button';\nimport { Card } from '@fuf-stack/pixels/Card';\nimport { Json } from '@fuf-stack/pixels/Json';\n\nimport { useFormContext } from '../../hooks/useFormContext';\n\n// import Json css (theme)\nimport '@fuf-stack/pixels/Json.css';\n\ninterface FormDebugViewerProps {\n /** CSS class name */\n className?: string;\n}\n\n/** Renders a form debug panel with information about the current form state */\nconst FormDebugViewer = ({ className = undefined }: FormDebugViewerProps) => {\n const {\n debugMode,\n formState: { isValid, isSubmitting, submitCount, isSubmitSuccessful },\n getValues,\n setDebugMode,\n validation: { errors },\n subscribe,\n } = useFormContext();\n\n const showDebugButton = debugMode === 'off';\n const showDebugCard = debugMode === 'debug' || debugMode === 'debug-testids';\n const showDebugTestIds = debugMode === 'debug-testids';\n\n // Use subscribe instead of watch() to avoid triggering re-renders on parent components.\n // This component manages its own state and only updates itself when form values change.\n const [values, setValues] = useState<Record<string, unknown>>({});\n\n useEffect(() => {\n // Only subscribe when debug card is visible\n if (!showDebugCard) {\n return undefined;\n }\n\n // Initialize with current values when debug card is opened\n setValues(getValues() ?? {});\n\n const subscription = subscribe({\n formState: { values: true },\n callback: (state) => {\n setValues(state.values ?? {});\n },\n });\n\n return () => {\n subscription();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [showDebugCard]);\n\n if (showDebugButton) {\n return (\n <Button\n ariaLabel=\"Enable form debug mode\"\n className=\"fixed bottom-2.5 right-2.5 w-5 text-default-400\"\n icon={<FaBug />}\n variant=\"light\"\n onClick={() => {\n setDebugMode('debug');\n }}\n />\n );\n }\n\n // do not show card\n if (!showDebugCard) {\n return null;\n }\n\n return (\n <Card\n className={cn(className)}\n header={\n <div className=\"flex w-full flex-row justify-between\">\n <span className=\"text-lg\">Debug Mode</span>\n <Button\n color=\"danger\"\n icon={<FaTimes />}\n size=\"sm\"\n variant=\"light\"\n onClick={() => {\n setDebugMode('off');\n }}\n />\n </div>\n }\n >\n <Button\n className=\"mb-4 ml-auto mr-auto\"\n icon={<FaBullseye />}\n variant={showDebugTestIds ? 'solid' : 'light'}\n onClick={() => {\n setDebugMode(debugMode === 'debug' ? 'debug-testids' : 'debug');\n }}\n >\n {showDebugTestIds ? 'Hide CopyButton' : 'Show CopyButton'}\n </Button>\n <Json\n value={{\n values,\n errors: errors ?? null,\n submit: {\n isValid,\n isSubmitting,\n isSubmitSuccessful,\n submitCount,\n },\n }}\n />\n </Card>\n );\n};\n\nexport default FormDebugViewer;\n","import type { VetoInstance } from '@fuf-stack/veto';\nimport type { ReactNode } from 'react';\nimport type { FieldValues, SubmitHandler } from 'react-hook-form';\nimport type { DebugModeSettings } from './subcomponents/FormContext';\n\nimport { cn, slugify } from '@fuf-stack/pixel-utils';\n\nimport FormProvider from './subcomponents/FormContext';\nimport FormDebugViewer from './subcomponents/FormDebugViewer';\n\nconst IS_TEST = process.env.NODE_ENV === 'test';\n\nexport interface FormProps {\n /** form children */\n children: ReactNode | ReactNode[];\n /** CSS class name */\n className?: string | string[];\n /** settings for from debug mode */\n debug?: DebugModeSettings;\n /** initial form values */\n initialValues?: FieldValues;\n /** name of the form */\n name?: string;\n /** form submit handler */\n onSubmit: SubmitHandler<FieldValues>;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** veto validation schema */\n validation?: VetoInstance;\n /** when the validation should be triggered */\n validationTrigger?: 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all';\n}\n\n/**\n * Form component that has to wrap every uniform\n */\nconst Form = ({\n children,\n className = undefined,\n debug = undefined,\n initialValues = undefined,\n name = undefined,\n onSubmit,\n testId = undefined,\n validation = undefined,\n validationTrigger = 'all',\n}: FormProps) => {\n return (\n <FormProvider\n debugModeSettings={debug}\n initialValues={initialValues}\n onSubmit={onSubmit}\n validation={validation}\n validationTrigger={validationTrigger}\n >\n {({ handleSubmit, isValid }) => {\n return (\n <div className=\"flex w-full flex-row justify-between gap-6\">\n <form\n className={cn('grow', className)}\n data-form-is-valid={isValid}\n data-testid={slugify(testId ?? name ?? '')}\n name={name}\n onSubmit={handleSubmit}\n >\n {children}\n </form>\n {/* render debug viewer when not in test environment and debug not disabled */}\n {!IS_TEST && !debug?.disable && (\n <FormDebugViewer className=\"w-96 shrink\" />\n )}\n </div>\n );\n }}\n </FormProvider>\n );\n};\n\nexport default Form;\n","import Form from './Form';\n\nexport type { FormProps } from './Form';\n\nexport { Form };\n\nexport default Form;\n"],"mappings":";;;;;;;;;;;;;;AAoBA,MAAM,mBAAmB,EAAE,YAAY,aAAsC;CAC3E,MAAM,EACJ,WACA,WAAW,EAAE,SAAS,cAAc,aAAa,sBACjD,WACA,cACA,YAAY,EAAE,UACd,cACEA,uCAAgB;CAEpB,MAAM,kBAAkB,cAAc;CACtC,MAAM,gBAAgB,cAAc,WAAW,cAAc;CAC7D,MAAM,mBAAmB,cAAc;CAIvC,MAAM,CAAC,QAAQ,iCAA+C,EAAE,CAAC;AAEjE,4BAAgB;AAEd,MAAI,CAAC,cACH;AAIF,YAAU,WAAW,IAAI,EAAE,CAAC;EAE5B,MAAM,eAAe,UAAU;GAC7B,WAAW,EAAE,QAAQ,MAAM;GAC3B,WAAW,UAAU;AACnB,cAAU,MAAM,UAAU,EAAE,CAAC;;GAEhC,CAAC;AAEF,eAAa;AACX,iBAAc;;IAGf,CAAC,cAAc,CAAC;AAEnB,KAAI,gBACF,QACE,2CAACC;EACC,WAAU;EACV,WAAU;EACV,MAAM,2CAACC,0BAAQ;EACf,SAAQ;EACR,eAAe;AACb,gBAAa,QAAQ;;GAEvB;AAKN,KAAI,CAAC,cACH,QAAO;AAGT,QACE,4CAACC;EACC,0CAAc,UAAU;EACxB,QACE,4CAAC;GAAI,WAAU;cACb,2CAAC;IAAK,WAAU;cAAU;KAAiB,EAC3C,2CAACF;IACC,OAAM;IACN,MAAM,2CAACG,2BAAU;IACjB,MAAK;IACL,SAAQ;IACR,eAAe;AACb,kBAAa,MAAM;;KAErB;IACE;aAGR,2CAACH;GACC,WAAU;GACV,MAAM,2CAACI,+BAAa;GACpB,SAAS,mBAAmB,UAAU;GACtC,eAAe;AACb,iBAAa,cAAc,UAAU,kBAAkB,QAAQ;;aAGhE,mBAAmB,oBAAoB;IACjC,EACT,2CAACC,+BACC,OAAO;GACL;GACA,QAAQ,UAAU;GAClB,QAAQ;IACN;IACA;IACA;IACA;IACD;GACF,GACD;GACG;;AAIX,8BAAe;;;;ACjHf,MAAM,UAAU,QAAQ,IAAI,aAAa;;;;AA0BzC,MAAM,QAAQ,EACZ,UACA,YAAY,QACZ,QAAQ,QACR,gBAAgB,QAChB,OAAO,QACP,UACA,SAAS,QACT,aAAa,QACb,oBAAoB,YACL;AACf,QACE,2CAACC;EACC,mBAAmB;EACJ;EACL;EACE;EACO;aAEjB,EAAE,cAAc,cAAc;AAC9B,UACE,4CAAC;IAAI,WAAU;eACb,2CAAC;KACC,0CAAc,QAAQ,UAAU;KAChC,sBAAoB;KACpB,mDAAqB,UAAU,QAAQ,GAAG;KACpC;KACN,UAAU;KAET;MACI,EAEN,CAAC,WAAW,CAAC,OAAO,WACnB,2CAACC,2BAAgB,WAAU,gBAAgB;KAEzC;;GAGG;;AAInB,qBAAe;;;;ACxEf,mBAAeC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as toFormFormat, s as toValidationFormat } from "./helpers-CCINRgQk.js";
|
|
2
2
|
import React, { useCallback, useMemo, useRef, useState } from "react";
|
|
3
3
|
import { useLocalStorage } from "@fuf-stack/pixels";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -226,4 +226,4 @@ var FormContext_default = FormProvider$1;
|
|
|
226
226
|
|
|
227
227
|
//#endregion
|
|
228
228
|
export { UniformContext as n, FormContext_default as t };
|
|
229
|
-
//# sourceMappingURL=FormContext-
|
|
229
|
+
//# sourceMappingURL=FormContext-Dl3k1r_k.js.map
|