@fuf-stack/uniform 1.11.0 → 1.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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-CGWhnpBp.js → Checkboxes-BY4UK0Xf.js} +6 -6
- package/dist/Checkboxes-BY4UK0Xf.js.map +1 -0
- package/dist/{Checkboxes-Ds6bzl6p.cjs → Checkboxes-DgCK-Wq-.cjs} +18 -18
- package/dist/Checkboxes-DgCK-Wq-.cjs.map +1 -0
- 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-D3iUaRLo.js → FieldArray-CDLaGvNj.js} +8 -8
- package/dist/FieldArray-CDLaGvNj.js.map +1 -0
- package/dist/{FieldArray-BexXN9bO.cjs → FieldArray-DBsyUQkU.cjs} +49 -49
- package/dist/FieldArray-DBsyUQkU.cjs.map +1 -0
- 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-mpmErfDK.js → FieldCard-C1MCSbPW.js} +3 -3
- package/dist/{FieldCard-mpmErfDK.js.map → FieldCard-C1MCSbPW.js.map} +1 -1
- package/dist/{FieldCard-pP7aniZU.cjs → FieldCard-NKF358fO.cjs} +13 -13
- package/dist/{FieldCard-pP7aniZU.cjs.map → FieldCard-NKF358fO.cjs.map} +1 -1
- package/dist/{FieldCopyTestIdButton-AaLwu_8y.cjs → FieldCopyTestIdButton-BSYcSo2o.cjs} +10 -10
- package/dist/{FieldCopyTestIdButton-AaLwu_8y.cjs.map → FieldCopyTestIdButton-BSYcSo2o.cjs.map} +1 -1
- package/dist/{FieldCopyTestIdButton-Cx8AXJhO.js → FieldCopyTestIdButton-DWPCDJ-s.js} +4 -4
- package/dist/{FieldCopyTestIdButton-Cx8AXJhO.js.map → FieldCopyTestIdButton-DWPCDJ-s.js.map} +1 -1
- package/dist/{FieldValidationError-D86DPSOH.js → FieldValidationError-1hiDEFew.js} +4 -4
- package/dist/{FieldValidationError-D86DPSOH.js.map → FieldValidationError-1hiDEFew.js.map} +1 -1
- package/dist/{FieldValidationError-Cq6aI0tE.cjs → FieldValidationError-CE8R8qry.cjs} +13 -13
- package/dist/{FieldValidationError-Cq6aI0tE.cjs.map → FieldValidationError-CE8R8qry.cjs.map} +1 -1
- package/dist/Form/index.cjs +1 -1
- package/dist/Form/index.d.ts +1 -1
- package/dist/Form/index.js +1 -1
- package/dist/{Form-FvN3SXfF.cjs → Form-BsD69fql.cjs} +19 -19
- package/dist/{Form-FvN3SXfF.cjs.map → Form-BsD69fql.cjs.map} +1 -1
- package/dist/{Form-CFmCTl60.js → Form-DRNEwHsi.js} +4 -4
- package/dist/{Form-CFmCTl60.js.map → Form-DRNEwHsi.js.map} +1 -1
- package/dist/{FormContext-C3GymQOA.cjs → FormContext-Bb6d8hdG.cjs} +8 -8
- package/dist/FormContext-Bb6d8hdG.cjs.map +1 -0
- package/dist/FormContext-CN9n_KdE.js.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/index.js +1 -1
- package/dist/{Grid-DG60vYYG.cjs → Grid-D84e76CE.cjs} +8 -8
- package/dist/{Grid-DG60vYYG.cjs.map → Grid-D84e76CE.cjs.map} +1 -1
- package/dist/{Grid-DEH7Sezi.js → Grid-LRjQlZms.js} +4 -4
- package/dist/{Grid-DEH7Sezi.js.map → Grid-LRjQlZms.js.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--h5t7Sbl.js → Input-DXMWGTBh.js} +5 -5
- package/dist/Input-DXMWGTBh.js.map +1 -0
- package/dist/{Input-DKfFFOpo.cjs → Input-DeTpxiK_.cjs} +15 -15
- package/dist/Input-DeTpxiK_.cjs.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-7qdHj3ti.js → RadioBoxes-BEln4a-B.js} +5 -5
- package/dist/RadioBoxes-BEln4a-B.js.map +1 -0
- package/dist/{RadioBoxes-Bd9ahl4i.cjs → RadioBoxes-gsQGqQCd.cjs} +22 -22
- package/dist/RadioBoxes-gsQGqQCd.cjs.map +1 -0
- 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-DcEUdW7r.cjs → RadioTabs-BYpP0tKA.cjs} +18 -18
- package/dist/RadioTabs-BYpP0tKA.cjs.map +1 -0
- package/dist/{RadioTabs-DXs98jng.js → RadioTabs-DLr9QiXI.js} +5 -5
- package/dist/RadioTabs-DLr9QiXI.js.map +1 -0
- 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-CIPNqPzi.cjs → Radios-BCOfnTke.cjs} +14 -14
- package/dist/{Radios-CIPNqPzi.cjs.map → Radios-BCOfnTke.cjs.map} +1 -1
- package/dist/{Radios-BIx06mzU.js → Radios-DCXI2kMf.js} +5 -5
- package/dist/{Radios-BIx06mzU.js.map → Radios-DCXI2kMf.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-CBjqYDcs.js → Select-CyfEmWiD.js} +5 -5
- package/dist/Select-CyfEmWiD.js.map +1 -0
- package/dist/{Select-BsL7qn2v.cjs → Select-KnPGOO27.cjs} +19 -19
- package/dist/Select-KnPGOO27.cjs.map +1 -0
- 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-BDLbD7d5.cjs → Slider-C7xxYPgR.cjs} +15 -15
- package/dist/{Slider-BDLbD7d5.cjs.map → Slider-C7xxYPgR.cjs.map} +1 -1
- package/dist/{Slider-BHjHSoIk.js → Slider-Dlhb-9hC.js} +5 -5
- package/dist/{Slider-BHjHSoIk.js.map → Slider-Dlhb-9hC.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-7iOaKzhB.js → SubmitButton-C5f6j0N4.js} +4 -4
- package/dist/{SubmitButton-7iOaKzhB.js.map → SubmitButton-C5f6j0N4.js.map} +1 -1
- package/dist/{SubmitButton-DhtPJuro.cjs → SubmitButton-CUBItcBn.cjs} +12 -12
- package/dist/{SubmitButton-DhtPJuro.cjs.map → SubmitButton-CUBItcBn.cjs.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-DCxAgt_L.js → Switch--m02Xcq8.js} +5 -5
- package/dist/{Switch-DCxAgt_L.js.map → Switch--m02Xcq8.js.map} +1 -1
- package/dist/{Switch-Dczzog3v.cjs → Switch-6LyeZHJh.cjs} +15 -15
- package/dist/{Switch-Dczzog3v.cjs.map → Switch-6LyeZHJh.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-DqVmZYId.cjs → SwitchBox-CtGiQdys.cjs} +19 -19
- package/dist/{SwitchBox-DqVmZYId.cjs.map → SwitchBox-CtGiQdys.cjs.map} +1 -1
- package/dist/{SwitchBox-DPHryDOM.js → SwitchBox-D0-e-pbM.js} +5 -5
- package/dist/{SwitchBox-DPHryDOM.js.map → SwitchBox-D0-e-pbM.js.map} +1 -1
- package/dist/TextArea/index.cjs +1 -1
- package/dist/TextArea/index.d.cts +1 -1
- package/dist/TextArea/index.d.ts +1 -1
- package/dist/TextArea/index.js +1 -1
- package/dist/{TextArea-BR6e-Fio.js → TextArea-BiSnvJ69.js} +5 -5
- package/dist/{TextArea-BR6e-Fio.js.map → TextArea-BiSnvJ69.js.map} +1 -1
- package/dist/{TextArea-CH-F6_ax.cjs → TextArea-PtdSABZS.cjs} +13 -13
- package/dist/{TextArea-CH-F6_ax.cjs.map → TextArea-PtdSABZS.cjs.map} +1 -1
- package/dist/helpers/index.cjs +1 -1
- package/dist/helpers-B-CJOBt3.js.map +1 -1
- package/dist/{helpers-KTgXi0lA.cjs → helpers-B84E9vHd.cjs} +4 -4
- package/dist/helpers-B84E9vHd.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/useController/index.cjs +1 -1
- package/dist/hooks/useController/index.d.ts +0 -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 +2 -2
- package/dist/hooks/useInput/index.cjs +3 -3
- package/dist/hooks/useInput/index.d.cts +1 -1
- package/dist/hooks/useInput/index.d.ts +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/useInputValueTransform/index.cjs +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 +24 -4
- package/dist/hooks/useUniformFieldArray/index.js +1 -1
- package/dist/hooks/useWatchUserChange/index.cjs +1 -1
- package/dist/{index-CzypMcVS.d.cts → index--E2ZsMya.d.ts} +6 -6
- package/dist/{index-C_ATGeaX.d.ts.map → index--E2ZsMya.d.ts.map} +1 -1
- package/dist/{index-C56I3SOi.d.cts → index-BITJ-CZL.d.cts} +4 -4
- package/dist/{index-C56I3SOi.d.cts.map → index-BITJ-CZL.d.cts.map} +1 -1
- package/dist/{index-CVY05bZf.d.ts → index-BL0DnIzh.d.ts} +3 -3
- package/dist/{index-CVY05bZf.d.ts.map → index-BL0DnIzh.d.ts.map} +1 -1
- package/dist/{index-CHmS3ri3.d.ts → index-BQDEnYTq.d.ts} +1 -1
- package/dist/{index-CHmS3ri3.d.ts.map → index-BQDEnYTq.d.ts.map} +1 -1
- package/dist/{index-DHHBSmJb.d.ts → index-BTTo_ufh.d.ts} +1 -1
- package/dist/{index-DHHBSmJb.d.ts.map → index-BTTo_ufh.d.ts.map} +1 -1
- package/dist/{index-B74QlCAy.d.cts → index-BWNJdLDV.d.ts} +48 -48
- package/dist/{index-B4Wkijem.d.ts.map → index-BWNJdLDV.d.ts.map} +1 -1
- package/dist/{index-CraZe1qS.d.ts → index-Bj_lpc5r.d.cts} +21 -21
- package/dist/{index-CI9QBUoM.d.cts.map → index-Bj_lpc5r.d.cts.map} +1 -1
- package/dist/{index-B4Wkijem.d.ts → index-Bo_n9sse.d.cts} +47 -47
- package/dist/{index-B74QlCAy.d.cts.map → index-Bo_n9sse.d.cts.map} +1 -1
- package/dist/{index-iuLEYAix.d.cts → index-BxA_pJWn.d.cts} +21 -21
- package/dist/{index-iuLEYAix.d.cts.map → index-BxA_pJWn.d.cts.map} +1 -1
- package/dist/{index-Drl7euco.d.ts → index-C-2nxT8D.d.ts} +21 -21
- package/dist/{index-Drl7euco.d.ts.map → index-C-2nxT8D.d.ts.map} +1 -1
- package/dist/{index-C1fYmoY0.d.ts → index-C0L7GvgN.d.cts} +34 -34
- package/dist/index-C0L7GvgN.d.cts.map +1 -0
- package/dist/{index-DzuP5q-2.d.ts → index-C1PUx1tH.d.ts} +6 -6
- package/dist/index-C1PUx1tH.d.ts.map +1 -0
- package/dist/index-CADnFWHq.d.ts +264 -0
- package/dist/{index-BTEsKen4.d.ts.map → index-CADnFWHq.d.ts.map} +1 -1
- package/dist/{index-BM4XWo1K.d.ts → index-CGnr_e53.d.ts} +36 -36
- package/dist/{index-BM4XWo1K.d.ts.map → index-CGnr_e53.d.ts.map} +1 -1
- package/dist/{index-DhMSgdwM.d.ts → index-CSBE6Et0.d.cts} +6 -6
- package/dist/{index-Dklb-p_1.d.cts.map → index-CSBE6Et0.d.cts.map} +1 -1
- package/dist/{index-D6RB3b5L.d.ts → index-CVnn6mEI.d.ts} +4 -4
- package/dist/{index-D6RB3b5L.d.ts.map → index-CVnn6mEI.d.ts.map} +1 -1
- package/dist/{index-BMN2XNyT.d.cts → index-CYdvpGJF.d.cts} +3 -3
- package/dist/{index-BMN2XNyT.d.cts.map → index-CYdvpGJF.d.cts.map} +1 -1
- package/dist/{index-CbAh0Kfo.d.cts → index-Cb0AgRRa.d.cts} +3 -3
- package/dist/{index-CbAh0Kfo.d.cts.map → index-Cb0AgRRa.d.cts.map} +1 -1
- package/dist/{index-DA5um0u6.d.cts → index-D38wOL-M.d.ts} +34 -34
- package/dist/index-D38wOL-M.d.ts.map +1 -0
- package/dist/{index-DpD4MxGD.d.cts → index-DG9C0kHA.d.ts} +35 -34
- package/dist/{index-RvYO46Vg.d.ts.map → index-DG9C0kHA.d.ts.map} +1 -1
- package/dist/{index-RvYO46Vg.d.ts → index-DNkZrb7P.d.cts} +35 -36
- package/dist/{index-DpD4MxGD.d.cts.map → index-DNkZrb7P.d.cts.map} +1 -1
- package/dist/{index-C_ATGeaX.d.ts → index-DRij_w43.d.cts} +5 -5
- package/dist/{index-CzypMcVS.d.cts.map → index-DRij_w43.d.cts.map} +1 -1
- package/dist/{index-Dklb-p_1.d.cts → index-DmMenZfj.d.ts} +5 -5
- package/dist/{index-DhMSgdwM.d.ts.map → index-DmMenZfj.d.ts.map} +1 -1
- package/dist/{index-CI9QBUoM.d.cts → index-DnzC0GCS.d.ts} +3 -3
- package/dist/index-DnzC0GCS.d.ts.map +1 -0
- package/dist/{index-BOI0cy-n.d.cts → index-DoS0lVRe.d.cts} +34 -34
- package/dist/index-DoS0lVRe.d.cts.map +1 -0
- package/dist/{index-aHcGnXHf.d.ts → index-DvB46QAb.d.ts} +3 -3
- package/dist/{index-aHcGnXHf.d.ts.map → index-DvB46QAb.d.ts.map} +1 -1
- package/dist/{index-BW9EUWZE.d.cts → index-DxdaxM3o.d.cts} +3 -3
- package/dist/{index-BW9EUWZE.d.cts.map → index-DxdaxM3o.d.cts.map} +1 -1
- package/dist/{index-CQWoxgWk.d.ts → index-Edx7MxXu.d.ts} +3 -3
- package/dist/{index-CQWoxgWk.d.ts.map → index-Edx7MxXu.d.ts.map} +1 -1
- package/dist/{index-BaBZGCqS.d.cts → index-F11geOHD.d.ts} +6 -6
- package/dist/{index-CvA5yKx9.d.ts.map → index-F11geOHD.d.ts.map} +1 -1
- package/dist/{index-1gPh6Uoh.d.cts → index-PU5WNOH9.d.cts} +3 -3
- package/dist/{index-1gPh6Uoh.d.cts.map → index-PU5WNOH9.d.cts.map} +1 -1
- package/dist/{index-CO-l7RmT.d.cts → index-WogV9uVV.d.cts} +6 -6
- package/dist/{index-CO-l7RmT.d.cts.map → index-WogV9uVV.d.cts.map} +1 -1
- package/dist/{index-CvA5yKx9.d.ts → index-oyX8xu0F.d.cts} +4 -4
- package/dist/{index-BaBZGCqS.d.cts.map → index-oyX8xu0F.d.cts.map} +1 -1
- package/dist/index-sJZ434Sg.d.cts +264 -0
- package/dist/index-sJZ434Sg.d.cts.map +1 -0
- package/dist/index.cjs +29 -29
- package/dist/index.d.cts +22 -22
- package/dist/index.d.ts +24 -25
- package/dist/index.js +19 -19
- 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-CkBtUSco.d.ts → useClientValidation-BQqwz628.d.cts} +3 -3
- package/dist/{useClientValidation-C3Q5UCy9.d.cts.map → useClientValidation-BQqwz628.d.cts.map} +1 -1
- package/dist/useClientValidation-BnnscAEe.js.map +1 -1
- package/dist/{useClientValidation-oZd4_ocQ.cjs → useClientValidation-CmYVGlLr.cjs} +7 -7
- package/dist/useClientValidation-CmYVGlLr.cjs.map +1 -0
- package/dist/{useClientValidation-C3Q5UCy9.d.cts → useClientValidation-DJ4JuN_9.d.ts} +3 -3
- package/dist/{useClientValidation-CkBtUSco.d.ts.map → useClientValidation-DJ4JuN_9.d.ts.map} +1 -1
- package/dist/{useController-BzkCcbSo.cjs → useController-CkmO5CLh.cjs} +3 -3
- package/dist/{useController-BzkCcbSo.cjs.map → useController-CkmO5CLh.cjs.map} +1 -1
- package/dist/{useFormContext-CZh7pv8f.d.cts → useFormContext-B083Y-kw.d.cts} +17 -17
- package/dist/{useFormContext-CZh7pv8f.d.cts.map → useFormContext-B083Y-kw.d.cts.map} +1 -1
- package/dist/{useFormContext-3AAPT6eZ.d.ts → useFormContext-B2TS6xq0.d.ts} +1 -1
- package/dist/{useFormContext-3AAPT6eZ.d.ts.map → useFormContext-B2TS6xq0.d.ts.map} +1 -1
- package/dist/{useFormContext-CWuN-_7P.cjs → useFormContext-Bp0EODoO.cjs} +3 -3
- package/dist/useFormContext-Bp0EODoO.cjs.map +1 -0
- package/dist/useFormContext-JCm1UR_e.js.map +1 -1
- package/dist/{useInputValueDebounce-B2RzCWty.d.cts → useInputValueDebounce-B5b-v8Hc.d.cts} +1 -1
- package/dist/{useInputValueDebounce-B2RzCWty.d.cts.map → useInputValueDebounce-B5b-v8Hc.d.cts.map} +1 -1
- package/dist/{useInputValueDebounce-tL8maIp8.cjs → useInputValueDebounce-BcUyaS94.cjs} +2 -2
- package/dist/{useInputValueDebounce-tL8maIp8.cjs.map → useInputValueDebounce-BcUyaS94.cjs.map} +1 -1
- package/dist/{useInputValueDebounce-C7_bvNGH.d.ts → useInputValueDebounce-DoRuSF6R.d.ts} +1 -1
- package/dist/{useInputValueDebounce-C7_bvNGH.d.ts.map → useInputValueDebounce-DoRuSF6R.d.ts.map} +1 -1
- package/dist/{useInputValueTransform-C-uSW8Y3.cjs → useInputValueTransform-DFPA3KVy.cjs} +2 -2
- package/dist/{useInputValueTransform-C-uSW8Y3.cjs.map → useInputValueTransform-DFPA3KVy.cjs.map} +1 -1
- package/dist/{useUniformField-Be3kdnhK.d.cts → useUniformField-B2OZ-Z1G.d.cts} +3 -3
- package/dist/{useUniformField-Be3kdnhK.d.cts.map → useUniformField-B2OZ-Z1G.d.cts.map} +1 -1
- package/dist/{useUniformField-BMvnRC_r.cjs → useUniformField-Bj23Kvbs.cjs} +13 -13
- package/dist/useUniformField-Bj23Kvbs.cjs.map +1 -0
- package/dist/{useUniformField-DDHQ5B11.d.ts → useUniformField-CwEHonNe.d.ts} +3 -3
- package/dist/{useUniformField-DDHQ5B11.d.ts.map → useUniformField-CwEHonNe.d.ts.map} +1 -1
- package/dist/{useUniformField-ClprfrES.js → useUniformField-gU4qYUwL.js} +3 -3
- package/dist/useUniformField-gU4qYUwL.js.map +1 -0
- package/dist/{useUniformFieldArray-C-0OXG3N.js → useUniformFieldArray-B5PyxL1P.js} +2 -2
- package/dist/{useUniformFieldArray-C-0OXG3N.js.map → useUniformFieldArray-B5PyxL1P.js.map} +1 -1
- package/dist/{useUniformFieldArray-BhPi3gPv.d.ts → useUniformFieldArray-CXoWvu6m.d.ts} +3 -3
- package/dist/{useUniformFieldArray-BhPi3gPv.d.ts.map → useUniformFieldArray-CXoWvu6m.d.ts.map} +1 -1
- package/dist/{useUniformFieldArray-btjvJdZ6.cjs → useUniformFieldArray-G1lokW7x.cjs} +7 -7
- package/dist/{useUniformFieldArray-btjvJdZ6.cjs.map → useUniformFieldArray-G1lokW7x.cjs.map} +1 -1
- package/dist/{useUniformFieldArray-BBFw08qL.d.cts → useUniformFieldArray-qtJMEosJ.d.cts} +13 -13
- package/dist/{useUniformFieldArray-BBFw08qL.d.cts.map → useUniformFieldArray-qtJMEosJ.d.cts.map} +1 -1
- package/dist/{useWatchUserChange-C5dr12By.cjs → useWatchUserChange-BnxYE-0b.cjs} +3 -3
- package/dist/{useWatchUserChange-C5dr12By.cjs.map → useWatchUserChange-BnxYE-0b.cjs.map} +1 -1
- package/package.json +10 -10
- package/dist/Checkboxes-CGWhnpBp.js.map +0 -1
- package/dist/Checkboxes-Ds6bzl6p.cjs.map +0 -1
- package/dist/FieldArray-BexXN9bO.cjs.map +0 -1
- package/dist/FieldArray-D3iUaRLo.js.map +0 -1
- package/dist/FormContext-C3GymQOA.cjs.map +0 -1
- package/dist/Input--h5t7Sbl.js.map +0 -1
- package/dist/Input-DKfFFOpo.cjs.map +0 -1
- package/dist/RadioBoxes-7qdHj3ti.js.map +0 -1
- package/dist/RadioBoxes-Bd9ahl4i.cjs.map +0 -1
- package/dist/RadioTabs-DXs98jng.js.map +0 -1
- package/dist/RadioTabs-DcEUdW7r.cjs.map +0 -1
- package/dist/Select-BsL7qn2v.cjs.map +0 -1
- package/dist/Select-CBjqYDcs.js.map +0 -1
- package/dist/helpers-KTgXi0lA.cjs.map +0 -1
- package/dist/index-BOI0cy-n.d.cts.map +0 -1
- package/dist/index-BTEsKen4.d.ts +0 -264
- package/dist/index-C1fYmoY0.d.ts.map +0 -1
- package/dist/index-CJNLQVjx.d.ts +0 -1
- package/dist/index-CqV2Q3da.d.cts +0 -264
- package/dist/index-CqV2Q3da.d.cts.map +0 -1
- package/dist/index-CraZe1qS.d.ts.map +0 -1
- package/dist/index-CwSIy_W-.d.cts +0 -1
- package/dist/index-DA5um0u6.d.cts.map +0 -1
- package/dist/index-DzuP5q-2.d.ts.map +0 -1
- package/dist/useClientValidation-oZd4_ocQ.cjs.map +0 -1
- package/dist/useFormContext-CWuN-_7P.cjs.map +0 -1
- package/dist/useUniformField-BMvnRC_r.cjs.map +0 -1
- package/dist/useUniformField-ClprfrES.js.map +0 -1
- /package/dist/{index-B3Z8gdjC.d.ts → index-BRLjimYW.d.ts} +0 -0
- /package/dist/{index-BXpMZvwA.d.cts → index-DpEKQcoR.d.cts} +0 -0
- /package/dist/{useInput-IGJqJ2tR.d.ts → useInput--wjwIBc5.d.cts} +0 -0
- /package/dist/{useInput-NMHJNZ5A.d.cts → useInput-BCdeYOOg.d.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwitchBox-
|
|
1
|
+
{"version":3,"file":"SwitchBox-D0-e-pbM.js","names":["SwitchBox"],"sources":["../src/SwitchBox/SwitchBox.tsx","../src/SwitchBox/index.ts"],"sourcesContent":["import type { TVClassName } from '@fuf-stack/pixel-utils';\nimport type { SwitchProps as HeroSwitchProps } from '@heroui/switch';\nimport type { ReactNode } from 'react';\n\nimport { useRef } from 'react';\n\nimport { useSwitch } from '@heroui/switch';\nimport { VisuallyHidden } from '@react-aria/visually-hidden';\n\nimport { cn, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../hooks/useUniformField';\n\nexport const switchBoxVariants = tv({\n slots: {\n box: 'group inline-flex w-full cursor-pointer items-center justify-between rounded-lg border-2 border-default hover:bg-content2 data-[selected=true]:border-focus',\n description: 'text-foreground opacity-70',\n icon: '',\n label:\n 'font-medium text-foreground group-data-[required=true]:after:ml-0.5 group-data-[required=true]:after:text-danger group-data-[required=true]:after:content-[\"*\"]',\n wrapper: '',\n thumb: '',\n thumbIcon: '',\n },\n variants: {\n isDisabled: {\n true: {\n box: 'pointer-events-none opacity-disabled',\n },\n },\n isInvalid: {\n true: {\n box: '!border-danger',\n label: '!text-danger',\n },\n },\n size: {\n sm: {\n box: 'gap-2 p-3',\n description: 'text-xs',\n label: 'text-xs',\n },\n md: {\n box: 'gap-4 p-4',\n description: 'text-small',\n label: 'text-sm',\n },\n lg: {\n box: 'gap-4 p-5',\n description: 'text-small',\n label: 'text-base',\n },\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\ntype ClassName = TVClassName<typeof switchBoxVariants>;\n\nexport interface SwitchBoxProps {\n /** CSS class name */\n className?: ClassName;\n /** Description text displayed below the label */\n description?: ReactNode;\n /** whether the switch should be disabled */\n disabled?: boolean;\n /** Icon to be displayed in the box */\n icon?: ReactNode;\n /** component displayed as the label */\n label?: ReactNode;\n /** name the field is registered under */\n name: string;\n /** whether the field is required */\n required?: boolean;\n /* Size of the switch */\n size?: 'sm' | 'md' | 'lg';\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** Icon to be displayed inside the thumb */\n thumbIcon?: HeroSwitchProps['thumbIcon'];\n}\n\n/**\n * SwitchBox component - A card-like box with a switch control\n */\nconst SwitchBox = ({\n className = undefined,\n description = undefined,\n icon = undefined,\n name,\n size = undefined,\n thumbIcon = undefined,\n ...uniformFieldProps\n}: SwitchBoxProps) => {\n const {\n defaultValue,\n disabled,\n errorMessage,\n field,\n getErrorMessageProps,\n getHelperWrapperProps,\n invalid,\n label,\n onBlur,\n onChange,\n ref,\n required,\n testId,\n } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n // Ref for the visual switch to forward focus\n const visualSwitchRef = useRef<HTMLInputElement>(null);\n\n // Use the useSwitch hook to get access to all the necessary props\n const {\n Component,\n slots,\n isSelected,\n getBaseProps,\n getInputProps,\n getWrapperProps,\n } = useSwitch({\n defaultSelected: !!defaultValue,\n isDisabled: disabled,\n isSelected: !!field.value,\n name: `${name}_switch`,\n onValueChange: onChange,\n size,\n thumbIcon,\n });\n\n // classNames from slots\n const variants = switchBoxVariants({\n isDisabled: disabled,\n isInvalid: invalid,\n size,\n });\n const classNames = variantsToClassNames(variants, className, 'box');\n\n return (\n <div>\n <Component\n {...getBaseProps()}\n className={classNames.box}\n data-invalid={invalid}\n data-required={required}\n data-testid={testId}\n >\n <VisuallyHidden>\n <input\n ref={ref}\n aria-label={typeof label === 'string' ? label : name}\n checked={!!field.value}\n name={name}\n tabIndex={-1}\n type=\"checkbox\"\n onChange={(e) => {\n onChange(e.target.checked);\n }}\n onFocus={() => {\n // When RHF focuses this hidden input (e.g., on validation error),\n // forward focus to the visual switch to show focus ring\n visualSwitchRef.current?.focus();\n }}\n />\n {/* Visual switch input for focus ring */}\n <input\n ref={visualSwitchRef}\n {...getInputProps()}\n onBlur={(e) => {\n // Call HeroUI's internal onBlur to clear focus state and remove focus ring\n getInputProps().onBlur?.(e);\n // Then call RHF's onBlur to mark field as touched\n onBlur();\n }}\n />\n </VisuallyHidden>\n {!icon ? (\n <span\n {...getWrapperProps()}\n className={cn(getWrapperProps().className, classNames.wrapper)}\n >\n <span className={cn(slots.thumb({ class: classNames.thumb }))}>\n {thumbIcon && typeof thumbIcon === 'function'\n ? thumbIcon({\n isSelected: !!isSelected,\n className: slots.thumbIcon({ class: classNames.thumbIcon }),\n width: '1em',\n height: '1em',\n 'data-checked': isSelected ? 'true' : 'false',\n })\n : thumbIcon}\n </span>\n </span>\n ) : null}\n {icon ? <div className={classNames.icon}>{icon}</div> : null}\n <div className=\"grow\">\n {label ? <div className={classNames.label}>{label}</div> : null}\n {description ? (\n <div className={classNames.description}>{description}</div>\n ) : null}\n </div>\n {icon ? (\n <span\n {...getWrapperProps()}\n className={cn(getWrapperProps().className, classNames.wrapper)}\n >\n <span className={cn(slots.thumb({ class: classNames.thumb }))}>\n {thumbIcon && typeof thumbIcon === 'function'\n ? thumbIcon({\n isSelected: !!isSelected,\n className: slots.thumbIcon({ class: classNames.thumbIcon }),\n width: '1em',\n height: '1em',\n 'data-checked': isSelected ? 'true' : 'false',\n })\n : thumbIcon}\n </span>\n </span>\n ) : null}\n </Component>\n {invalid ? (\n <div\n {...getHelperWrapperProps()}\n className={cn(\n getHelperWrapperProps()?.className,\n // force helper to be visible (for some reason it's hidden by default) and remove margin\n 'ml-0 block',\n )}\n >\n <div {...getErrorMessageProps()}>{errorMessage}</div>\n </div>\n ) : null}\n </div>\n );\n};\n\nexport default SwitchBox;\n","import SwitchBox from './SwitchBox';\n\nexport type { SwitchBoxProps } from './SwitchBox';\n\nexport { switchBoxVariants } from './SwitchBox';\nexport { SwitchBox };\n\nexport default SwitchBox;\n"],"mappings":";;;;;;;;AAaA,MAAa,oBAAoB,GAAG;CAClC,OAAO;EACL,KAAK;EACL,aAAa;EACb,MAAM;EACN,OACE;EACF,SAAS;EACT,OAAO;EACP,WAAW;EACZ;CACD,UAAU;EACR,YAAY,EACV,MAAM,EACJ,KAAK,wCACN,EACF;EACD,WAAW,EACT,MAAM;GACJ,KAAK;GACL,OAAO;GACR,EACF;EACD,MAAM;GACJ,IAAI;IACF,KAAK;IACL,aAAa;IACb,OAAO;IACR;GACD,IAAI;IACF,KAAK;IACL,aAAa;IACb,OAAO;IACR;GACD,IAAI;IACF,KAAK;IACL,aAAa;IACb,OAAO;IACR;GACF;EACF;CACD,iBAAiB,EACf,MAAM,MACP;CACF,CAAC;;;;AA8BF,MAAM,aAAa,EACjB,YAAY,QACZ,cAAc,QACd,OAAO,QACP,MACA,OAAO,QACP,YAAY,QAC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,GACF;MACC;KACF,GACL;GACH,OAAO,oBAAC;IAAI,WAAW,WAAW;cAAO;KAAW,GAAG;GACxD,qBAAC;IAAI,WAAU;eACZ,QAAQ,oBAAC;KAAI,WAAW,WAAW;eAAQ;MAAY,GAAG,MAC1D,cACC,oBAAC;KAAI,WAAW,WAAW;eAAc;MAAkB,GACzD;KACA;GACL,OACC,oBAAC;IACC,GAAI,iBAAiB;IACrB,WAAW,GAAG,iBAAiB,CAAC,WAAW,WAAW,QAAQ;cAE9D,oBAAC;KAAK,WAAW,GAAG,MAAM,MAAM,EAAE,OAAO,WAAW,OAAO,CAAC,CAAC;eAC1D,aAAa,OAAO,cAAc,aAC/B,UAAU;MACR,YAAY,CAAC,CAAC;MACd,WAAW,MAAM,UAAU,EAAE,OAAO,WAAW,WAAW,CAAC;MAC3D,OAAO;MACP,QAAQ;MACR,gBAAgB,aAAa,SAAS;MACvC,CAAC,GACF;MACC;KACF,GACL;;GACM,EACX,UACC,oBAAC;EACC,GAAI,uBAAuB;EAC3B,WAAW,GACT,uBAAuB,EAAE,WAEzB,aACD;YAED,oBAAC;GAAI,GAAI,sBAAsB;aAAG;IAAmB;GACjD,GACJ,QACA;;AAIV,0BAAe;;;;AC3Of,wBAAeA"}
|
package/dist/TextArea/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
-
const require_TextArea = require('../TextArea-
|
|
2
|
+
const require_TextArea = require('../TextArea-PtdSABZS.cjs');
|
|
3
3
|
|
|
4
4
|
exports.TextArea = require_TextArea.TextArea_default$1;
|
|
5
5
|
exports.default = require_TextArea.TextArea_default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as TextAreaProps, t as TextArea } from "../index-
|
|
1
|
+
import { n as TextAreaProps, t as TextArea } from "../index-Bj_lpc5r.cjs";
|
|
2
2
|
export { TextArea, TextArea as default, TextAreaProps };
|
package/dist/TextArea/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as TextAreaProps, t as TextArea } from "../index-
|
|
1
|
+
import { n as TextAreaProps, t as TextArea } from "../index-DnzC0GCS.js";
|
|
2
2
|
export { TextArea, TextArea as default, TextAreaProps };
|
package/dist/TextArea/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as useUniformField } from "./useUniformField-
|
|
1
|
+
import { t as useUniformField } from "./useUniformField-gU4qYUwL.js";
|
|
2
2
|
import { t as useInputValueDebounce } from "./useInputValueDebounce-DaH5ONlQ.js";
|
|
3
3
|
import { tv, variantsToClassNames } from "@fuf-stack/pixel-utils";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -53,12 +53,12 @@ const TextArea = ({ children = null, className: _className = void 0, debounceDel
|
|
|
53
53
|
children
|
|
54
54
|
});
|
|
55
55
|
};
|
|
56
|
-
var TextArea_default = TextArea;
|
|
56
|
+
var TextArea_default$1 = TextArea;
|
|
57
57
|
|
|
58
58
|
//#endregion
|
|
59
59
|
//#region src/TextArea/index.ts
|
|
60
|
-
var TextArea_default
|
|
60
|
+
var TextArea_default = TextArea_default$1;
|
|
61
61
|
|
|
62
62
|
//#endregion
|
|
63
|
-
export { TextArea_default as n, TextArea_default
|
|
64
|
-
//# sourceMappingURL=TextArea-
|
|
63
|
+
export { TextArea_default$1 as n, TextArea_default as t };
|
|
64
|
+
//# sourceMappingURL=TextArea-BiSnvJ69.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextArea-
|
|
1
|
+
{"version":3,"file":"TextArea-BiSnvJ69.js","names":["HeroTextArea","TextArea"],"sources":["../src/TextArea/TextArea.tsx","../src/TextArea/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { ReactNode } from 'react';\n\nimport { Textarea as HeroTextArea } from '@heroui/input';\n\nimport { tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useInputValueDebounce } from '../hooks/useInputValueDebounce';\nimport { useUniformField } from '../hooks/useUniformField';\n\n// input variants\nexport const textAreaVariants = tv({\n slots: {\n /** wrapper around the whole input */\n base: '',\n /** clear button */\n clearButton: '',\n /** actual input element */\n input: '',\n /** inner wrapper (HeroUI inputWrapper slot) */\n inputWrapper: 'bg-content1 group-data-[focus=true]:border-focus',\n },\n});\n\ntype VariantProps = TVProps<typeof textAreaVariants>;\ntype ClassName = TVClassName<typeof textAreaVariants>;\n\nexport interface TextAreaProps extends VariantProps {\n /** Custom aria-label for accessibility. If not provided, falls back to field name when no visible label exists */\n ariaLabel?: string;\n /** Child components. The content of the textarea. */\n children?: ReactNode;\n /** CSS class name */\n className?: ClassName;\n /** debounce delay in milliseconds for form state updates (default: 300ms) */\n debounceDelay?: number;\n /** Determines if the TextArea is disabled or not. */\n disabled?: boolean;\n /** Label displayed above the TextArea. */\n label?: ReactNode;\n /** Name the TextArea is registered at in HTML forms (react-hook-form). */\n name: string;\n /** placeholder for the textArea content. */\n placeholder?: string;\n /** Id to grab element in internal tests. */\n testId?: string;\n}\n\n/**\n * TextArea component based on [HeroUI TextArea](https://www.heroui.com//docs/components/textarea)\n */\nconst TextArea = ({\n children = null,\n className: _className = undefined,\n debounceDelay = 300,\n name,\n placeholder = ' ',\n ...uniformFieldProps\n}: TextAreaProps) => {\n const {\n ariaLabel,\n disabled,\n errorMessage,\n field: {\n onChange: fieldOnChange,\n onBlur: fieldOnBlur,\n value: fieldValue,\n ref,\n },\n invalid,\n label,\n required,\n testId,\n } = useUniformField({ name, ...uniformFieldProps });\n\n // Use debounced handlers for form updates\n const { onChange, onBlur, value } = useInputValueDebounce({\n debounceDelay,\n onBlur: fieldOnBlur,\n onChange: fieldOnChange,\n value: fieldValue,\n });\n\n // classNames from slots\n const variants = textAreaVariants();\n const classNames = variantsToClassNames(variants, _className, 'base');\n\n return (\n <HeroTextArea\n ref={ref}\n data-testid={testId}\n errorMessage={errorMessage}\n id={testId}\n isDisabled={disabled}\n isInvalid={invalid}\n isRequired={required}\n label={label}\n labelPlacement=\"outside\"\n name={name}\n onBlur={onBlur}\n onChange={onChange}\n placeholder={placeholder}\n value={value}\n variant=\"bordered\"\n // Only add aria-label if there's no meaningful placeholder (HeroUI uses placeholder as aria-label)\n aria-label={\n !placeholder || placeholder.trim() === '' ? ariaLabel : undefined\n }\n classNames={{\n base: classNames.base,\n clearButton: classNames.clearButton,\n // set padding to 0 for error message exit animation\n helperWrapper: 'p-0',\n input: classNames.input,\n inputWrapper: classNames.inputWrapper,\n }}\n >\n {children}\n </HeroTextArea>\n );\n};\n\nexport default TextArea;\n","import TextArea from './TextArea';\n\nexport type { TextAreaProps } from './TextArea';\n\nexport { TextArea };\n\nexport default TextArea;\n"],"mappings":";;;;;;;AAWA,MAAa,mBAAmB,GAAG,EACjC,OAAO;CAEL,MAAM;CAEN,aAAa;CAEb,OAAO;CAEP,cAAc;CACf,EACF,CAAC;;;;AA6BF,MAAM,YAAY,EAChB,WAAW,MACX,WAAW,aAAa,QACxB,gBAAgB,KAChB,MACA,cAAc,KACd,GAAG,wBACgB;CACnB,MAAM,EACJ,WACA,UACA,cACA,OAAO,EACL,UAAU,eACV,QAAQ,aACR,OAAO,YACP,OAEF,SACA,OACA,UACA,WACE,gBAAgB;EAAE;EAAM,GAAG;EAAmB,CAAC;CAGnD,MAAM,EAAE,UAAU,QAAQ,UAAU,sBAAsB;EACxD;EACA,QAAQ;EACR,UAAU;EACV,OAAO;EACR,CAAC;CAIF,MAAM,aAAa,qBADF,kBAAkB,EACe,YAAY,OAAO;AAErE,QACE,oBAACA;EACM;EACL,eAAa;EACC;EACd,IAAI;EACJ,YAAY;EACZ,WAAW;EACX,YAAY;EACL;EACP,gBAAe;EACT;EACE;EACE;EACG;EACN;EACP,SAAQ;EAER,cACE,CAAC,eAAe,YAAY,MAAM,KAAK,KAAK,YAAY;EAE1D,YAAY;GACV,MAAM,WAAW;GACjB,aAAa,WAAW;GAExB,eAAe;GACf,OAAO,WAAW;GAClB,cAAc,WAAW;GAC1B;EAEA;GACY;;AAInB,yBAAe;;;;ACpHf,uBAAeC"}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
const require_FormContext = require('./FormContext-
|
|
2
|
-
const require_useUniformField = require('./useUniformField-
|
|
3
|
-
const require_useInputValueDebounce = require('./useInputValueDebounce-
|
|
4
|
-
let
|
|
1
|
+
const require_FormContext = require('./FormContext-Bb6d8hdG.cjs');
|
|
2
|
+
const require_useUniformField = require('./useUniformField-Bj23Kvbs.cjs');
|
|
3
|
+
const require_useInputValueDebounce = require('./useInputValueDebounce-BcUyaS94.cjs');
|
|
4
|
+
let _fuf_stack_pixel_utils = require("@fuf-stack/pixel-utils");
|
|
5
5
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
|
-
let
|
|
6
|
+
let _heroui_input = require("@heroui/input");
|
|
7
7
|
|
|
8
8
|
//#region src/TextArea/TextArea.tsx
|
|
9
|
-
const textAreaVariants = (0,
|
|
9
|
+
const textAreaVariants = (0, _fuf_stack_pixel_utils.tv)({ slots: {
|
|
10
10
|
base: "",
|
|
11
11
|
clearButton: "",
|
|
12
12
|
input: "",
|
|
@@ -26,8 +26,8 @@ const TextArea = ({ children = null, className: _className = void 0, debounceDel
|
|
|
26
26
|
onChange: fieldOnChange,
|
|
27
27
|
value: fieldValue
|
|
28
28
|
});
|
|
29
|
-
const classNames = (0,
|
|
30
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
29
|
+
const classNames = (0, _fuf_stack_pixel_utils.variantsToClassNames)(textAreaVariants(), _className, "base");
|
|
30
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_heroui_input.Textarea, {
|
|
31
31
|
ref,
|
|
32
32
|
"data-testid": testId,
|
|
33
33
|
errorMessage,
|
|
@@ -54,23 +54,23 @@ const TextArea = ({ children = null, className: _className = void 0, debounceDel
|
|
|
54
54
|
children
|
|
55
55
|
});
|
|
56
56
|
};
|
|
57
|
-
var TextArea_default = TextArea;
|
|
57
|
+
var TextArea_default$1 = TextArea;
|
|
58
58
|
|
|
59
59
|
//#endregion
|
|
60
60
|
//#region src/TextArea/index.ts
|
|
61
|
-
var TextArea_default
|
|
61
|
+
var TextArea_default = TextArea_default$1;
|
|
62
62
|
|
|
63
63
|
//#endregion
|
|
64
64
|
Object.defineProperty(exports, 'TextArea_default', {
|
|
65
65
|
enumerable: true,
|
|
66
66
|
get: function () {
|
|
67
|
-
return TextArea_default
|
|
67
|
+
return TextArea_default;
|
|
68
68
|
}
|
|
69
69
|
});
|
|
70
70
|
Object.defineProperty(exports, 'TextArea_default$1', {
|
|
71
71
|
enumerable: true,
|
|
72
72
|
get: function () {
|
|
73
|
-
return TextArea_default;
|
|
73
|
+
return TextArea_default$1;
|
|
74
74
|
}
|
|
75
75
|
});
|
|
76
|
-
//# sourceMappingURL=TextArea-
|
|
76
|
+
//# sourceMappingURL=TextArea-PtdSABZS.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextArea-
|
|
1
|
+
{"version":3,"file":"TextArea-PtdSABZS.cjs","names":["useUniformField","useInputValueDebounce","HeroTextArea","TextArea"],"sources":["../src/TextArea/TextArea.tsx","../src/TextArea/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { ReactNode } from 'react';\n\nimport { Textarea as HeroTextArea } from '@heroui/input';\n\nimport { tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useInputValueDebounce } from '../hooks/useInputValueDebounce';\nimport { useUniformField } from '../hooks/useUniformField';\n\n// input variants\nexport const textAreaVariants = tv({\n slots: {\n /** wrapper around the whole input */\n base: '',\n /** clear button */\n clearButton: '',\n /** actual input element */\n input: '',\n /** inner wrapper (HeroUI inputWrapper slot) */\n inputWrapper: 'bg-content1 group-data-[focus=true]:border-focus',\n },\n});\n\ntype VariantProps = TVProps<typeof textAreaVariants>;\ntype ClassName = TVClassName<typeof textAreaVariants>;\n\nexport interface TextAreaProps extends VariantProps {\n /** Custom aria-label for accessibility. If not provided, falls back to field name when no visible label exists */\n ariaLabel?: string;\n /** Child components. The content of the textarea. */\n children?: ReactNode;\n /** CSS class name */\n className?: ClassName;\n /** debounce delay in milliseconds for form state updates (default: 300ms) */\n debounceDelay?: number;\n /** Determines if the TextArea is disabled or not. */\n disabled?: boolean;\n /** Label displayed above the TextArea. */\n label?: ReactNode;\n /** Name the TextArea is registered at in HTML forms (react-hook-form). */\n name: string;\n /** placeholder for the textArea content. */\n placeholder?: string;\n /** Id to grab element in internal tests. */\n testId?: string;\n}\n\n/**\n * TextArea component based on [HeroUI TextArea](https://www.heroui.com//docs/components/textarea)\n */\nconst TextArea = ({\n children = null,\n className: _className = undefined,\n debounceDelay = 300,\n name,\n placeholder = ' ',\n ...uniformFieldProps\n}: TextAreaProps) => {\n const {\n ariaLabel,\n disabled,\n errorMessage,\n field: {\n onChange: fieldOnChange,\n onBlur: fieldOnBlur,\n value: fieldValue,\n ref,\n },\n invalid,\n label,\n required,\n testId,\n } = useUniformField({ name, ...uniformFieldProps });\n\n // Use debounced handlers for form updates\n const { onChange, onBlur, value } = useInputValueDebounce({\n debounceDelay,\n onBlur: fieldOnBlur,\n onChange: fieldOnChange,\n value: fieldValue,\n });\n\n // classNames from slots\n const variants = textAreaVariants();\n const classNames = variantsToClassNames(variants, _className, 'base');\n\n return (\n <HeroTextArea\n ref={ref}\n data-testid={testId}\n errorMessage={errorMessage}\n id={testId}\n isDisabled={disabled}\n isInvalid={invalid}\n isRequired={required}\n label={label}\n labelPlacement=\"outside\"\n name={name}\n onBlur={onBlur}\n onChange={onChange}\n placeholder={placeholder}\n value={value}\n variant=\"bordered\"\n // Only add aria-label if there's no meaningful placeholder (HeroUI uses placeholder as aria-label)\n aria-label={\n !placeholder || placeholder.trim() === '' ? ariaLabel : undefined\n }\n classNames={{\n base: classNames.base,\n clearButton: classNames.clearButton,\n // set padding to 0 for error message exit animation\n helperWrapper: 'p-0',\n input: classNames.input,\n inputWrapper: classNames.inputWrapper,\n }}\n >\n {children}\n </HeroTextArea>\n );\n};\n\nexport default TextArea;\n","import TextArea from './TextArea';\n\nexport type { TextAreaProps } from './TextArea';\n\nexport { TextArea };\n\nexport default TextArea;\n"],"mappings":";;;;;;;;AAWA,MAAa,kDAAsB,EACjC,OAAO;CAEL,MAAM;CAEN,aAAa;CAEb,OAAO;CAEP,cAAc;CACf,EACF,CAAC;;;;AA6BF,MAAM,YAAY,EAChB,WAAW,MACX,WAAW,aAAa,QACxB,gBAAgB,KAChB,MACA,cAAc,KACd,GAAG,wBACgB;CACnB,MAAM,EACJ,WACA,UACA,cACA,OAAO,EACL,UAAU,eACV,QAAQ,aACR,OAAO,YACP,OAEF,SACA,OACA,UACA,WACEA,wCAAgB;EAAE;EAAM,GAAG;EAAmB,CAAC;CAGnD,MAAM,EAAE,UAAU,QAAQ,UAAUC,oDAAsB;EACxD;EACA,QAAQ;EACR,UAAU;EACV,OAAO;EACR,CAAC;CAIF,MAAM,8DADW,kBAAkB,EACe,YAAY,OAAO;AAErE,QACE,2CAACC;EACM;EACL,eAAa;EACC;EACd,IAAI;EACJ,YAAY;EACZ,WAAW;EACX,YAAY;EACL;EACP,gBAAe;EACT;EACE;EACE;EACG;EACN;EACP,SAAQ;EAER,cACE,CAAC,eAAe,YAAY,MAAM,KAAK,KAAK,YAAY;EAE1D,YAAY;GACV,MAAM,WAAW;GACjB,aAAa,WAAW;GAExB,eAAe;GACf,OAAO,WAAW;GAClB,cAAc,WAAW;GAC1B;EAEA;GACY;;AAInB,yBAAe;;;;ACpHf,uBAAeC"}
|
package/dist/helpers/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers-B-CJOBt3.js","names":["cleanName: string"],"sources":["../src/helpers/nullishFields/nullishFields.ts"],"sourcesContent":["import { slugify } from '@fuf-stack/pixel-utils';\n\n/** Key used to wrap flat array elements when converting to form format */\nexport const flatArrayKey = '__FLAT__';\n\n/**\n * String markers used to preserve null, false, and 0 values during JSON processing\n */\nconst nullString = '__NULL__';\nconst falseString = '__FALSE__';\nconst zeroString = '__ZERO__';\n\n/**\n * Converts marker strings back to their original values when processing arrays\n */\nexport const fromNullishString = (value: unknown): unknown => {\n // Support arrays: unwrap flat wrappers and convert marker strings per entry\n if (Array.isArray(value)) {\n return (value as unknown[]).map((entry) => {\n if (entry && typeof entry === 'object') {\n const record = entry as Record<string, unknown>;\n if (flatArrayKey in record) {\n const inner = record[flatArrayKey];\n // For arrays, treat empty string as null (placeholder input)\n if (inner === '') {\n return null;\n }\n return fromNullishString(inner);\n }\n }\n return fromNullishString(entry);\n });\n }\n\n if (typeof value !== 'string') {\n return value;\n }\n\n switch (value) {\n case nullString:\n return null;\n case falseString:\n return false;\n case zeroString:\n return 0;\n default:\n return value;\n }\n};\n\n/**\n * Converts null/falsy values to marker strings for JSON processing\n */\nexport const toNullishString = (value: unknown): unknown => {\n if (Array.isArray(value)) {\n // Only wrap arrays of primitives; leave arrays of objects as-is\n const isPrimitive = (v: unknown) => {\n return v === null || ['string', 'number', 'boolean'].includes(typeof v);\n };\n const isPrimitiveArray = (value as unknown[]).every(isPrimitive);\n if (isPrimitiveArray) {\n return (value as unknown[]).map((v) => {\n // Store raw primitive; do not convert to marker strings inside the wrapper\n return { [flatArrayKey]: v } as Record<string, unknown>;\n });\n }\n return value;\n }\n if (value === null || value === '') {\n return nullString;\n }\n if (value === false) {\n return falseString;\n }\n if (value === 0) {\n return zeroString;\n }\n return value;\n};\n\n/**\n * Converts field values to a format suitable for forms by:\n * - Wrapping arrays of primitives as objects using the flatArrayKey `__FLAT__`\n * to satisfy RHF's requirement that array fields contain objects\n * - Removing empty strings and null values from objects\n *\n * This conversion is required because React Hook Form does not support arrays with\n * flat values (string, number, boolean, null). Array fields must contain objects.\n * We work around this by wrapping primitive entries: `{ __FLAT__: <value> }`.\n *\n * @example\n * const fields = {\n * name: 'John',\n * scores: [0, null, 75, false],\n * scoresDetailed: [\n * { score: 1 },\n * { score: null },\n * { score: 0 },\n * { score: false },\n * { score: '' },\n * ],\n * contact: {\n * email: '',\n * phone: null,\n * address: '123 Main St'\n * }\n * };\n *\n * // Result:\n * {\n * name: 'John',\n * scores: [\n * { __FLAT__: 0 },\n * { __FLAT__: null },\n * { __FLAT__: 75 },\n * { __FLAT__: false }\n * ],\n * // Arrays of objects are left as objects; empty/null properties are removed\n * scoresDetailed: [\n * { score: 1 },\n * {}, // null score removed\n * { score: 0 },\n * { score: false },\n * {}, // empty string removed\n * ],\n * contact: {\n * address: '123 Main St'\n * }\n * }\n */\nexport const toFormFormat = (fields: Record<string, unknown>) => {\n const formFormatJson = JSON.stringify(fields, (_, value) => {\n if (Array.isArray(value)) {\n // Delegate to toNullishString to ensure consistent handling\n return toNullishString(value);\n }\n\n if (value && typeof value === 'object') {\n // Preserve flat-array wrappers as-is (do not filter their inner values here)\n const record = value as Record<string, unknown>;\n if (flatArrayKey in record) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return value;\n }\n return Object.fromEntries(\n Object.entries(value).filter(([_key, v]) => {\n return v !== '' && v !== null;\n }),\n );\n }\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return value;\n });\n\n return JSON.parse(formFormatJson) as Record<string, unknown>;\n};\n\n/**\n * Converts form state to a format suitable for validation by:\n * - Unwrapping flat array wrappers `{ __FLAT__: <value> }` back to primitives\n * - Converting legacy string markers (__NULL__, __FALSE__, __ZERO__) back to their original values\n * - Removing fields whose converted value is empty string or null\n * - Removing empty arrays\n *\n * @example\n * const formState = {\n * name: 'John',\n * scores: [\n * { __FLAT__: 75 },\n * { __FLAT__: 0 },\n * { __FLAT__: null },\n * { __FLAT__: false }\n * ],\n * emptyArray: [],\n * scoresDetailed: [\n * { score: 1 },\n * {},\n * { score: 0 },\n * { score: false },\n * {},\n * ],\n * contact: {\n * address: '123 Main St',\n * fax: null\n * }\n * };\n *\n * // Result:\n * {\n * name: 'John',\n * scores: [75, 0, null, false],\n * // emptyArray is removed\n * // Objects inside arrays remain objects; empty entries remain empty objects\n * scoresDetailed: [\n * { score: 1 },\n * {},\n * { score: 0 },\n * { score: false },\n * {},\n * ],\n * contact: {\n * address: '123 Main St'\n * }\n * }\n */\nexport const toValidationFormat = (\n formState: Record<string, unknown> | null | undefined,\n): Record<string, unknown> | null | undefined => {\n // Handle null or undefined input\n if (formState === undefined || formState === null) {\n return formState;\n }\n\n const validationFormatJson = JSON.stringify(formState, (_, value) => {\n if (Array.isArray(value)) {\n return value.map((v) => {\n // Unwrap new wrapper format { __FLAT__: <value> }\n if (v && typeof v === 'object') {\n const record = v as Record<string, unknown>;\n if (flatArrayKey in record) {\n const inner = record[flatArrayKey];\n // Treat empty string from forms as null in validation format\n if (inner === '') {\n return null;\n }\n return fromNullishString(inner);\n }\n }\n // Backward compatibility for string markers\n return fromNullishString(v);\n });\n }\n\n if (value && typeof value === 'object') {\n // Object branch: remove keys that resolve to empty/null after marker conversion\n // and unwrap flat-array wrappers if present.\n //\n // Why this shape?\n // - Forms may contain objects with placeholder/empty values that should not\n // be part of the validation payload (e.g. \"\" or __NULL__ markers).\n // - Arrays of primitives are stored as wrapper objects { __FLAT__: <value> }\n // to satisfy RHF structure constraints. When converting back for\n // validation, we need to treat wrappers whose inner value resolves to\n // empty/null as removable, and unwrap non-empty wrappers to the primitive.\n return Object.fromEntries(\n Object.entries(value)\n .filter(([_key, v]) => {\n // If this is a flat-array wrapper, convert the inner value first and\n // drop the key when the inner resolves to empty string or null.\n if (v && typeof v === 'object') {\n const record = v as Record<string, unknown>;\n if (flatArrayKey in record) {\n const convertedInner = fromNullishString(record[flatArrayKey]);\n return convertedInner !== '' && convertedInner !== null;\n }\n }\n // Drop empty arrays\n if (Array.isArray(v) && v.length === 0) {\n return false;\n }\n // For regular values, convert markers and drop when empty/null.\n const converted = fromNullishString(v);\n return converted !== '' && converted !== null;\n })\n .map(([k, v]) => {\n // Unwrap flat-array wrappers to raw primitives after conversion.\n if (v && typeof v === 'object') {\n const record = v as Record<string, unknown>;\n if (flatArrayKey in record) {\n return [k, fromNullishString(record[flatArrayKey])];\n }\n }\n // For other values, just convert markers.\n return [k, fromNullishString(v)];\n }),\n );\n }\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return value;\n });\n\n return JSON.parse(validationFormatJson) as Record<string, unknown>;\n};\n\n/**\n * Converts a field name to a testId by removing flat array key segments and slugifying.\n * Removes all occurrences of `flatArrayKey` from the field name and applies slugify transformation.\n *\n * This is used to generate stable testIds for form fields that don't include\n * the internal `__FLAT__` marker used for flat arrays.\n *\n * @param name - The field name as a string (e.g., 'tags.0.__FLAT__') or array path (e.g., ['tags', '0', '__FLAT__'])\n * @returns The slugified field name with all flat array key segments removed (e.g., 'tags_0')\n *\n * @example\n * ```ts\n * nameToTestId('tags.0.__FLAT__') // => 'tags_0'\n * nameToTestId('array.0.__FLAT__') // => 'array_0'\n * nameToTestId('nested.array.0.__FLAT__.field') // => 'nested_array_0_field'\n * nameToTestId('simple.field') // => 'simple_field'\n * nameToTestId(['tags', '0', '__FLAT__']) // => 'tags_0'\n * ```\n */\nexport const nameToTestId = (name: string | readonly string[]): string => {\n let cleanName: string;\n\n // Handle array paths - filter out flatArrayKey and join with dots\n if (Array.isArray(name)) {\n cleanName = name\n .filter((segment: string) => {\n return segment !== flatArrayKey;\n })\n .join('.');\n } else {\n // Handle string paths - split by dots and filter out flatArrayKey segments\n const segments = (name as string).split('.');\n cleanName = segments\n .filter((segment: string) => {\n return segment !== flatArrayKey;\n })\n .join('.');\n }\n\n // Apply slugify transformation\n return slugify(cleanName, { replaceDots: true });\n};\n"],"mappings":";;;;AAGA,MAAa,eAAe;;;;AAK5B,MAAM,aAAa;AACnB,MAAM,cAAc;AACpB,MAAM,aAAa;;;;AAKnB,MAAa,qBAAqB,UAA4B;AAE5D,KAAI,MAAM,QAAQ,MAAM,CACtB,QAAQ,MAAoB,KAAK,UAAU;AACzC,MAAI,SAAS,OAAO,UAAU,UAAU;GACtC,MAAM,SA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SAAO,YAAY;GACnB,CACD,KAAK,IAAI;AAId,QAAO,QAAQ,WAAW,EAAE,aAAa,MAAM,CAAC"}
|
|
1
|
+
{"version":3,"file":"helpers-B-CJOBt3.js","names":[],"sources":["../src/helpers/nullishFields/nullishFields.ts"],"sourcesContent":["import { slugify } from '@fuf-stack/pixel-utils';\n\n/** Key used to wrap flat array elements when converting to form format */\nexport const flatArrayKey = '__FLAT__';\n\n/**\n * String markers used to preserve null, false, and 0 values during JSON processing\n */\nconst nullString = '__NULL__';\nconst falseString = '__FALSE__';\nconst zeroString = '__ZERO__';\n\n/**\n * Converts marker strings back to their original values when processing arrays\n */\nexport const fromNullishString = (value: unknown): unknown => {\n // Support arrays: unwrap flat wrappers and convert marker strings per entry\n if (Array.isArray(value)) {\n return (value as unknown[]).map((entry) => {\n if (entry && typeof entry === 'object') {\n const record = entry as Record<string, unknown>;\n if (flatArrayKey in record) {\n const inner = record[flatArrayKey];\n // For arrays, treat empty string as null (placeholder input)\n if (inner === '') {\n return null;\n }\n return fromNullishString(inner);\n }\n }\n return fromNullishString(entry);\n });\n }\n\n if (typeof value !== 'string') {\n return value;\n }\n\n switch (value) {\n case nullString:\n return null;\n case falseString:\n return false;\n case zeroString:\n return 0;\n default:\n return value;\n }\n};\n\n/**\n * Converts null/falsy values to marker strings for JSON processing\n */\nexport const toNullishString = (value: unknown): unknown => {\n if (Array.isArray(value)) {\n // Only wrap arrays of primitives; leave arrays of objects as-is\n const isPrimitive = (v: unknown) => {\n return v === null || ['string', 'number', 'boolean'].includes(typeof v);\n };\n const isPrimitiveArray = (value as unknown[]).every(isPrimitive);\n if (isPrimitiveArray) {\n return (value as unknown[]).map((v) => {\n // Store raw primitive; do not convert to marker strings inside the wrapper\n return { [flatArrayKey]: v } as Record<string, unknown>;\n });\n }\n return value;\n }\n if (value === null || value === '') {\n return nullString;\n }\n if (value === false) {\n return falseString;\n }\n if (value === 0) {\n return zeroString;\n }\n return value;\n};\n\n/**\n * Converts field values to a format suitable for forms by:\n * - Wrapping arrays of primitives as objects using the flatArrayKey `__FLAT__`\n * to satisfy RHF's requirement that array fields contain objects\n * - Removing empty strings and null values from objects\n *\n * This conversion is required because React Hook Form does not support arrays with\n * flat values (string, number, boolean, null). Array fields must contain objects.\n * We work around this by wrapping primitive entries: `{ __FLAT__: <value> }`.\n *\n * @example\n * const fields = {\n * name: 'John',\n * scores: [0, null, 75, false],\n * scoresDetailed: [\n * { score: 1 },\n * { score: null },\n * { score: 0 },\n * { score: false },\n * { score: '' },\n * ],\n * contact: {\n * email: '',\n * phone: null,\n * address: '123 Main St'\n * }\n * };\n *\n * // Result:\n * {\n * name: 'John',\n * scores: [\n * { __FLAT__: 0 },\n * { __FLAT__: null },\n * { __FLAT__: 75 },\n * { __FLAT__: false }\n * ],\n * // Arrays of objects are left as objects; empty/null properties are removed\n * scoresDetailed: [\n * { score: 1 },\n * {}, // null score removed\n * { score: 0 },\n * { score: false },\n * {}, // empty string removed\n * ],\n * contact: {\n * address: '123 Main St'\n * }\n * }\n */\nexport const toFormFormat = (fields: Record<string, unknown>) => {\n const formFormatJson = JSON.stringify(fields, (_, value) => {\n if (Array.isArray(value)) {\n // Delegate to toNullishString to ensure consistent handling\n return toNullishString(value);\n }\n\n if (value && typeof value === 'object') {\n // Preserve flat-array wrappers as-is (do not filter their inner values here)\n const record = value as Record<string, unknown>;\n if (flatArrayKey in record) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return value;\n }\n return Object.fromEntries(\n Object.entries(value).filter(([_key, v]) => {\n return v !== '' && v !== null;\n }),\n );\n }\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return value;\n });\n\n return JSON.parse(formFormatJson) as Record<string, unknown>;\n};\n\n/**\n * Converts form state to a format suitable for validation by:\n * - Unwrapping flat array wrappers `{ __FLAT__: <value> }` back to primitives\n * - Converting legacy string markers (__NULL__, __FALSE__, __ZERO__) back to their original values\n * - Removing fields whose converted value is empty string or null\n * - Removing empty arrays\n *\n * @example\n * const formState = {\n * name: 'John',\n * scores: [\n * { __FLAT__: 75 },\n * { __FLAT__: 0 },\n * { __FLAT__: null },\n * { __FLAT__: false }\n * ],\n * emptyArray: [],\n * scoresDetailed: [\n * { score: 1 },\n * {},\n * { score: 0 },\n * { score: false },\n * {},\n * ],\n * contact: {\n * address: '123 Main St',\n * fax: null\n * }\n * };\n *\n * // Result:\n * {\n * name: 'John',\n * scores: [75, 0, null, false],\n * // emptyArray is removed\n * // Objects inside arrays remain objects; empty entries remain empty objects\n * scoresDetailed: [\n * { score: 1 },\n * {},\n * { score: 0 },\n * { score: false },\n * {},\n * ],\n * contact: {\n * address: '123 Main St'\n * }\n * }\n */\nexport const toValidationFormat = (\n formState: Record<string, unknown> | null | undefined,\n): Record<string, unknown> | null | undefined => {\n // Handle null or undefined input\n if (formState === undefined || formState === null) {\n return formState;\n }\n\n const validationFormatJson = JSON.stringify(formState, (_, value) => {\n if (Array.isArray(value)) {\n return value.map((v) => {\n // Unwrap new wrapper format { __FLAT__: <value> }\n if (v && typeof v === 'object') {\n const record = v as Record<string, unknown>;\n if (flatArrayKey in record) {\n const inner = record[flatArrayKey];\n // Treat empty string from forms as null in validation format\n if (inner === '') {\n return null;\n }\n return fromNullishString(inner);\n }\n }\n // Backward compatibility for string markers\n return fromNullishString(v);\n });\n }\n\n if (value && typeof value === 'object') {\n // Object branch: remove keys that resolve to empty/null after marker conversion\n // and unwrap flat-array wrappers if present.\n //\n // Why this shape?\n // - Forms may contain objects with placeholder/empty values that should not\n // be part of the validation payload (e.g. \"\" or __NULL__ markers).\n // - Arrays of primitives are stored as wrapper objects { __FLAT__: <value> }\n // to satisfy RHF structure constraints. When converting back for\n // validation, we need to treat wrappers whose inner value resolves to\n // empty/null as removable, and unwrap non-empty wrappers to the primitive.\n return Object.fromEntries(\n Object.entries(value)\n .filter(([_key, v]) => {\n // If this is a flat-array wrapper, convert the inner value first and\n // drop the key when the inner resolves to empty string or null.\n if (v && typeof v === 'object') {\n const record = v as Record<string, unknown>;\n if (flatArrayKey in record) {\n const convertedInner = fromNullishString(record[flatArrayKey]);\n return convertedInner !== '' && convertedInner !== null;\n }\n }\n // Drop empty arrays\n if (Array.isArray(v) && v.length === 0) {\n return false;\n }\n // For regular values, convert markers and drop when empty/null.\n const converted = fromNullishString(v);\n return converted !== '' && converted !== null;\n })\n .map(([k, v]) => {\n // Unwrap flat-array wrappers to raw primitives after conversion.\n if (v && typeof v === 'object') {\n const record = v as Record<string, unknown>;\n if (flatArrayKey in record) {\n return [k, fromNullishString(record[flatArrayKey])];\n }\n }\n // For other values, just convert markers.\n return [k, fromNullishString(v)];\n }),\n );\n }\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return value;\n });\n\n return JSON.parse(validationFormatJson) as Record<string, unknown>;\n};\n\n/**\n * Converts a field name to a testId by removing flat array key segments and slugifying.\n * Removes all occurrences of `flatArrayKey` from the field name and applies slugify transformation.\n *\n * This is used to generate stable testIds for form fields that don't include\n * the internal `__FLAT__` marker used for flat arrays.\n *\n * @param name - The field name as a string (e.g., 'tags.0.__FLAT__') or array path (e.g., ['tags', '0', '__FLAT__'])\n * @returns The slugified field name with all flat array key segments removed (e.g., 'tags_0')\n *\n * @example\n * ```ts\n * nameToTestId('tags.0.__FLAT__') // => 'tags_0'\n * nameToTestId('array.0.__FLAT__') // => 'array_0'\n * nameToTestId('nested.array.0.__FLAT__.field') // => 'nested_array_0_field'\n * nameToTestId('simple.field') // => 'simple_field'\n * nameToTestId(['tags', '0', '__FLAT__']) // => 'tags_0'\n * ```\n */\nexport const nameToTestId = (name: string | readonly string[]): string => {\n let cleanName: string;\n\n // Handle array paths - filter out flatArrayKey and join with dots\n if (Array.isArray(name)) {\n cleanName = name\n .filter((segment: string) => {\n return segment !== flatArrayKey;\n })\n .join('.');\n } else {\n // Handle string paths - split by dots and filter out flatArrayKey segments\n const segments = (name as string).split('.');\n cleanName = segments\n .filter((segment: string) => {\n return segment !== flatArrayKey;\n })\n .join('.');\n }\n\n // Apply slugify transform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ACP;AAEF,QAAO,KAAK,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;AAsBzC,MAAa,gBAAgB,SAA6C;CACxE,IAAI;AAGJ,KAAI,MAAM,QAAQ,KAAK,CACrB,aAAY,KACT,QAAQ,YAAoB;AAC3B,SAAO,YAAY;GACnB,CACD,KAAK,IAAI;KAIZ,aADkB,KAAgB,MAAM,IAAI,CAEzC,QAAQ,YAAoB;AAC3B,SAAO,YAAY;GACnB,CACD,KAAK,IAAI;AAId,QAAO,QAAQ,WAAW,EAAE,aAAa,MAAM,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_FormContext = require('./FormContext-
|
|
2
|
-
let
|
|
1
|
+
const require_FormContext = require('./FormContext-Bb6d8hdG.cjs');
|
|
2
|
+
let _fuf_stack_pixel_utils = require("@fuf-stack/pixel-utils");
|
|
3
3
|
|
|
4
4
|
//#region src/helpers/nullishFields/nullishFields.ts
|
|
5
5
|
/** Key used to wrap flat array elements when converting to form format */
|
|
@@ -229,7 +229,7 @@ const nameToTestId = (name) => {
|
|
|
229
229
|
else cleanName = name.split(".").filter((segment) => {
|
|
230
230
|
return segment !== flatArrayKey;
|
|
231
231
|
}).join(".");
|
|
232
|
-
return (0,
|
|
232
|
+
return (0, _fuf_stack_pixel_utils.slugify)(cleanName, { replaceDots: true });
|
|
233
233
|
};
|
|
234
234
|
|
|
235
235
|
//#endregion
|
|
@@ -269,4 +269,4 @@ Object.defineProperty(exports, 'toValidationFormat', {
|
|
|
269
269
|
return toValidationFormat;
|
|
270
270
|
}
|
|
271
271
|
});
|
|
272
|
-
//# sourceMappingURL=helpers-
|
|
272
|
+
//# sourceMappingURL=helpers-B84E9vHd.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helpers-B84E9vHd.cjs","names":[],"sources":["../src/helpers/nullishFields/nullishFields.ts"],"sourcesContent":["import { slugify } from '@fuf-stack/pixel-utils';\n\n/** Key used to wrap flat array elements when converting to form format */\nexport const flatArrayKey = '__FLAT__';\n\n/**\n * String markers used to preserve null, false, and 0 values during JSON processing\n */\nconst nullString = '__NULL__';\nconst falseString = '__FALSE__';\nconst zeroString = '__ZERO__';\n\n/**\n * Converts marker strings back to their original values when processing arrays\n */\nexport const fromNullishString = (value: unknown): unknown => {\n // Support arrays: unwrap flat wrappers and convert marker strings per entry\n if (Array.isArray(value)) {\n return (value as unknown[]).map((entry) => {\n if (entry && typeof entry === 'object') {\n const record = entry as Record<string, unknown>;\n if (flatArrayKey in record) {\n const inner = record[flatArrayKey];\n // For arrays, treat empty string as null (placeholder input)\n if (inner === '') {\n return null;\n }\n return fromNullishString(inner);\n }\n }\n return fromNullishString(entry);\n });\n }\n\n if (typeof value !== 'string') {\n return value;\n }\n\n switch (value) {\n case nullString:\n return null;\n case falseString:\n return false;\n case zeroString:\n return 0;\n default:\n return value;\n }\n};\n\n/**\n * Converts null/falsy values to marker strings for JSON processing\n */\nexport const toNullishString = (value: unknown): unknown => {\n if (Array.isArray(value)) {\n // Only wrap arrays of primitives; leave arrays of objects as-is\n const isPrimitive = (v: unknown) => {\n return v === null || ['string', 'number', 'boolean'].includes(typeof v);\n };\n const isPrimitiveArray = (value as unknown[]).every(isPrimitive);\n if (isPrimitiveArray) {\n return (value as unknown[]).map((v) => {\n // Store raw primitive; do not convert to marker strings inside the wrapper\n return { [flatArrayKey]: v } as Record<string, unknown>;\n });\n }\n return value;\n }\n if (value === null || value === '') {\n return nullString;\n }\n if (value === false) {\n return falseString;\n }\n if (value === 0) {\n return zeroString;\n }\n return value;\n};\n\n/**\n * Converts field values to a format suitable for forms by:\n * - Wrapping arrays of primitives as objects using the flatArrayKey `__FLAT__`\n * to satisfy RHF's requirement that array fields contain objects\n * - Removing empty strings and null values from objects\n *\n * This conversion is required because React Hook Form does not support arrays with\n * flat values (string, number, boolean, null). Array fields must contain objects.\n * We work around this by wrapping primitive entries: `{ __FLAT__: <value> }`.\n *\n * @example\n * const fields = {\n * name: 'John',\n * scores: [0, null, 75, false],\n * scoresDetailed: [\n * { score: 1 },\n * { score: null },\n * { score: 0 },\n * { score: false },\n * { score: '' },\n * ],\n * contact: {\n * email: '',\n * phone: null,\n * address: '123 Main St'\n * }\n * };\n *\n * // Result:\n * {\n * name: 'John',\n * scores: [\n * { __FLAT__: 0 },\n * { __FLAT__: null },\n * { __FLAT__: 75 },\n * { __FLAT__: false }\n * ],\n * // Arrays of objects are left as objects; empty/null properties are removed\n * scoresDetailed: [\n * { score: 1 },\n * {}, // null score removed\n * { score: 0 },\n * { score: false },\n * {}, // empty string removed\n * ],\n * contact: {\n * address: '123 Main St'\n * }\n * }\n */\nexport const toFormFormat = (fields: Record<string, unknown>) => {\n const formFormatJson = JSON.stringify(fields, (_, value) => {\n if (Array.isArray(value)) {\n // Delegate to toNullishString to ensure consistent handling\n return toNullishString(value);\n }\n\n if (value && typeof value === 'object') {\n // Preserve flat-array wrappers as-is (do not filter their inner values here)\n const record = value as Record<string, unknown>;\n if (flatArrayKey in record) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return value;\n }\n return Object.fromEntries(\n Object.entries(value).filter(([_key, v]) => {\n return v !== '' && v !== null;\n }),\n );\n }\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return value;\n });\n\n return JSON.parse(formFormatJson) as Record<string, unknown>;\n};\n\n/**\n * Converts form state to a format suitable for validation by:\n * - Unwrapping flat array wrappers `{ __FLAT__: <value> }` back to primitives\n * - Converting legacy string markers (__NULL__, __FALSE__, __ZERO__) back to their original values\n * - Removing fields whose converted value is empty string or null\n * - Removing empty arrays\n *\n * @example\n * const formState = {\n * name: 'John',\n * scores: [\n * { __FLAT__: 75 },\n * { __FLAT__: 0 },\n * { __FLAT__: null },\n * { __FLAT__: false }\n * ],\n * emptyArray: [],\n * scoresDetailed: [\n * { score: 1 },\n * {},\n * { score: 0 },\n * { score: false },\n * {},\n * ],\n * contact: {\n * address: '123 Main St',\n * fax: null\n * }\n * };\n *\n * // Result:\n * {\n * name: 'John',\n * scores: [75, 0, null, false],\n * // emptyArray is removed\n * // Objects inside arrays remain objects; empty entries remain empty objects\n * scoresDetailed: [\n * { score: 1 },\n * {},\n * { score: 0 },\n * { score: false },\n * {},\n * ],\n * contact: {\n * address: '123 Main St'\n * }\n * }\n */\nexport const toValidationFormat = (\n formState: Record<string, unknown> | null | undefined,\n): Record<string, unknown> | null | undefined => {\n // Handle null or undefined input\n if (formState === undefined || formState === null) {\n return formState;\n }\n\n const validationFormatJson = JSON.stringify(formState, (_, value) => {\n if (Array.isArray(value)) {\n return value.map((v) => {\n // Unwrap new wrapper format { __FLAT__: <value> }\n if (v && typeof v === 'object') {\n const record = v as Record<string, unknown>;\n if (flatArrayKey in record) {\n const inner = record[flatArrayKey];\n // Treat empty string from forms as null in validation format\n if (inner === '') {\n return null;\n }\n return fromNullishString(inner);\n }\n }\n // Backward compatibility for string markers\n return fromNullishString(v);\n });\n }\n\n if (value && typeof value === 'object') {\n // Object branch: remove keys that resolve to empty/null after marker conversion\n // and unwrap flat-array wrappers if present.\n //\n // Why this shape?\n // - Forms may contain objects with placeholder/empty values that should not\n // be part of the validation payload (e.g. \"\" or __NULL__ markers).\n // - Arrays of primitives are stored as wrapper objects { __FLAT__: <value> }\n // to satisfy RHF structure constraints. When converting back for\n // validation, we need to treat wrappers whose inner value resolves to\n // empty/null as removable, and unwrap non-empty wrappers to the primitive.\n return Object.fromEntries(\n Object.entries(value)\n .filter(([_key, v]) => {\n // If this is a flat-array wrapper, convert the inner value first and\n // drop the key when the inner resolves to empty string or null.\n if (v && typeof v === 'object') {\n const record = v as Record<string, unknown>;\n if (flatArrayKey in record) {\n const convertedInner = fromNullishString(record[flatArrayKey]);\n return convertedInner !== '' && convertedInner !== null;\n }\n }\n // Drop empty arrays\n if (Array.isArray(v) && v.length === 0) {\n return false;\n }\n // For regular values, convert markers and drop when empty/null.\n const converted = fromNullishString(v);\n return converted !== '' && converted !== null;\n })\n .map(([k, v]) => {\n // Unwrap flat-array wrappers to raw primitives after conversion.\n if (v && typeof v === 'object') {\n const record = v as Record<string, unknown>;\n if (flatArrayKey in record) {\n return [k, fromNullishString(record[flatArrayKey])];\n }\n }\n // For other values, just convert markers.\n return [k, fromNullishString(v)];\n }),\n );\n }\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return value;\n });\n\n return JSON.parse(validationFormatJson) as Record<string, unknown>;\n};\n\n/**\n * Converts a field name to a testId by removing flat array key segments and slugifying.\n * Removes all occurrences of `flatArrayKey` from the field name and applies slugify transformation.\n *\n * This is used to generate stable testIds for form fields that don't include\n * the internal `__FLAT__` marker used for flat arrays.\n *\n * @param name - The field name as a string (e.g., 'tags.0.__FLAT__') or array path (e.g., ['tags', '0', '__FLAT__'])\n * @returns The slugified field name with all flat array key segments removed (e.g., 'tags_0')\n *\n * @example\n * ```ts\n * nameToTestId('tags.0.__FLAT__') // => 'tags_0'\n * nameToTestId('array.0.__FLAT__') // => 'array_0'\n * nameToTestId('nested.array.0.__FLAT__.field') // => 'nested_array_0_field'\n * nameToTestId('simple.field') // => 'simple_field'\n * nameToTestId(['tags', '0', '__FLAT__']) // => 'tags_0'\n * ```\n */\nexport const nameToTestId = (name: string | readonly string[]): string => {\n let cleanName: string;\n\n // Handle array paths - filter out flatArrayKey and join with dots\n if (Array.isArray(name)) {\n cleanName = name\n .filter((segment: string) => {\n return segment !== flatArrayKey;\n })\n .join('.');\n } else {\n // Handle string paths - split by dots and filter out flatArrayKey segments\n const segments = (name as string).split('.');\n cleanName = segments\n .filter((segment: string) => {\n return segment !== flatArrayKey;\n })\n .join('.');\n }\n\n // Apply slugify transformation\n return slugify(cleanName, { replaceDots: true });\n};\n"],"mappings":";;;;;AAGA,MAAa,eAAe;;;;AAK5B,MAAM,aAAa;AACnB,MAAM,cAAc;AACpB,MAAM,aAAa;;;;AAKnB,MAAa,qBAAqB,UAA4B;AAE5D,KAAI,MAAM,QAAQ,MAAM,CACtB,QAAQ,MAAoB,KAAK,UAAU;AACzC,MAA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AAM,IAAI,CAEzC,QAAQ,YAAoB;AAC3B,SAAO,YAAY;GACnB,CACD,KAAK,IAAI;AAId,4CAAe,WAAW,EAAE,aAAa,MAAM,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as useClientValidation, t as clientValidationSchemaByName } from "../../useClientValidation-
|
|
1
|
+
import { n as useClientValidation, t as clientValidationSchemaByName } from "../../useClientValidation-BQqwz628.cjs";
|
|
2
2
|
export { clientValidationSchemaByName, useClientValidation };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as useClientValidation, t as clientValidationSchemaByName } from "../../useClientValidation-
|
|
1
|
+
import { n as useClientValidation, t as clientValidationSchemaByName } from "../../useClientValidation-DJ4JuN_9.js";
|
|
2
2
|
export { clientValidationSchemaByName, useClientValidation };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_useFormContext = require('../../useFormContext-
|
|
1
|
+
const require_useFormContext = require('../../useFormContext-Bp0EODoO.cjs');
|
|
2
2
|
|
|
3
3
|
exports.checkFieldIsRequired = require_useFormContext.checkFieldIsRequired;
|
|
4
4
|
exports.useFormContext = require_useFormContext.useFormContext;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as useFormContext, t as checkFieldIsRequired } from "../../useFormContext-
|
|
1
|
+
import { n as useFormContext, t as checkFieldIsRequired } from "../../useFormContext-B083Y-kw.cjs";
|
|
2
2
|
export { checkFieldIsRequired, useFormContext };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "../../FormContext-C2_WMi_v.js";
|
|
2
|
-
import { n as useFormContext, t as checkFieldIsRequired } from "../../useFormContext-
|
|
3
|
-
import "../../index-
|
|
2
|
+
import { n as useFormContext, t as checkFieldIsRequired } from "../../useFormContext-B2TS6xq0.js";
|
|
3
|
+
import "../../index-BRLjimYW.js";
|
|
4
4
|
export { checkFieldIsRequired, useFormContext };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const require_FormContext = require('../../FormContext-
|
|
2
|
-
let
|
|
1
|
+
const require_FormContext = require('../../FormContext-Bb6d8hdG.cjs');
|
|
2
|
+
let _heroui_input = require("@heroui/input");
|
|
3
3
|
|
|
4
4
|
//#region src/hooks/useInput/index.ts
|
|
5
5
|
/* v8 ignore stop */
|
|
@@ -8,7 +8,7 @@ let __heroui_input = require("@heroui/input");
|
|
|
8
8
|
Object.defineProperty(exports, 'useInput', {
|
|
9
9
|
enumerable: true,
|
|
10
10
|
get: function () {
|
|
11
|
-
return
|
|
11
|
+
return _heroui_input.useInput;
|
|
12
12
|
}
|
|
13
13
|
});
|
|
14
14
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as useInput } from "../../useInput
|
|
1
|
+
import { t as useInput } from "../../useInput--wjwIBc5.cjs";
|
|
2
2
|
export { useInput };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as useInput } from "../../useInput-
|
|
1
|
+
import { t as useInput } from "../../useInput-BCdeYOOg.js";
|
|
2
2
|
export { useInput };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as UseInputValueDebounceReturn, r as useInputValueDebounce, t as UseInputValueDebounceOptions } from "../../useInputValueDebounce-
|
|
1
|
+
import { n as UseInputValueDebounceReturn, r as useInputValueDebounce, t as UseInputValueDebounceOptions } from "../../useInputValueDebounce-B5b-v8Hc.cjs";
|
|
2
2
|
export { UseInputValueDebounceOptions, UseInputValueDebounceReturn, useInputValueDebounce };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as UseInputValueDebounceReturn, r as useInputValueDebounce, t as UseInputValueDebounceOptions } from "../../useInputValueDebounce-
|
|
1
|
+
import { n as UseInputValueDebounceReturn, r as useInputValueDebounce, t as UseInputValueDebounceOptions } from "../../useInputValueDebounce-DoRuSF6R.js";
|
|
2
2
|
export { UseInputValueDebounceOptions, UseInputValueDebounceReturn, useInputValueDebounce };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as UseUniformFieldReturn, r as useUniformField, t as UseUniformFieldParams } from "../../useUniformField-
|
|
1
|
+
import { n as UseUniformFieldReturn, r as useUniformField, t as UseUniformFieldParams } from "../../useUniformField-B2OZ-Z1G.cjs";
|
|
2
2
|
export { UseUniformFieldParams, UseUniformFieldReturn, useUniformField };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "../../FormContext-C2_WMi_v.js";
|
|
2
2
|
import "../../useController-hjpJQf0w.js";
|
|
3
|
-
import "../../useFormContext-
|
|
4
|
-
import "../../useInput-
|
|
5
|
-
import { n as UseUniformFieldReturn, r as useUniformField, t as UseUniformFieldParams } from "../../useUniformField-
|
|
3
|
+
import "../../useFormContext-B2TS6xq0.js";
|
|
4
|
+
import "../../useInput-BCdeYOOg.js";
|
|
5
|
+
import { n as UseUniformFieldReturn, r as useUniformField, t as UseUniformFieldParams } from "../../useUniformField-CwEHonNe.js";
|
|
6
6
|
export { UseUniformFieldParams, UseUniformFieldReturn, useUniformField };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as useUniformFieldArray, t as UseUniformFieldArrayProps } from "../../useUniformFieldArray-
|
|
1
|
+
import { n as useUniformFieldArray, t as UseUniformFieldArrayProps } from "../../useUniformFieldArray-qtJMEosJ.cjs";
|
|
2
2
|
export { UseUniformFieldArrayProps, useUniformFieldArray };
|
|
@@ -1,7 +1,27 @@
|
|
|
1
|
+
import "../../index-C1PUx1tH.js";
|
|
2
|
+
import "../../index-F11geOHD.js";
|
|
3
|
+
import "../../index--E2ZsMya.js";
|
|
1
4
|
import "../../FormContext-C2_WMi_v.js";
|
|
5
|
+
import "../../index-DvB46QAb.js";
|
|
6
|
+
import "../../index-Edx7MxXu.js";
|
|
7
|
+
import "../../index-C-2nxT8D.js";
|
|
8
|
+
import "../../index-DG9C0kHA.js";
|
|
9
|
+
import "../../index-CVnn6mEI.js";
|
|
10
|
+
import "../../index-D38wOL-M.js";
|
|
11
|
+
import "../../index-CADnFWHq.js";
|
|
12
|
+
import "../../index-BWNJdLDV.js";
|
|
13
|
+
import "../../index-BL0DnIzh.js";
|
|
14
|
+
import "../../index-CGnr_e53.js";
|
|
15
|
+
import "../../index-DmMenZfj.js";
|
|
16
|
+
import "../../index-DnzC0GCS.js";
|
|
17
|
+
import "../../useClientValidation-DJ4JuN_9.js";
|
|
2
18
|
import "../../useController-hjpJQf0w.js";
|
|
3
|
-
import "../../
|
|
4
|
-
import "../../
|
|
5
|
-
import "../../
|
|
6
|
-
import
|
|
19
|
+
import "../../useFormContext-B2TS6xq0.js";
|
|
20
|
+
import "../../index-BRLjimYW.js";
|
|
21
|
+
import "../../useInput-BCdeYOOg.js";
|
|
22
|
+
import "../../useUniformField-CwEHonNe.js";
|
|
23
|
+
import "../../index-BQDEnYTq.js";
|
|
24
|
+
import "../../index-BTTo_ufh.js";
|
|
25
|
+
import "../../useWatchUserChange-BAdiqg2q.js";
|
|
26
|
+
import { n as useUniformFieldArray, t as UseUniformFieldArrayProps } from "../../useUniformFieldArray-CXoWvu6m.js";
|
|
7
27
|
export { UseUniformFieldArrayProps, useUniformFieldArray };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import * as tailwind_variants224 from "tailwind-variants";
|
|
2
|
-
import * as react_jsx_runtime9 from "react/jsx-runtime";
|
|
3
1
|
import { TVClassName } from "@fuf-stack/pixel-utils";
|
|
4
2
|
import { ReactNode } from "react";
|
|
3
|
+
import * as react_jsx_runtime12 from "react/jsx-runtime";
|
|
4
|
+
import * as tailwind_variants256 from "tailwind-variants";
|
|
5
5
|
|
|
6
6
|
//#region src/FieldCard/FieldCard.d.ts
|
|
7
|
-
declare const fieldCardVariants:
|
|
7
|
+
declare const fieldCardVariants: tailwind_variants256.TVReturnType<{
|
|
8
8
|
invalid: {
|
|
9
9
|
true: {
|
|
10
10
|
base: string;
|
|
@@ -48,7 +48,7 @@ declare const fieldCardVariants: tailwind_variants224.TVReturnType<{
|
|
|
48
48
|
content: string[];
|
|
49
49
|
/** class for the error footer wrapper */
|
|
50
50
|
errorFooter: string[];
|
|
51
|
-
},
|
|
51
|
+
}, tailwind_variants256.TVReturnType<{
|
|
52
52
|
invalid: {
|
|
53
53
|
true: {
|
|
54
54
|
base: string;
|
|
@@ -98,7 +98,7 @@ declare const FieldCard: ({
|
|
|
98
98
|
className: _className,
|
|
99
99
|
name,
|
|
100
100
|
...uniformFieldProps
|
|
101
|
-
}: FieldCardProps) =>
|
|
101
|
+
}: FieldCardProps) => react_jsx_runtime12.JSX.Element;
|
|
102
102
|
//#endregion
|
|
103
103
|
export { FieldCardProps as n, fieldCardVariants as r, FieldCard as t };
|
|
104
|
-
//# sourceMappingURL=index
|
|
104
|
+
//# sourceMappingURL=index--E2ZsMya.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index
|
|
1
|
+
{"version":3,"file":"index--E2ZsMya.d.ts","names":[],"sources":["../src/FieldCard/FieldCard.tsx"],"sourcesContent":[],"mappings":";;;;;;cAQa,mBA+CX,oBAAA,CA/C4B;;;;MAAjB,KAAA,EAAA,MA+CX;MAEG,WAAS,EAAA,MAAsB;IAEnB,CAAA;IAEL,KAAA,EAAA;MAEE,IAAA,EAAA,MAAA;MAEL,KAAA,EAAA,MAAA;MAAS,WAAA,EAAA,MAAA;IAgBZ,CAAA;EAAa,CAAA;CAAA,EAAA;EAAA;EAKhB,IAAA,EAAA,MAAA,EAAA;EAAc;EAkChB,KAAA,EAAA,MAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GAjEC,oBAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;KAEG,SAAA,GAAY,mBAAmB;UAEnB,cAAA;;YAEL;;cAEE;;SAEL;;;;;;;;;;;;;;;cAgBH;;aAAa;;;GAKhB,mBAAc,mBAAA,CAAA,GAAA,CAAA"}
|