@fuf-stack/uniform 1.18.2 → 1.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Checkboxes/index.cjs +7 -5
- package/dist/Checkboxes/index.d.cts +1 -1
- package/dist/Checkboxes/index.d.ts +1 -1
- package/dist/Checkboxes/index.js +2 -3
- package/dist/{Checkboxes-Dk7yyRVR.cjs → Checkboxes-Ca9fTce_.cjs} +18 -21
- package/dist/Checkboxes-Ca9fTce_.cjs.map +1 -0
- package/dist/{Checkboxes-BGrK_mwQ.js → Checkboxes-D1hppxDE.js} +7 -10
- package/dist/Checkboxes-D1hppxDE.js.map +1 -0
- package/dist/FieldArray/index.cjs +7 -5
- package/dist/FieldArray/index.d.cts +1 -1
- package/dist/FieldArray/index.d.ts +1 -1
- package/dist/FieldArray/index.js +2 -3
- package/dist/{FieldArray-BnZW6fwm.cjs → FieldArray-CnxCQt0o.cjs} +34 -53
- package/dist/FieldArray-CnxCQt0o.cjs.map +1 -0
- package/dist/{FieldArray-C53ox8yB.js → FieldArray-n39Aj9AV.js} +19 -38
- package/dist/FieldArray-n39Aj9AV.js.map +1 -0
- package/dist/FieldCard/index.cjs +4 -4
- package/dist/FieldCard/index.d.cts +1 -1
- package/dist/FieldCard/index.d.ts +1 -1
- package/dist/FieldCard/index.js +2 -3
- package/dist/{FieldCard-BxK_IJOR.cjs → FieldCard-DbuGSb_j.cjs} +20 -24
- package/dist/FieldCard-DbuGSb_j.cjs.map +1 -0
- package/dist/{FieldCard-16yCF83m.js → FieldCard-SjYNs4sL.js} +8 -12
- package/dist/FieldCard-SjYNs4sL.js.map +1 -0
- package/dist/{FieldCopyTestIdButton-4uupFq1U.cjs → FieldCopyTestIdButton-BvVBidko.cjs} +14 -17
- package/dist/FieldCopyTestIdButton-BvVBidko.cjs.map +1 -0
- package/dist/{FieldCopyTestIdButton-BoEdlzLs.js → FieldCopyTestIdButton-Dpmo0uBV.js} +4 -7
- package/dist/FieldCopyTestIdButton-Dpmo0uBV.js.map +1 -0
- package/dist/{FieldValidationError-Br6iopZj.cjs → FieldValidationError-EecXNx5F.cjs} +14 -17
- package/dist/FieldValidationError-EecXNx5F.cjs.map +1 -0
- package/dist/{FieldValidationError-XQaViV52.js → FieldValidationError-ktTyyyip.js} +4 -7
- package/dist/FieldValidationError-ktTyyyip.js.map +1 -0
- package/dist/Form/index.cjs +7 -5
- package/dist/Form/index.d.cts +1 -1
- package/dist/Form/index.d.ts +1 -2
- package/dist/Form/index.js +2 -3
- package/dist/{Form--SsSvsxl.cjs → Form-Diivw8pg.cjs} +17 -22
- package/dist/Form-Diivw8pg.cjs.map +1 -0
- package/dist/{Form-ccsEssie.js → Form-Wzy7pBVt.js} +8 -13
- package/dist/Form-Wzy7pBVt.js.map +1 -0
- package/dist/{FormContext-BSLO2-sO.cjs → FormContext-3GzWxXSS.cjs} +28 -36
- package/dist/{FormContext-BSLO2-sO.cjs.map → FormContext-3GzWxXSS.cjs.map} +1 -1
- package/dist/{FormContext-CCe8drkp.d.ts → FormContext-B4KQxdl7.d.ts} +1 -1
- package/dist/{FormContext-CCe8drkp.d.ts.map → FormContext-B4KQxdl7.d.ts.map} +1 -1
- package/dist/{FormContext-RSA21aDt.d.cts → FormContext-BuG3xZFe.d.cts} +1 -1
- package/dist/{FormContext-RSA21aDt.d.cts.map → FormContext-BuG3xZFe.d.cts.map} +1 -1
- package/dist/{FormContext-kE3YKhp_.js → FormContext-CLfMWHQM.js} +4 -7
- package/dist/{FormContext-kE3YKhp_.js.map → FormContext-CLfMWHQM.js.map} +1 -1
- package/dist/Grid/index.cjs +7 -5
- package/dist/Grid/index.d.cts +1 -1
- package/dist/Grid/index.d.ts +1 -1
- package/dist/Grid/index.js +2 -3
- package/dist/{Grid-CeaybCIF.js → Grid-Bzyi97Cx.js} +5 -8
- package/dist/Grid-Bzyi97Cx.js.map +1 -0
- package/dist/Grid-V1pCY2LC.cjs +32 -0
- package/dist/Grid-V1pCY2LC.cjs.map +1 -0
- package/dist/Input/index.cjs +7 -5
- package/dist/Input/index.d.cts +1 -1
- package/dist/Input/index.d.ts +1 -1
- package/dist/Input/index.js +2 -3
- package/dist/{Input-BCs_eyJ9.js → Input-BDWP4hOr.js} +6 -9
- package/dist/{Input-BCs_eyJ9.js.map → Input-BDWP4hOr.js.map} +1 -1
- package/dist/{Input-B3p_4ntD.cjs → Input-C6kRsqx1.cjs} +18 -21
- package/dist/Input-C6kRsqx1.cjs.map +1 -0
- package/dist/RadioBoxes/index.cjs +7 -5
- package/dist/RadioBoxes/index.d.cts +1 -1
- package/dist/RadioBoxes/index.d.ts +1 -1
- package/dist/RadioBoxes/index.js +2 -3
- package/dist/{RadioBoxes-C3Cwrn2I.js → RadioBoxes-DNQCynvF.js} +6 -10
- package/dist/RadioBoxes-DNQCynvF.js.map +1 -0
- package/dist/{RadioBoxes-xRvNe5U8.cjs → RadioBoxes-DVxDhpbp.cjs} +23 -27
- package/dist/RadioBoxes-DVxDhpbp.cjs.map +1 -0
- package/dist/RadioTabs/index.cjs +7 -5
- package/dist/RadioTabs/index.d.cts +1 -1
- package/dist/RadioTabs/index.d.ts +1 -1
- package/dist/RadioTabs/index.js +2 -3
- package/dist/{RadioTabs-BaHvYcd-.cjs → RadioTabs-CFraIx6w.cjs} +18 -21
- package/dist/RadioTabs-CFraIx6w.cjs.map +1 -0
- package/dist/{RadioTabs-DfOGIsEf.js → RadioTabs-CsVqYCE9.js} +6 -9
- package/dist/RadioTabs-CsVqYCE9.js.map +1 -0
- package/dist/Radios/index.cjs +7 -5
- package/dist/Radios/index.d.cts +1 -1
- package/dist/Radios/index.d.ts +1 -1
- package/dist/Radios/index.js +2 -3
- package/dist/{Radios-xM-09vB5.js → Radios-C-Zf3Yij.js} +6 -9
- package/dist/Radios-C-Zf3Yij.js.map +1 -0
- package/dist/{Radios-BfA3uL35.cjs → Radios-OhSB1oFo.cjs} +18 -21
- package/dist/Radios-OhSB1oFo.cjs.map +1 -0
- package/dist/Select/index.cjs +7 -5
- package/dist/Select/index.d.cts +1 -1
- package/dist/Select/index.d.ts +1 -1
- package/dist/Select/index.js +2 -3
- package/dist/{Select-DlEUzYl6.js → Select-DMpCAYLB.js} +7 -10
- package/dist/Select-DMpCAYLB.js.map +1 -0
- package/dist/{Select-DH_YaruM.cjs → Select-fEJPVWJa.cjs} +21 -24
- package/dist/Select-fEJPVWJa.cjs.map +1 -0
- package/dist/Slider/index.cjs +7 -5
- package/dist/Slider/index.d.cts +1 -1
- package/dist/Slider/index.d.ts +1 -1
- package/dist/Slider/index.js +2 -3
- package/dist/{Slider-C-dMrJZ6.cjs → Slider-ChBNfwS2.cjs} +16 -19
- package/dist/Slider-ChBNfwS2.cjs.map +1 -0
- package/dist/{Slider-CTFuVrp2.js → Slider-DxRcLu-j.js} +5 -8
- package/dist/{Slider-CTFuVrp2.js.map → Slider-DxRcLu-j.js.map} +1 -1
- package/dist/SubmitButton/index.cjs +7 -5
- package/dist/SubmitButton/index.d.cts +1 -1
- package/dist/SubmitButton/index.d.ts +1 -1
- package/dist/SubmitButton/index.js +2 -3
- package/dist/{SubmitButton-Bh1RN0F1.js → SubmitButton-Bu3NNFyt.js} +5 -8
- package/dist/SubmitButton-Bu3NNFyt.js.map +1 -0
- package/dist/{SubmitButton-CJ6s1mZr.cjs → SubmitButton-CfuPpJKk.cjs} +15 -18
- package/dist/SubmitButton-CfuPpJKk.cjs.map +1 -0
- package/dist/Switch/index.cjs +7 -5
- package/dist/Switch/index.d.cts +1 -1
- package/dist/Switch/index.d.ts +1 -1
- package/dist/Switch/index.js +2 -3
- package/dist/{Switch-CXrz-M3V.js → Switch-CMpXZdLc.js} +5 -8
- package/dist/{Switch-CXrz-M3V.js.map → Switch-CMpXZdLc.js.map} +1 -1
- package/dist/{Switch-CeUMwheZ.cjs → Switch-MDrnacFJ.cjs} +16 -19
- package/dist/Switch-MDrnacFJ.cjs.map +1 -0
- package/dist/SwitchBox/index.cjs +7 -5
- package/dist/SwitchBox/index.d.cts +1 -1
- package/dist/SwitchBox/index.d.ts +1 -1
- package/dist/SwitchBox/index.js +2 -3
- package/dist/{SwitchBox-C-aLl2nX.js → SwitchBox-Cg7NPfp_.js} +5 -8
- package/dist/SwitchBox-Cg7NPfp_.js.map +1 -0
- package/dist/{SwitchBox-mGUPvJE0.cjs → SwitchBox-kp93uE8e.cjs} +21 -24
- package/dist/SwitchBox-kp93uE8e.cjs.map +1 -0
- package/dist/TextArea/index.cjs +7 -5
- package/dist/TextArea/index.d.cts +1 -1
- package/dist/TextArea/index.d.ts +1 -1
- package/dist/TextArea/index.js +2 -3
- package/dist/{TextArea-BYEuk4Ng.cjs → TextArea-B8XYKqFg.cjs} +18 -21
- package/dist/TextArea-B8XYKqFg.cjs.map +1 -0
- package/dist/{TextArea-BLkVYmHZ.js → TextArea-Bxi2pXvY.js} +6 -9
- package/dist/TextArea-Bxi2pXvY.js.map +1 -0
- package/dist/helpers/index.cjs +397 -10
- package/dist/helpers/index.cjs.map +1 -0
- package/dist/helpers/index.js +387 -2
- package/dist/helpers/index.js.map +1 -0
- package/dist/hooks/useClientValidation/index.cjs +3 -3
- package/dist/hooks/useClientValidation/index.d.cts +1 -1
- package/dist/hooks/useClientValidation/index.d.ts +1 -1
- package/dist/hooks/useClientValidation/index.js +2 -3
- package/dist/hooks/useController/index.cjs +3 -3
- package/dist/hooks/useController/index.d.cts +1 -1
- package/dist/hooks/useController/index.d.ts +1 -2
- package/dist/hooks/useController/index.js +2 -3
- package/dist/hooks/useFormContext/index.cjs +8 -3
- package/dist/hooks/useFormContext/index.cjs.map +1 -0
- package/dist/hooks/useFormContext/index.d.cts +1 -1
- package/dist/hooks/useFormContext/index.d.ts +1 -3
- package/dist/hooks/useFormContext/index.js +6 -2
- package/dist/hooks/useFormContext/index.js.map +1 -0
- package/dist/hooks/useInput/index.cjs +8 -8
- package/dist/hooks/useInput/index.d.cts +1 -1
- package/dist/hooks/useInput/index.d.ts +1 -1
- package/dist/hooks/useInput/index.js +2 -3
- package/dist/hooks/useInputValueDebounce/index.cjs +92 -2
- package/dist/hooks/useInputValueDebounce/index.cjs.map +1 -0
- package/dist/hooks/useInputValueDebounce/index.d.cts +1 -1
- package/dist/hooks/useInputValueDebounce/index.d.ts +1 -1
- package/dist/hooks/useInputValueDebounce/index.js +90 -2
- package/dist/hooks/useInputValueDebounce/index.js.map +1 -0
- package/dist/hooks/useInputValueTransform/index.cjs +3 -3
- package/dist/hooks/useInputValueTransform/index.d.cts +1 -1
- package/dist/hooks/useInputValueTransform/index.d.ts +1 -1
- package/dist/hooks/useInputValueTransform/index.js +2 -3
- package/dist/hooks/useUniformField/index.cjs +135 -2
- package/dist/hooks/useUniformField/index.cjs.map +1 -0
- package/dist/hooks/useUniformField/index.d.cts +1 -1
- package/dist/hooks/useUniformField/index.d.ts +1 -5
- package/dist/hooks/useUniformField/index.js +132 -2
- package/dist/hooks/useUniformField/index.js.map +1 -0
- package/dist/hooks/useUniformFieldArray/index.cjs +83 -2
- package/dist/hooks/useUniformFieldArray/index.cjs.map +1 -0
- package/dist/hooks/useUniformFieldArray/index.d.cts +1 -1
- package/dist/hooks/useUniformFieldArray/index.d.ts +1 -6
- package/dist/hooks/useUniformFieldArray/index.js +81 -2
- package/dist/hooks/useUniformFieldArray/index.js.map +1 -0
- package/dist/hooks/useWatchUserChange/index.cjs +3 -3
- package/dist/hooks/useWatchUserChange/index.d.cts +1 -1
- package/dist/hooks/useWatchUserChange/index.d.ts +1 -1
- package/dist/hooks/useWatchUserChange/index.js +2 -3
- package/dist/{index-C6iTO4TR.d.cts → index-1Gzrph8R.d.cts} +35 -36
- package/dist/index-1Gzrph8R.d.cts.map +1 -0
- package/dist/index-B0Fw1BAy.d.cts +278 -0
- package/dist/index-B0Fw1BAy.d.cts.map +1 -0
- package/dist/{index-BRvTllFR.d.cts → index-B2tIMFYh.d.cts} +22 -22
- package/dist/index-B2tIMFYh.d.cts.map +1 -0
- package/dist/{index-CC2Rnywy.d.cts → index-B6WwxkLx2.d.ts} +3 -3
- package/dist/index-B6WwxkLx2.d.ts.map +1 -0
- package/dist/{index-CYbsLxVV.d.ts → index-BExpqT81.d.ts} +22 -22
- package/dist/index-BExpqT81.d.ts.map +1 -0
- package/dist/{index-Dkfbf-VN.d.ts → index-BLctuwc0.d.ts} +36 -36
- package/dist/index-BLctuwc0.d.ts.map +1 -0
- package/dist/{index-DelQykFp.d.ts → index-BV1VKQdy.d.cts} +3 -3
- package/dist/{index-CUIi5IqH.d.cts.map → index-BV1VKQdy.d.cts.map} +1 -1
- package/dist/{index-D_iyWuBa.d.cts → index-BdYKQ59a.d.cts} +7 -7
- package/dist/index-BdYKQ59a.d.cts.map +1 -0
- package/dist/{index-_6c2OwSa.d.cts → index-BqWtWLeP.d.cts} +36 -36
- package/dist/index-BqWtWLeP.d.cts.map +1 -0
- package/dist/{index-DhayQWKz.d.ts → index-BwAI1VFS.d.ts} +6 -6
- package/dist/index-BwAI1VFS.d.ts.map +1 -0
- package/dist/{index-QFAAtvOV.d.cts → index-C-DiLZRu.d.cts} +6 -6
- package/dist/index-C-DiLZRu.d.cts.map +1 -0
- package/dist/{index-BvRjEXt-.d.ts → index-C6dMrOEm.d.cts} +48 -48
- package/dist/index-C6dMrOEm.d.cts.map +1 -0
- package/dist/{index-Bg3AbFZf.d.ts → index-CE0aQlFw.d.ts} +7 -7
- package/dist/index-CE0aQlFw.d.ts.map +1 -0
- package/dist/{index-D0OJCk7N.d.ts → index-CKJumX37.d.cts} +34 -34
- package/dist/index-CKJumX37.d.cts.map +1 -0
- package/dist/{index-BdrSpcmR.d.ts → index-CY2Mpaz3.d.cts} +4 -4
- package/dist/index-CY2Mpaz3.d.cts.map +1 -0
- package/dist/{index-DiFA3eG2.d.ts → index-CZJ_lWQ0.d.ts} +21 -21
- package/dist/index-CZJ_lWQ0.d.ts.map +1 -0
- package/dist/{index-CUIi5IqH.d.cts → index-Cv4ERj3i.d.ts} +3 -3
- package/dist/{index-DelQykFp.d.ts.map → index-Cv4ERj3i.d.ts.map} +1 -1
- package/dist/{index-B3ly1uwg.d.ts → index-D6XwSwTP.d.cts} +6 -6
- package/dist/{index-CxeYvJ7m.d.cts.map → index-D6XwSwTP.d.cts.map} +1 -1
- package/dist/{index-DqY28C4j.d.cts → index-DD_RPe91.d.ts} +4 -4
- package/dist/index-DD_RPe91.d.ts.map +1 -0
- package/dist/{index-DIMnCRyt.d.ts → index-DFWSHdua.d.ts} +3 -3
- package/dist/{index-DIMnCRyt.d.ts.map → index-DFWSHdua.d.ts.map} +1 -1
- package/dist/index-DGHBlmnV.d.ts +278 -0
- package/dist/index-DGHBlmnV.d.ts.map +1 -0
- package/dist/{index-CHACvIcy.d.ts → index-DJe_1ZdK.d.ts} +35 -37
- package/dist/index-DJe_1ZdK.d.ts.map +1 -0
- package/dist/{index-D3L2S2b3.d.cts → index-DZzfeV4O.d.cts} +21 -21
- package/dist/index-DZzfeV4O.d.cts.map +1 -0
- package/dist/{index--NM5Ctp6.d.ts → index-Dj3NDj0T.d.ts} +4 -4
- package/dist/{index--NM5Ctp6.d.ts.map → index-Dj3NDj0T.d.ts.map} +1 -1
- package/dist/{index-NykXDzr-.d.cts → index-DkiQkdCW.d.cts} +3 -3
- package/dist/{index-NykXDzr-.d.cts.map → index-DkiQkdCW.d.cts.map} +1 -1
- package/dist/{index-CuNl43Zr.d.ts → index-DkxqHE_P2.d.ts} +3 -3
- package/dist/{index-DuJr42nE.d.cts.map → index-DkxqHE_P2.d.ts.map} +1 -1
- package/dist/{index-DuJr42nE.d.cts → index-Dld6NP_K.d.cts} +3 -3
- package/dist/index-Dld6NP_K.d.cts.map +1 -0
- package/dist/{index-BtX5upPu.d.cts → index-DpNf55K6.d.ts} +34 -34
- package/dist/index-DpNf55K6.d.ts.map +1 -0
- package/dist/index-DsC0y6kU.d.cts +70 -0
- package/dist/index-DsC0y6kU.d.cts.map +1 -0
- package/dist/index-DwqOejxR.d.ts +70 -0
- package/dist/index-DwqOejxR.d.ts.map +1 -0
- package/dist/{index-BE6hzbN3.d.cts → index-NjKV8LJD.d.cts} +4 -4
- package/dist/{index-BE6hzbN3.d.cts.map → index-NjKV8LJD.d.cts.map} +1 -1
- package/dist/{index-HfbCo9ep.d.cts → index-Yj6VEhqF.d.ts} +48 -48
- package/dist/index-Yj6VEhqF.d.ts.map +1 -0
- package/dist/{index-CxeYvJ7m.d.cts → index-fgARdsoB.d.ts} +6 -6
- package/dist/{index-B3ly1uwg.d.ts.map → index-fgARdsoB.d.ts.map} +1 -1
- package/dist/{index-DmlsX2k6.d.ts → index-jCfJAgDc.d.cts} +3 -3
- package/dist/index-jCfJAgDc.d.cts.map +1 -0
- package/dist/{index-D6strMx0.d.ts → index-pwXVq8hR.d.cts} +6 -6
- package/dist/index-pwXVq8hR.d.cts.map +1 -0
- package/dist/{index-C_EyZKET.d.cts → index-wV1E_PkS.d.ts} +6 -6
- package/dist/index-wV1E_PkS.d.ts.map +1 -0
- package/dist/index.cjs +63 -63
- package/dist/index.d.cts +26 -26
- package/dist/index.d.ts +26 -29
- package/dist/index.js +29 -30
- package/dist/partials/FieldCopyTestIdButton/index.cjs +7 -5
- package/dist/partials/FieldCopyTestIdButton/index.d.cts +1 -1
- package/dist/partials/FieldCopyTestIdButton/index.d.ts +1 -1
- package/dist/partials/FieldCopyTestIdButton/index.js +2 -3
- package/dist/partials/FieldValidationError/index.cjs +7 -5
- package/dist/partials/FieldValidationError/index.d.cts +1 -1
- package/dist/partials/FieldValidationError/index.d.ts +1 -1
- package/dist/partials/FieldValidationError/index.js +2 -3
- package/dist/{useClientValidation-Dw-dmynu.d.cts → useClientValidation-Bu3mNZpf.d.cts} +3 -3
- package/dist/{useClientValidation-Dw-dmynu.d.cts.map → useClientValidation-Bu3mNZpf.d.cts.map} +1 -1
- package/dist/{useClientValidation-DksyV18M.js → useClientValidation-Dn_kJkE5.js} +5 -6
- package/dist/{useClientValidation-DksyV18M.js.map → useClientValidation-Dn_kJkE5.js.map} +1 -1
- package/dist/{useClientValidation-Dnj_wuwf.cjs → useClientValidation-HqsAYK9K.cjs} +16 -17
- package/dist/useClientValidation-HqsAYK9K.cjs.map +1 -0
- package/dist/{useClientValidation-DxFgfsEI.d.ts → useClientValidation-_8PTmv8i.d.ts} +3 -3
- package/dist/{useClientValidation-DxFgfsEI.d.ts.map → useClientValidation-_8PTmv8i.d.ts.map} +1 -1
- package/dist/{useController-NjuthTyL.js → useController-B-6PzFna.js} +4 -5
- package/dist/{useController-NjuthTyL.js.map → useController-B-6PzFna.js.map} +1 -1
- package/dist/{useController-CvPWE2Sy.d.cts → useController-CNiqy_2D.d.cts} +1 -1
- package/dist/{useController-CvPWE2Sy.d.cts.map → useController-CNiqy_2D.d.cts.map} +1 -1
- package/dist/{useController-DfiNbuEz.d.ts → useController-Cc0UNQMm.d.ts} +1 -1
- package/dist/{useController-DfiNbuEz.d.ts.map → useController-Cc0UNQMm.d.ts.map} +1 -1
- package/dist/{useController-B_SSp5Z5.cjs → useController-D3a0qufz.cjs} +11 -12
- package/dist/{useController-B_SSp5Z5.cjs.map → useController-D3a0qufz.cjs.map} +1 -1
- package/dist/{useFormContext-vdeeDsAs.cjs → useFormContext-BQeGmV8j.cjs} +20 -21
- package/dist/{useFormContext-vdeeDsAs.cjs.map → useFormContext-BQeGmV8j.cjs.map} +1 -1
- package/dist/{useFormContext-Di67HIf7.js → useFormContext-Bzpyonu6.js} +5 -6
- package/dist/{useFormContext-Di67HIf7.js.map → useFormContext-Bzpyonu6.js.map} +1 -1
- package/dist/{useFormContext-Dh97YG47.d.cts → useFormContext-C06aufHt.d.cts} +24 -24
- package/dist/useFormContext-C06aufHt.d.cts.map +1 -0
- package/dist/{useFormContext-C6OOtqZ5.d.ts → useFormContext-CHA8GnKp.d.ts} +24 -24
- package/dist/useFormContext-CHA8GnKp.d.ts.map +1 -0
- package/dist/{useInput-BWzvIUpW.js → useInput-CVm3tP78.js} +1 -2
- package/dist/{useInputValueDebounce-ZLyAmuXV.d.cts → useInputValueDebounce-puGRVJ6t.d.cts} +1 -1
- package/dist/{useInputValueDebounce-ZLyAmuXV.d.cts.map → useInputValueDebounce-puGRVJ6t.d.cts.map} +1 -1
- package/dist/{useInputValueDebounce-Dhlv1NUY.d.ts → useInputValueDebounce-sFOlecIQ.d.ts} +1 -1
- package/dist/{useInputValueDebounce-Dhlv1NUY.d.ts.map → useInputValueDebounce-sFOlecIQ.d.ts.map} +1 -1
- package/dist/{useInputValueTransform-CNCBU7a9.d.cts → useInputValueTransform-BwAfw8Xb.d.cts} +1 -1
- package/dist/{useInputValueTransform-CNCBU7a9.d.cts.map → useInputValueTransform-BwAfw8Xb.d.cts.map} +1 -1
- package/dist/{useInputValueTransform-C-fmz3ke.js → useInputValueTransform-CXdmtc0Q.js} +2 -3
- package/dist/{useInputValueTransform-C-fmz3ke.js.map → useInputValueTransform-CXdmtc0Q.js.map} +1 -1
- package/dist/{useInputValueTransform-tsMNM7g_.d.ts → useInputValueTransform-CdoaxNyD.d.ts} +1 -1
- package/dist/{useInputValueTransform-tsMNM7g_.d.ts.map → useInputValueTransform-CdoaxNyD.d.ts.map} +1 -1
- package/dist/{useInputValueTransform-BBRvvhDe.cjs → useInputValueTransform-Cl6Xeso7.cjs} +8 -9
- package/dist/{useInputValueTransform-BBRvvhDe.cjs.map → useInputValueTransform-Cl6Xeso7.cjs.map} +1 -1
- package/dist/{useUniformField-CqqIJtqo.d.ts → useUniformField-BTBS1Kv-.d.ts} +5 -5
- package/dist/{useUniformField-CqqIJtqo.d.ts.map → useUniformField-BTBS1Kv-.d.ts.map} +1 -1
- package/dist/{useUniformField-DIb__gKK.d.cts → useUniformField-j22kM31n.d.cts} +5 -5
- package/dist/{useUniformField-DIb__gKK.d.cts.map → useUniformField-j22kM31n.d.cts.map} +1 -1
- package/dist/{useUniformFieldArray-BChcZvc5.d.cts → useUniformFieldArray-CDEagafl.d.cts} +18 -18
- package/dist/useUniformFieldArray-CDEagafl.d.cts.map +1 -0
- package/dist/{useUniformFieldArray-4MOU0xac.d.ts → useUniformFieldArray-CMHoo4o3.d.ts} +18 -18
- package/dist/useUniformFieldArray-CMHoo4o3.d.ts.map +1 -0
- package/dist/{useWatchUserChange-CYd_8zeN.d.ts → useWatchUserChange-CH4x16_r.d.ts} +1 -1
- package/dist/{useWatchUserChange-CYd_8zeN.d.ts.map → useWatchUserChange-CH4x16_r.d.ts.map} +1 -1
- package/dist/{useWatchUserChange-Dj9Imxfi.js → useWatchUserChange-CLgLc5W4.js} +3 -4
- package/dist/{useWatchUserChange-Dj9Imxfi.js.map → useWatchUserChange-CLgLc5W4.js.map} +1 -1
- package/dist/{useWatchUserChange-DedTNvGV.d.cts → useWatchUserChange-CZu_ZZ38.d.cts} +1 -1
- package/dist/{useWatchUserChange-DedTNvGV.d.cts.map → useWatchUserChange-CZu_ZZ38.d.cts.map} +1 -1
- package/dist/{useWatchUserChange-C1Kluht2.cjs → useWatchUserChange-DkZ0Vqv3.cjs} +9 -10
- package/dist/{useWatchUserChange-C1Kluht2.cjs.map → useWatchUserChange-DkZ0Vqv3.cjs.map} +1 -1
- package/package.json +71 -67
- package/dist/Checkboxes-BGrK_mwQ.js.map +0 -1
- package/dist/Checkboxes-Dk7yyRVR.cjs.map +0 -1
- package/dist/FieldArray-BnZW6fwm.cjs.map +0 -1
- package/dist/FieldArray-C53ox8yB.js.map +0 -1
- package/dist/FieldCard-16yCF83m.js.map +0 -1
- package/dist/FieldCard-BxK_IJOR.cjs.map +0 -1
- package/dist/FieldCopyTestIdButton-4uupFq1U.cjs.map +0 -1
- package/dist/FieldCopyTestIdButton-BoEdlzLs.js.map +0 -1
- package/dist/FieldValidationError-Br6iopZj.cjs.map +0 -1
- package/dist/FieldValidationError-XQaViV52.js.map +0 -1
- package/dist/Form--SsSvsxl.cjs.map +0 -1
- package/dist/Form-ccsEssie.js.map +0 -1
- package/dist/Grid-CE1fZKmV.cjs +0 -35
- package/dist/Grid-CE1fZKmV.cjs.map +0 -1
- package/dist/Grid-CeaybCIF.js.map +0 -1
- package/dist/Input-B3p_4ntD.cjs.map +0 -1
- package/dist/RadioBoxes-C3Cwrn2I.js.map +0 -1
- package/dist/RadioBoxes-xRvNe5U8.cjs.map +0 -1
- package/dist/RadioTabs-BaHvYcd-.cjs.map +0 -1
- package/dist/RadioTabs-DfOGIsEf.js.map +0 -1
- package/dist/Radios-BfA3uL35.cjs.map +0 -1
- package/dist/Radios-xM-09vB5.js.map +0 -1
- package/dist/Select-DH_YaruM.cjs.map +0 -1
- package/dist/Select-DlEUzYl6.js.map +0 -1
- package/dist/Slider-C-dMrJZ6.cjs.map +0 -1
- package/dist/SubmitButton-Bh1RN0F1.js.map +0 -1
- package/dist/SubmitButton-CJ6s1mZr.cjs.map +0 -1
- package/dist/Switch-CeUMwheZ.cjs.map +0 -1
- package/dist/SwitchBox-C-aLl2nX.js.map +0 -1
- package/dist/SwitchBox-mGUPvJE0.cjs.map +0 -1
- package/dist/TextArea-BLkVYmHZ.js.map +0 -1
- package/dist/TextArea-BYEuk4Ng.cjs.map +0 -1
- package/dist/helpers-33jajRcN.js +0 -390
- package/dist/helpers-33jajRcN.js.map +0 -1
- package/dist/helpers-Bd_QpqXg.cjs +0 -444
- package/dist/helpers-Bd_QpqXg.cjs.map +0 -1
- package/dist/index-BRvTllFR.d.cts.map +0 -1
- package/dist/index-BdrSpcmR.d.ts.map +0 -1
- package/dist/index-Bg3AbFZf.d.ts.map +0 -1
- package/dist/index-BtX5upPu.d.cts.map +0 -1
- package/dist/index-BvRjEXt-.d.ts.map +0 -1
- package/dist/index-C6iTO4TR.d.cts.map +0 -1
- package/dist/index-CC2Rnywy.d.cts.map +0 -1
- package/dist/index-CHACvIcy.d.ts.map +0 -1
- package/dist/index-CM7UugT3.d.cts +0 -278
- package/dist/index-CM7UugT3.d.cts.map +0 -1
- package/dist/index-CYbsLxVV.d.ts.map +0 -1
- package/dist/index-C_EyZKET.d.cts.map +0 -1
- package/dist/index-Ca2ovPTq.d.ts +0 -278
- package/dist/index-Ca2ovPTq.d.ts.map +0 -1
- package/dist/index-CuNl43Zr.d.ts.map +0 -1
- package/dist/index-D0OJCk7N.d.ts.map +0 -1
- package/dist/index-D3L2S2b3.d.cts.map +0 -1
- package/dist/index-D6strMx0.d.ts.map +0 -1
- package/dist/index-D_iyWuBa.d.cts.map +0 -1
- package/dist/index-DhayQWKz.d.ts.map +0 -1
- package/dist/index-DiFA3eG2.d.ts.map +0 -1
- package/dist/index-Dkfbf-VN.d.ts.map +0 -1
- package/dist/index-DmlsX2k6.d.ts.map +0 -1
- package/dist/index-DqY28C4j.d.cts.map +0 -1
- package/dist/index-HfbCo9ep.d.cts.map +0 -1
- package/dist/index-QFAAtvOV.d.cts.map +0 -1
- package/dist/index-_6c2OwSa.d.cts.map +0 -1
- package/dist/useClientValidation-Dnj_wuwf.cjs.map +0 -1
- package/dist/useFormContext-C6OOtqZ5.d.ts.map +0 -1
- package/dist/useFormContext-CLymm_7t.js +0 -6
- package/dist/useFormContext-CLymm_7t.js.map +0 -1
- package/dist/useFormContext-CkeSOfWD.cjs +0 -6
- package/dist/useFormContext-CkeSOfWD.cjs.map +0 -1
- package/dist/useFormContext-Dh97YG47.d.cts.map +0 -1
- package/dist/useInputValueDebounce-CRaM7HEM.cjs +0 -99
- package/dist/useInputValueDebounce-CRaM7HEM.cjs.map +0 -1
- package/dist/useInputValueDebounce-DJO5uzLb.js +0 -93
- package/dist/useInputValueDebounce-DJO5uzLb.js.map +0 -1
- package/dist/useUniformField-6c4OCAfb.cjs +0 -142
- package/dist/useUniformField-6c4OCAfb.cjs.map +0 -1
- package/dist/useUniformField-C-Xyu-8v.js +0 -135
- package/dist/useUniformField-C-Xyu-8v.js.map +0 -1
- package/dist/useUniformFieldArray-4MOU0xac.d.ts.map +0 -1
- package/dist/useUniformFieldArray-BChcZvc5.d.cts.map +0 -1
- package/dist/useUniformFieldArray-BKvA0FQW.js +0 -84
- package/dist/useUniformFieldArray-BKvA0FQW.js.map +0 -1
- package/dist/useUniformFieldArray-CRCbV1J2.cjs +0 -90
- package/dist/useUniformFieldArray-CRCbV1J2.cjs.map +0 -1
- /package/dist/{index-BMCcWGYS.d.ts → index--okzibnx.d.ts} +0 -0
- /package/dist/{index-C8k_zgEm.d.cts → index-B2TCFhpj.d.ts} +0 -0
- /package/dist/{index-D86jXpHS.d.cts → index-BtBZHVmz.d.cts} +0 -0
- /package/dist/{index-DDRpa5CJ.d.cts → index-CI4LJief.d.ts} +0 -0
- /package/dist/{index-GGHuYh77.d.ts → index-DeEmP3Jc.d.cts} +0 -0
- /package/dist/{index-hIBrhvnj.d.ts → index-sQecLSpR.d.cts} +0 -0
- /package/dist/{useInput-BVZvtfNg.d.ts → useInput-93TCCrkB.d.cts} +0 -0
- /package/dist/{useInput-CKmKH9Ij.d.cts → useInput-C_fY--wx.d.ts} +0 -0
|
@@ -1,3 +1,84 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
require("../../FormContext-3GzWxXSS.cjs");
|
|
3
|
+
const require_helpers_index = require("../../helpers/index.cjs");
|
|
4
|
+
const require_useFormContext = require("../../useFormContext-BQeGmV8j.cjs");
|
|
5
|
+
const require_hooks_useUniformField_index = require("../useUniformField/index.cjs");
|
|
6
|
+
let react = require("react");
|
|
7
|
+
let _fuf_stack_pixel_motion = require("@fuf-stack/pixel-motion");
|
|
8
|
+
let react_hook_form = require("react-hook-form");
|
|
9
|
+
//#region src/hooks/useUniformFieldArray/useUniformFieldArray.ts
|
|
10
|
+
/**
|
|
11
|
+
* Enhanced useFieldArray hook with initialization and animation logic.
|
|
12
|
+
* Based on React Hook Form's useFieldArray with additional features:
|
|
13
|
+
* - Automatic initialization when lastElementNotRemovable is set
|
|
14
|
+
* - Animation control (disabled during initialization)
|
|
15
|
+
* - Support for flat arrays (arrays of primitives)
|
|
16
|
+
*
|
|
17
|
+
* Note: Automatic validation triggering on length change is disabled to prevent
|
|
18
|
+
* triggering form-wide validation. Array validation still runs on form submission.
|
|
19
|
+
*
|
|
20
|
+
* @see https://react-hook-form.com/docs/usefieldarray
|
|
21
|
+
*/
|
|
22
|
+
const useUniformFieldArray = ({ name, flat = false, elementInitialValue: _elementInitialValue = null, lastElementNotRemovable = false, disabled, testId: explicitTestId, label }) => {
|
|
23
|
+
const uniformField = require_hooks_useUniformField_index.useUniformField({
|
|
24
|
+
name,
|
|
25
|
+
disabled,
|
|
26
|
+
testId: explicitTestId,
|
|
27
|
+
label
|
|
28
|
+
});
|
|
29
|
+
const { control } = uniformField;
|
|
30
|
+
const { fields, append, remove, insert, move } = (0, react_hook_form.useFieldArray)({
|
|
31
|
+
control,
|
|
32
|
+
name
|
|
33
|
+
});
|
|
34
|
+
const { trigger, setValue } = require_useFormContext.useFormContext();
|
|
35
|
+
const needsInitialize = (0, react.useMemo)(() => {
|
|
36
|
+
return lastElementNotRemovable && fields.length === 0;
|
|
37
|
+
}, [lastElementNotRemovable, fields.length]);
|
|
38
|
+
const hasInitialized = (0, react.useRef)(!needsInitialize);
|
|
39
|
+
(0, react.useEffect)(() => {
|
|
40
|
+
if (needsInitialize) hasInitialized.current = false;
|
|
41
|
+
}, [needsInitialize]);
|
|
42
|
+
(0, react.useEffect)(() => {
|
|
43
|
+
if (hasInitialized.current) setTimeout(() => {
|
|
44
|
+
trigger(name);
|
|
45
|
+
}, 200);
|
|
46
|
+
}, [fields.length]);
|
|
47
|
+
const [disableAnimation, setDisableAnimation] = (0, react.useState)(true);
|
|
48
|
+
const prefersReducedMotion = (0, _fuf_stack_pixel_motion.useReducedMotion)();
|
|
49
|
+
(0, react.useEffect)(() => {
|
|
50
|
+
if (hasInitialized.current) setDisableAnimation(!!prefersReducedMotion);
|
|
51
|
+
}, [prefersReducedMotion]);
|
|
52
|
+
const elementInitialValue = (0, react.useMemo)(() => {
|
|
53
|
+
return flat ? { [require_helpers_index.flatArrayKey]: _elementInitialValue ?? null } : _elementInitialValue ?? {};
|
|
54
|
+
}, [flat, _elementInitialValue]);
|
|
55
|
+
(0, react.useEffect)(() => {
|
|
56
|
+
if (needsInitialize) {
|
|
57
|
+
setValue(name, [elementInitialValue], {
|
|
58
|
+
shouldDirty: false,
|
|
59
|
+
shouldTouch: false
|
|
60
|
+
});
|
|
61
|
+
hasInitialized.current = true;
|
|
62
|
+
if (!prefersReducedMotion && disableAnimation) setTimeout(() => {
|
|
63
|
+
setDisableAnimation(false);
|
|
64
|
+
}, 1);
|
|
65
|
+
}
|
|
66
|
+
}, [needsInitialize]);
|
|
67
|
+
return {
|
|
68
|
+
fields,
|
|
69
|
+
append,
|
|
70
|
+
remove,
|
|
71
|
+
insert,
|
|
72
|
+
move,
|
|
73
|
+
disableAnimation,
|
|
74
|
+
elementInitialValue,
|
|
75
|
+
...uniformField
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
//#endregion
|
|
79
|
+
//#region src/hooks/useUniformFieldArray/index.ts
|
|
80
|
+
/* v8 ignore stop */
|
|
81
|
+
//#endregion
|
|
82
|
+
exports.useUniformFieldArray = useUniformFieldArray;
|
|
2
83
|
|
|
3
|
-
|
|
84
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["useUniformField","useFormContext","flatArrayKey"],"sources":["../../../src/hooks/useUniformFieldArray/useUniformFieldArray.ts","../../../src/hooks/useUniformFieldArray/index.ts"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { ArrayPath, FieldValues, Path } from 'react-hook-form';\n\nimport { useEffect, useMemo, useRef, useState } from 'react';\nimport { useFieldArray as useRHFFieldArray } from 'react-hook-form';\n\nimport { useReducedMotion } from '@fuf-stack/pixel-motion';\n\nimport { flatArrayKey } from '../../helpers';\nimport { useFormContext } from '../useFormContext';\nimport { useUniformField } from '../useUniformField';\n\nexport interface UseUniformFieldArrayProps<\n TFieldValues extends FieldValues = FieldValues,\n> {\n /** Field name for the array */\n name: ArrayPath<TFieldValues>;\n /** Whether this is a flat array (array of primitives) */\n flat?: boolean;\n /** Initial value for new array elements */\n elementInitialValue?: unknown;\n /** Whether the last element cannot be removed (always maintain at least one element) */\n lastElementNotRemovable?: boolean;\n /** Disable the field */\n disabled?: boolean;\n /** Optional explicit test id used to build stable test ids */\n testId?: string;\n /** Optional label content */\n label?: ReactNode;\n}\n\n/**\n * Enhanced useFieldArray hook with initialization and animation logic.\n * Based on React Hook Form's useFieldArray with additional features:\n * - Automatic initialization when lastElementNotRemovable is set\n * - Animation control (disabled during initialization)\n * - Support for flat arrays (arrays of primitives)\n *\n * Note: Automatic validation triggering on length change is disabled to prevent\n * triggering form-wide validation. Array validation still runs on form submission.\n *\n * @see https://react-hook-form.com/docs/usefieldarray\n */\nexport const useUniformFieldArray = <\n TFieldValues extends FieldValues = FieldValues,\n>({\n name,\n flat = false,\n elementInitialValue: _elementInitialValue = null,\n lastElementNotRemovable = false,\n disabled,\n testId: explicitTestId,\n label,\n}: UseUniformFieldArrayProps<TFieldValues>) => {\n // Get uniform field state and utilities\n const uniformField = useUniformField<TFieldValues>({\n name: name as Path<TFieldValues> & string,\n disabled,\n testId: explicitTestId,\n label,\n });\n\n const { control } = uniformField;\n\n const { fields, append, remove, insert, move } = useRHFFieldArray({\n control,\n name,\n });\n\n const { trigger, setValue } = useFormContext<TFieldValues>();\n\n // Determine if initialization is needed (initially or after reset).\n // This flag automatically handles both scenarios:\n // - Initial mount: fields.length starts at 0\n // - Form reset: fields.length becomes 0 again\n // Additional initialization conditions can be added here later (e.g., minElements > 0)\n // Using useMemo ensures this value is properly tracked by React and effects can depend on it\n const needsInitialize = useMemo(() => {\n return lastElementNotRemovable && fields.length === 0;\n }, [lastElementNotRemovable, fields.length]);\n\n // Track whether initialization has completed. Initialized contextually:\n // - If initialization IS needed (needsInitialize = true): starts as false, set to true after init\n // - If initialization is NOT needed (needsInitialize = false): starts as true (already initialized)\n // This ref is used to:\n // 1. Skip validation during initialization/re-initialization\n // 2. Gate animation enabling until after initialization\n // 3. Gate motion preference effect until after initialization\n const hasInitialized = useRef(!needsInitialize);\n\n // Reset initialization flag when needsInitialize changes to true.\n // This handles form reset: when fields become empty (needsInitialize becomes true),\n // hasInitialized is reset to false, triggering re-initialization in the effect below.\n useEffect(() => {\n if (needsInitialize) {\n hasInitialized.current = false;\n }\n }, [needsInitialize]);\n\n // Validate array-level constraints (min/max items) when length changes.\n // This ensures min/max errors appear instantly when user adds/removes items.\n // Note: Child field validation also runs, but new empty fields won't show as invalid\n // because useFormContext only sets invalid=true for touched fields or after form submission.\n // Skip validation during initialization/re-initialization to avoid showing errors prematurely.\n useEffect(() => {\n if (hasInitialized.current) {\n setTimeout(() => {\n trigger(name as Path<TFieldValues>);\n }, 200);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [fields.length]);\n\n // Animation control: Start with animations disabled to prevent animating in initial elements.\n // Will be enabled after initialization completes (unless user prefers reduced motion).\n const [disableAnimation, setDisableAnimation] = useState(true);\n\n // Respond to user's motion preference changes (after initialization).\n // During initialization, animations stay disabled regardless of preference.\n const prefersReducedMotion = useReducedMotion();\n useEffect(() => {\n if (hasInitialized.current) {\n setDisableAnimation(!!prefersReducedMotion);\n }\n }, [prefersReducedMotion]);\n\n // Prepare initial element value based on mode\n // - flat=true: arrays of primitives → object with flatArrayKey and null value by default\n // - flat=false: arrays of objects → empty object by default\n const elementInitialValue = useMemo(() => {\n return flat\n ? { [flatArrayKey]: _elementInitialValue ?? null }\n : (_elementInitialValue ?? {});\n }, [flat, _elementInitialValue]);\n\n // Initialization/Re-initialization: Add initial element when needed.\n // This handles both initial mount and form reset scenarios by reacting to needsInitialize.\n // CRITICAL: This effect MUST be the LAST hook in this component.\n // It sets hasInitialized.current = true, which acts as a gate for other effects.\n // If this runs before other effects, hasInitialized will be true during their first run,\n // causing them to execute logic meant only for post-initialization (e.g., validation,\n // animation enabling). By placing this last, all other effects run first with\n // hasInitialized = false, allowing them to skip initialization-phase logic.\n useEffect(\n () => {\n if (needsInitialize) {\n // use setValue instead of append to avoid focusing the added element\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setValue(name as Path<TFieldValues>, [elementInitialValue] as any, {\n shouldDirty: false,\n shouldTouch: false,\n });\n\n // Mark initialization as complete\n hasInitialized.current = true;\n\n // Enable animations after a brief delay (unless user prefers reduced motion or animations are already enabled).\n // This only runs on initial mount when animations start disabled.\n // On reset, disableAnimation is typically false, so this setTimeout won't run and animations stay enabled.\n if (!prefersReducedMotion && disableAnimation) {\n setTimeout(() => {\n setDisableAnimation(false);\n }, 1);\n }\n }\n },\n // Run when needsInitialize changes (initial mount or reset)\n // needsInitialize is memoized based on fields.length and lastElementNotRemovable\n // Other dependencies are intentionally omitted:\n // - append, setValue, trigger, setDisableAnimation are stable refs/functions\n // - elementInitialValue, name, flat, prefersReducedMotion, disableAnimation are props/stable values\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [needsInitialize],\n );\n\n return {\n // Field array methods and state\n fields,\n append,\n remove,\n insert,\n move,\n disableAnimation,\n elementInitialValue,\n // Uniform field state and utilities (spread all)\n ...uniformField,\n };\n};\n","/* v8 ignore start */\n\nexport * from './useUniformFieldArray';\n\n/* v8 ignore stop */\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA2CA,MAAa,wBAEX,EACA,MACA,OAAO,OACP,qBAAqB,uBAAuB,MAC5C,0BAA0B,OAC1B,UACA,QAAQ,gBACR,YAC6C;CAE7C,MAAM,eAAeA,oCAAAA,gBAA8B;EAC3C;EACN;EACA,QAAQ;EACR;EACD,CAAC;CAEF,MAAM,EAAE,YAAY;CAEpB,MAAM,EAAE,QAAQ,QAAQ,QAAQ,QAAQ,UAAA,GAAA,gBAAA,eAA0B;EAChE;EACA;EACD,CAAC;CAEF,MAAM,EAAE,SAAS,aAAaC,uBAAAA,gBAA8B;CAQ5D,MAAM,mBAAA,GAAA,MAAA,eAAgC;AACpC,SAAO,2BAA2B,OAAO,WAAW;IACnD,CAAC,yBAAyB,OAAO,OAAO,CAAC;CAS5C,MAAM,kBAAA,GAAA,MAAA,QAAwB,CAAC,gBAAgB;AAK/C,EAAA,GAAA,MAAA,iBAAgB;AACd,MAAI,gBACF,gBAAe,UAAU;IAE1B,CAAC,gBAAgB,CAAC;AAOrB,EAAA,GAAA,MAAA,iBAAgB;AACd,MAAI,eAAe,QACjB,kBAAiB;AACf,WAAQ,KAA2B;KAClC,IAAI;IAGR,CAAC,OAAO,OAAO,CAAC;CAInB,MAAM,CAAC,kBAAkB,wBAAA,GAAA,MAAA,UAAgC,KAAK;CAI9D,MAAM,wBAAA,GAAA,wBAAA,mBAAyC;AAC/C,EAAA,GAAA,MAAA,iBAAgB;AACd,MAAI,eAAe,QACjB,qBAAoB,CAAC,CAAC,qBAAqB;IAE5C,CAAC,qBAAqB,CAAC;CAK1B,MAAM,uBAAA,GAAA,MAAA,eAAoC;AACxC,SAAO,OACH,GAAGC,sBAAAA,eAAe,wBAAwB,MAAM,GAC/C,wBAAwB,EAAE;IAC9B,CAAC,MAAM,qBAAqB,CAAC;AAUhC,EAAA,GAAA,MAAA,iBACQ;AACJ,MAAI,iBAAiB;AAGnB,YAAS,MAA4B,CAAC,oBAAoB,EAAS;IACjE,aAAa;IACb,aAAa;IACd,CAAC;AAGF,kBAAe,UAAU;AAKzB,OAAI,CAAC,wBAAwB,iBAC3B,kBAAiB;AACf,wBAAoB,MAAM;MACzB,EAAE;;IAUX,CAAC,gBAAgB,CAClB;AAED,QAAO;EAEL;EACA;EACA;EACA;EACA;EACA;EACA;EAEA,GAAG;EACJ"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as useUniformFieldArray, t as UseUniformFieldArrayProps } from "../../useUniformFieldArray-
|
|
1
|
+
import { n as useUniformFieldArray, t as UseUniformFieldArrayProps } from "../../useUniformFieldArray-CDEagafl.cjs";
|
|
2
2
|
export { UseUniformFieldArrayProps, useUniformFieldArray };
|
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
import "../../
|
|
2
|
-
import "../../useController-DfiNbuEz.js";
|
|
3
|
-
import "../../index-hIBrhvnj.js";
|
|
4
|
-
import "../../useFormContext-C6OOtqZ5.js";
|
|
5
|
-
import "../../index-BMCcWGYS.js";
|
|
6
|
-
import { n as useUniformFieldArray, t as UseUniformFieldArrayProps } from "../../useUniformFieldArray-4MOU0xac.js";
|
|
1
|
+
import { n as useUniformFieldArray, t as UseUniformFieldArrayProps } from "../../useUniformFieldArray-CMHoo4o3.js";
|
|
7
2
|
export { UseUniformFieldArrayProps, useUniformFieldArray };
|
|
@@ -1,3 +1,82 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { flatArrayKey } from "../../helpers/index.js";
|
|
2
|
+
import { n as useFormContext$1 } from "../../useFormContext-Bzpyonu6.js";
|
|
3
|
+
import { useUniformField } from "../useUniformField/index.js";
|
|
4
|
+
import { useEffect, useMemo, useRef, useState } from "react";
|
|
5
|
+
import { useReducedMotion } from "@fuf-stack/pixel-motion";
|
|
6
|
+
import { useFieldArray } from "react-hook-form";
|
|
7
|
+
//#region src/hooks/useUniformFieldArray/useUniformFieldArray.ts
|
|
8
|
+
/**
|
|
9
|
+
* Enhanced useFieldArray hook with initialization and animation logic.
|
|
10
|
+
* Based on React Hook Form's useFieldArray with additional features:
|
|
11
|
+
* - Automatic initialization when lastElementNotRemovable is set
|
|
12
|
+
* - Animation control (disabled during initialization)
|
|
13
|
+
* - Support for flat arrays (arrays of primitives)
|
|
14
|
+
*
|
|
15
|
+
* Note: Automatic validation triggering on length change is disabled to prevent
|
|
16
|
+
* triggering form-wide validation. Array validation still runs on form submission.
|
|
17
|
+
*
|
|
18
|
+
* @see https://react-hook-form.com/docs/usefieldarray
|
|
19
|
+
*/
|
|
20
|
+
const useUniformFieldArray = ({ name, flat = false, elementInitialValue: _elementInitialValue = null, lastElementNotRemovable = false, disabled, testId: explicitTestId, label }) => {
|
|
21
|
+
const uniformField = useUniformField({
|
|
22
|
+
name,
|
|
23
|
+
disabled,
|
|
24
|
+
testId: explicitTestId,
|
|
25
|
+
label
|
|
26
|
+
});
|
|
27
|
+
const { control } = uniformField;
|
|
28
|
+
const { fields, append, remove, insert, move } = useFieldArray({
|
|
29
|
+
control,
|
|
30
|
+
name
|
|
31
|
+
});
|
|
32
|
+
const { trigger, setValue } = useFormContext$1();
|
|
33
|
+
const needsInitialize = useMemo(() => {
|
|
34
|
+
return lastElementNotRemovable && fields.length === 0;
|
|
35
|
+
}, [lastElementNotRemovable, fields.length]);
|
|
36
|
+
const hasInitialized = useRef(!needsInitialize);
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
if (needsInitialize) hasInitialized.current = false;
|
|
39
|
+
}, [needsInitialize]);
|
|
40
|
+
useEffect(() => {
|
|
41
|
+
if (hasInitialized.current) setTimeout(() => {
|
|
42
|
+
trigger(name);
|
|
43
|
+
}, 200);
|
|
44
|
+
}, [fields.length]);
|
|
45
|
+
const [disableAnimation, setDisableAnimation] = useState(true);
|
|
46
|
+
const prefersReducedMotion = useReducedMotion();
|
|
47
|
+
useEffect(() => {
|
|
48
|
+
if (hasInitialized.current) setDisableAnimation(!!prefersReducedMotion);
|
|
49
|
+
}, [prefersReducedMotion]);
|
|
50
|
+
const elementInitialValue = useMemo(() => {
|
|
51
|
+
return flat ? { [flatArrayKey]: _elementInitialValue ?? null } : _elementInitialValue ?? {};
|
|
52
|
+
}, [flat, _elementInitialValue]);
|
|
53
|
+
useEffect(() => {
|
|
54
|
+
if (needsInitialize) {
|
|
55
|
+
setValue(name, [elementInitialValue], {
|
|
56
|
+
shouldDirty: false,
|
|
57
|
+
shouldTouch: false
|
|
58
|
+
});
|
|
59
|
+
hasInitialized.current = true;
|
|
60
|
+
if (!prefersReducedMotion && disableAnimation) setTimeout(() => {
|
|
61
|
+
setDisableAnimation(false);
|
|
62
|
+
}, 1);
|
|
63
|
+
}
|
|
64
|
+
}, [needsInitialize]);
|
|
65
|
+
return {
|
|
66
|
+
fields,
|
|
67
|
+
append,
|
|
68
|
+
remove,
|
|
69
|
+
insert,
|
|
70
|
+
move,
|
|
71
|
+
disableAnimation,
|
|
72
|
+
elementInitialValue,
|
|
73
|
+
...uniformField
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
//#endregion
|
|
77
|
+
//#region src/hooks/useUniformFieldArray/index.ts
|
|
78
|
+
/* v8 ignore stop */
|
|
79
|
+
//#endregion
|
|
80
|
+
export { useUniformFieldArray };
|
|
2
81
|
|
|
3
|
-
|
|
82
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["useRHFFieldArray","useFormContext"],"sources":["../../../src/hooks/useUniformFieldArray/useUniformFieldArray.ts","../../../src/hooks/useUniformFieldArray/index.ts"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { ArrayPath, FieldValues, Path } from 'react-hook-form';\n\nimport { useEffect, useMemo, useRef, useState } from 'react';\nimport { useFieldArray as useRHFFieldArray } from 'react-hook-form';\n\nimport { useReducedMotion } from '@fuf-stack/pixel-motion';\n\nimport { flatArrayKey } from '../../helpers';\nimport { useFormContext } from '../useFormContext';\nimport { useUniformField } from '../useUniformField';\n\nexport interface UseUniformFieldArrayProps<\n TFieldValues extends FieldValues = FieldValues,\n> {\n /** Field name for the array */\n name: ArrayPath<TFieldValues>;\n /** Whether this is a flat array (array of primitives) */\n flat?: boolean;\n /** Initial value for new array elements */\n elementInitialValue?: unknown;\n /** Whether the last element cannot be removed (always maintain at least one element) */\n lastElementNotRemovable?: boolean;\n /** Disable the field */\n disabled?: boolean;\n /** Optional explicit test id used to build stable test ids */\n testId?: string;\n /** Optional label content */\n label?: ReactNode;\n}\n\n/**\n * Enhanced useFieldArray hook with initialization and animation logic.\n * Based on React Hook Form's useFieldArray with additional features:\n * - Automatic initialization when lastElementNotRemovable is set\n * - Animation control (disabled during initialization)\n * - Support for flat arrays (arrays of primitives)\n *\n * Note: Automatic validation triggering on length change is disabled to prevent\n * triggering form-wide validation. Array validation still runs on form submission.\n *\n * @see https://react-hook-form.com/docs/usefieldarray\n */\nexport const useUniformFieldArray = <\n TFieldValues extends FieldValues = FieldValues,\n>({\n name,\n flat = false,\n elementInitialValue: _elementInitialValue = null,\n lastElementNotRemovable = false,\n disabled,\n testId: explicitTestId,\n label,\n}: UseUniformFieldArrayProps<TFieldValues>) => {\n // Get uniform field state and utilities\n const uniformField = useUniformField<TFieldValues>({\n name: name as Path<TFieldValues> & string,\n disabled,\n testId: explicitTestId,\n label,\n });\n\n const { control } = uniformField;\n\n const { fields, append, remove, insert, move } = useRHFFieldArray({\n control,\n name,\n });\n\n const { trigger, setValue } = useFormContext<TFieldValues>();\n\n // Determine if initialization is needed (initially or after reset).\n // This flag automatically handles both scenarios:\n // - Initial mount: fields.length starts at 0\n // - Form reset: fields.length becomes 0 again\n // Additional initialization conditions can be added here later (e.g., minElements > 0)\n // Using useMemo ensures this value is properly tracked by React and effects can depend on it\n const needsInitialize = useMemo(() => {\n return lastElementNotRemovable && fields.length === 0;\n }, [lastElementNotRemovable, fields.length]);\n\n // Track whether initialization has completed. Initialized contextually:\n // - If initialization IS needed (needsInitialize = true): starts as false, set to true after init\n // - If initialization is NOT needed (needsInitialize = false): starts as true (already initialized)\n // This ref is used to:\n // 1. Skip validation during initialization/re-initialization\n // 2. Gate animation enabling until after initialization\n // 3. Gate motion preference effect until after initialization\n const hasInitialized = useRef(!needsInitialize);\n\n // Reset initialization flag when needsInitialize changes to true.\n // This handles form reset: when fields become empty (needsInitialize becomes true),\n // hasInitialized is reset to false, triggering re-initialization in the effect below.\n useEffect(() => {\n if (needsInitialize) {\n hasInitialized.current = false;\n }\n }, [needsInitialize]);\n\n // Validate array-level constraints (min/max items) when length changes.\n // This ensures min/max errors appear instantly when user adds/removes items.\n // Note: Child field validation also runs, but new empty fields won't show as invalid\n // because useFormContext only sets invalid=true for touched fields or after form submission.\n // Skip validation during initialization/re-initialization to avoid showing errors prematurely.\n useEffect(() => {\n if (hasInitialized.current) {\n setTimeout(() => {\n trigger(name as Path<TFieldValues>);\n }, 200);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [fields.length]);\n\n // Animation control: Start with animations disabled to prevent animating in initial elements.\n // Will be enabled after initialization completes (unless user prefers reduced motion).\n const [disableAnimation, setDisableAnimation] = useState(true);\n\n // Respond to user's motion preference changes (after initialization).\n // During initialization, animations stay disabled regardless of preference.\n const prefersReducedMotion = useReducedMotion();\n useEffect(() => {\n if (hasInitialized.current) {\n setDisableAnimation(!!prefersReducedMotion);\n }\n }, [prefersReducedMotion]);\n\n // Prepare initial element value based on mode\n // - flat=true: arrays of primitives → object with flatArrayKey and null value by default\n // - flat=false: arrays of objects → empty object by default\n const elementInitialValue = useMemo(() => {\n return flat\n ? { [flatArrayKey]: _elementInitialValue ?? null }\n : (_elementInitialValue ?? {});\n }, [flat, _elementInitialValue]);\n\n // Initialization/Re-initialization: Add initial element when needed.\n // This handles both initial mount and form reset scenarios by reacting to needsInitialize.\n // CRITICAL: This effect MUST be the LAST hook in this component.\n // It sets hasInitialized.current = true, which acts as a gate for other effects.\n // If this runs before other effects, hasInitialized will be true during their first run,\n // causing them to execute logic meant only for post-initialization (e.g., validation,\n // animation enabling). By placing this last, all other effects run first with\n // hasInitialized = false, allowing them to skip initialization-phase logic.\n useEffect(\n () => {\n if (needsInitialize) {\n // use setValue instead of append to avoid focusing the added element\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setValue(name as Path<TFieldValues>, [elementInitialValue] as any, {\n shouldDirty: false,\n shouldTouch: false,\n });\n\n // Mark initialization as complete\n hasInitialized.current = true;\n\n // Enable animations after a brief delay (unless user prefers reduced motion or animations are already enabled).\n // This only runs on initial mount when animations start disabled.\n // On reset, disableAnimation is typically false, so this setTimeout won't run and animations stay enabled.\n if (!prefersReducedMotion && disableAnimation) {\n setTimeout(() => {\n setDisableAnimation(false);\n }, 1);\n }\n }\n },\n // Run when needsInitialize changes (initial mount or reset)\n // needsInitialize is memoized based on fields.length and lastElementNotRemovable\n // Other dependencies are intentionally omitted:\n // - append, setValue, trigger, setDisableAnimation are stable refs/functions\n // - elementInitialValue, name, flat, prefersReducedMotion, disableAnimation are props/stable values\n // eslint-disable-next-line react-hooks/exhaustive-deps\n [needsInitialize],\n );\n\n return {\n // Field array methods and state\n fields,\n append,\n remove,\n insert,\n move,\n disableAnimation,\n elementInitialValue,\n // Uniform field state and utilities (spread all)\n ...uniformField,\n };\n};\n","/* v8 ignore start */\n\nexport * from './useUniformFieldArray';\n\n/* v8 ignore stop */\n"],"mappings":";;;;;;;;;;;;;;;;;;;AA2CA,MAAa,wBAEX,EACA,MACA,OAAO,OACP,qBAAqB,uBAAuB,MAC5C,0BAA0B,OAC1B,UACA,QAAQ,gBACR,YAC6C;CAE7C,MAAM,eAAe,gBAA8B;EAC3C;EACN;EACA,QAAQ;EACR;EACD,CAAC;CAEF,MAAM,EAAE,YAAY;CAEpB,MAAM,EAAE,QAAQ,QAAQ,QAAQ,QAAQ,SAASA,cAAiB;EAChE;EACA;EACD,CAAC;CAEF,MAAM,EAAE,SAAS,aAAaC,kBAA8B;CAQ5D,MAAM,kBAAkB,cAAc;AACpC,SAAO,2BAA2B,OAAO,WAAW;IACnD,CAAC,yBAAyB,OAAO,OAAO,CAAC;CAS5C,MAAM,iBAAiB,OAAO,CAAC,gBAAgB;AAK/C,iBAAgB;AACd,MAAI,gBACF,gBAAe,UAAU;IAE1B,CAAC,gBAAgB,CAAC;AAOrB,iBAAgB;AACd,MAAI,eAAe,QACjB,kBAAiB;AACf,WAAQ,KAA2B;KAClC,IAAI;IAGR,CAAC,OAAO,OAAO,CAAC;CAInB,MAAM,CAAC,kBAAkB,uBAAuB,SAAS,KAAK;CAI9D,MAAM,uBAAuB,kBAAkB;AAC/C,iBAAgB;AACd,MAAI,eAAe,QACjB,qBAAoB,CAAC,CAAC,qBAAqB;IAE5C,CAAC,qBAAqB,CAAC;CAK1B,MAAM,sBAAsB,cAAc;AACxC,SAAO,OACH,GAAG,eAAe,wBAAwB,MAAM,GAC/C,wBAAwB,EAAE;IAC9B,CAAC,MAAM,qBAAqB,CAAC;AAUhC,iBACQ;AACJ,MAAI,iBAAiB;AAGnB,YAAS,MAA4B,CAAC,oBAAoB,EAAS;IACjE,aAAa;IACb,aAAa;IACd,CAAC;AAGF,kBAAe,UAAU;AAKzB,OAAI,CAAC,wBAAwB,iBAC3B,kBAAiB;AACf,wBAAoB,MAAM;MACzB,EAAE;;IAUX,CAAC,gBAAgB,CAClB;AAED,QAAO;EAEL;EACA;EACA;EACA;EACA;EACA;EACA;EAEA,GAAG;EACJ"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_useWatchUserChange = require("../../useWatchUserChange-DkZ0Vqv3.cjs");
|
|
3
3
|
//#region src/hooks/useWatchUserChange/index.ts
|
|
4
4
|
/* v8 ignore stop */
|
|
5
|
-
|
|
6
5
|
//#endregion
|
|
7
6
|
exports.useWatchUserChange = require_useWatchUserChange.useWatchUserChange;
|
|
7
|
+
|
|
8
8
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as useWatchUserChange, t as UseWatchUserChangeOptions } from "../../useWatchUserChange-
|
|
1
|
+
import { n as useWatchUserChange, t as UseWatchUserChangeOptions } from "../../useWatchUserChange-CZu_ZZ38.cjs";
|
|
2
2
|
export { UseWatchUserChangeOptions, useWatchUserChange };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as useWatchUserChange, t as UseWatchUserChangeOptions } from "../../useWatchUserChange-
|
|
1
|
+
import { n as useWatchUserChange, t as UseWatchUserChangeOptions } from "../../useWatchUserChange-CH4x16_r.js";
|
|
2
2
|
export { UseWatchUserChangeOptions, useWatchUserChange };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { t as useWatchUserChange } from "../../useWatchUserChange-
|
|
2
|
-
|
|
1
|
+
import { t as useWatchUserChange } from "../../useWatchUserChange-CLgLc5W4.js";
|
|
3
2
|
//#region src/hooks/useWatchUserChange/index.ts
|
|
4
3
|
/* v8 ignore stop */
|
|
5
|
-
|
|
6
4
|
//#endregion
|
|
7
5
|
export { useWatchUserChange };
|
|
6
|
+
|
|
8
7
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,33 +1,32 @@
|
|
|
1
|
-
import
|
|
2
|
-
import * as
|
|
1
|
+
import { n as ClassNameValue, t as TVReturnType } from "./index-DsC0y6kU.cjs";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
3
|
import { TVClassName, TVProps } from "@fuf-stack/pixel-utils";
|
|
4
4
|
import { ReactNode } from "react";
|
|
5
|
-
|
|
6
5
|
//#region src/RadioBoxes/RadioBoxes.d.ts
|
|
7
|
-
declare const radioBoxesVariants:
|
|
6
|
+
declare const radioBoxesVariants: TVReturnType<{
|
|
8
7
|
[key: string]: {
|
|
9
|
-
[key: string]:
|
|
10
|
-
base?:
|
|
11
|
-
label?:
|
|
12
|
-
wrapper?:
|
|
13
|
-
boxBase?:
|
|
14
|
-
boxControl?:
|
|
15
|
-
boxDescription?:
|
|
16
|
-
boxLabel?:
|
|
17
|
-
boxLabelWrapper?:
|
|
8
|
+
[key: string]: ClassNameValue | {
|
|
9
|
+
base?: ClassNameValue;
|
|
10
|
+
label?: ClassNameValue;
|
|
11
|
+
wrapper?: ClassNameValue;
|
|
12
|
+
boxBase?: ClassNameValue;
|
|
13
|
+
boxControl?: ClassNameValue;
|
|
14
|
+
boxDescription?: ClassNameValue;
|
|
15
|
+
boxLabel?: ClassNameValue;
|
|
16
|
+
boxLabelWrapper?: ClassNameValue;
|
|
18
17
|
};
|
|
19
18
|
};
|
|
20
19
|
} | {
|
|
21
20
|
[x: string]: {
|
|
22
|
-
[x: string]:
|
|
23
|
-
base?:
|
|
24
|
-
label?:
|
|
25
|
-
wrapper?:
|
|
26
|
-
boxBase?:
|
|
27
|
-
boxControl?:
|
|
28
|
-
boxDescription?:
|
|
29
|
-
boxLabel?:
|
|
30
|
-
boxLabelWrapper?:
|
|
21
|
+
[x: string]: ClassNameValue | {
|
|
22
|
+
base?: ClassNameValue;
|
|
23
|
+
label?: ClassNameValue;
|
|
24
|
+
wrapper?: ClassNameValue;
|
|
25
|
+
boxBase?: ClassNameValue;
|
|
26
|
+
boxControl?: ClassNameValue;
|
|
27
|
+
boxDescription?: ClassNameValue;
|
|
28
|
+
boxLabel?: ClassNameValue;
|
|
29
|
+
boxLabelWrapper?: ClassNameValue;
|
|
31
30
|
};
|
|
32
31
|
};
|
|
33
32
|
} | {}, {
|
|
@@ -41,15 +40,15 @@ declare const radioBoxesVariants: tailwind_variants170.TVReturnType<{
|
|
|
41
40
|
wrapper: string;
|
|
42
41
|
}, undefined, {
|
|
43
42
|
[key: string]: {
|
|
44
|
-
[key: string]:
|
|
45
|
-
base?:
|
|
46
|
-
label?:
|
|
47
|
-
wrapper?:
|
|
48
|
-
boxBase?:
|
|
49
|
-
boxControl?:
|
|
50
|
-
boxDescription?:
|
|
51
|
-
boxLabel?:
|
|
52
|
-
boxLabelWrapper?:
|
|
43
|
+
[key: string]: ClassNameValue | {
|
|
44
|
+
base?: ClassNameValue;
|
|
45
|
+
label?: ClassNameValue;
|
|
46
|
+
wrapper?: ClassNameValue;
|
|
47
|
+
boxBase?: ClassNameValue;
|
|
48
|
+
boxControl?: ClassNameValue;
|
|
49
|
+
boxDescription?: ClassNameValue;
|
|
50
|
+
boxLabel?: ClassNameValue;
|
|
51
|
+
boxLabelWrapper?: ClassNameValue;
|
|
53
52
|
};
|
|
54
53
|
};
|
|
55
54
|
} | {}, {
|
|
@@ -61,7 +60,7 @@ declare const radioBoxesVariants: tailwind_variants170.TVReturnType<{
|
|
|
61
60
|
boxLabelWrapper: string;
|
|
62
61
|
label: string;
|
|
63
62
|
wrapper: string;
|
|
64
|
-
},
|
|
63
|
+
}, TVReturnType<unknown, {
|
|
65
64
|
base: string;
|
|
66
65
|
boxBase: string;
|
|
67
66
|
boxControl: string;
|
|
@@ -114,10 +113,10 @@ declare const RadioBoxes: ({
|
|
|
114
113
|
name,
|
|
115
114
|
options,
|
|
116
115
|
...uniformFieldProps
|
|
117
|
-
}: RadioBoxesProps) =>
|
|
116
|
+
}: RadioBoxesProps) => _$react_jsx_runtime0.JSX.Element;
|
|
118
117
|
//#endregion
|
|
119
118
|
//#region src/RadioBoxes/RadioBox.d.ts
|
|
120
|
-
declare const radioBoxVariants:
|
|
119
|
+
declare const radioBoxVariants: TVReturnType<{
|
|
121
120
|
isDisabled: {
|
|
122
121
|
true: {
|
|
123
122
|
base: string;
|
|
@@ -153,7 +152,7 @@ declare const radioBoxVariants: tailwind_variants170.TVReturnType<{
|
|
|
153
152
|
icon: string;
|
|
154
153
|
label: string;
|
|
155
154
|
labelWrapper: string;
|
|
156
|
-
},
|
|
155
|
+
}, TVReturnType<{
|
|
157
156
|
isDisabled: {
|
|
158
157
|
true: {
|
|
159
158
|
base: string;
|
|
@@ -174,4 +173,4 @@ declare const radioBoxVariants: tailwind_variants170.TVReturnType<{
|
|
|
174
173
|
}, undefined, unknown, unknown, undefined>>;
|
|
175
174
|
//#endregion
|
|
176
175
|
export { RadioBoxes as n, RadioBoxesProps as r, radioBoxVariants as t };
|
|
177
|
-
//# sourceMappingURL=index-
|
|
176
|
+
//# sourceMappingURL=index-1Gzrph8R.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-1Gzrph8R.d.cts","names":[],"sources":["../src/RadioBoxes/RadioBoxes.tsx","../src/RadioBoxes/RadioBox.tsx"],"mappings":";;;;;cAaa,kBAAA;;mBAcX,cAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAEG,YAAA,GAAe,OAAA,QAAe,kBAAA;AAAA,KAC9B,SAAA,GAAY,WAAA,QAAmB,kBAAA;AAAA,UAEnB,gBAAA;;EAEf,WAAA,GAAc,SAAA;;EAEd,QAAA;;EAEA,KAAA,GAAQ,SAAA;;EAER,IAAA,GAAO,SAAA;;EAEP,MAAA;;EAEA,KAAA;AAAA;AAAA,UAGe,eAAA,SAAwB,YAAA;;EAEvC,SAAA;;EAEA,SAAA,GAAY,SAAA;;EAEZ,QAAA;;EAEA,MAAA;;EAEA,KAAA,GAAQ,SAAA;;EAER,IAAA;;EAEA,OAAA,EAAS,gBAAA;;EAET,MAAA;AAAA;;;;cAMI,UAAA;EAAc,SAAA;EAAA,MAAA;EAAA,IAAA;EAAA,OAAA;EAAA,GAAA;AAAA,GAMjB,eAAA,KAAe,oBAAA,CAAA,GAAA,CAAA,OAAA;;;cClEL,gBAAA,EAqBX,YAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAAA,YAAA"}
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
import { n as ClassNameValue, t as TVReturnType } from "./index-DsC0y6kU.cjs";
|
|
2
|
+
import * as _$react_jsx_runtime0 from "react/jsx-runtime";
|
|
3
|
+
import { TVClassName, TVProps } from "@fuf-stack/pixel-utils";
|
|
4
|
+
import { ReactNode } from "react";
|
|
5
|
+
import { Props } from "react-select";
|
|
6
|
+
|
|
7
|
+
//#region src/Select/Select.d.ts
|
|
8
|
+
declare const selectVariants: TVReturnType<{
|
|
9
|
+
[key: string]: {
|
|
10
|
+
[key: string]: ClassNameValue | {
|
|
11
|
+
base?: ClassNameValue;
|
|
12
|
+
label?: ClassNameValue;
|
|
13
|
+
control?: ClassNameValue;
|
|
14
|
+
input?: ClassNameValue;
|
|
15
|
+
placeholder?: ClassNameValue;
|
|
16
|
+
menu?: ClassNameValue;
|
|
17
|
+
option?: ClassNameValue;
|
|
18
|
+
group?: ClassNameValue;
|
|
19
|
+
clearIndicator?: ClassNameValue;
|
|
20
|
+
control_focused?: ClassNameValue;
|
|
21
|
+
crossIcon?: ClassNameValue;
|
|
22
|
+
downChevron?: ClassNameValue;
|
|
23
|
+
dropdownIndicator?: ClassNameValue;
|
|
24
|
+
groupHeading?: ClassNameValue;
|
|
25
|
+
indicatorsContainer?: ClassNameValue;
|
|
26
|
+
indicatorSeparator?: ClassNameValue;
|
|
27
|
+
loadingIndicator?: ClassNameValue;
|
|
28
|
+
loadingMessage?: ClassNameValue;
|
|
29
|
+
menuList?: ClassNameValue;
|
|
30
|
+
menuPortal?: ClassNameValue;
|
|
31
|
+
multiValue?: ClassNameValue;
|
|
32
|
+
multiValueContainer?: ClassNameValue;
|
|
33
|
+
multiValueLabel?: ClassNameValue;
|
|
34
|
+
multiValueRemove?: ClassNameValue;
|
|
35
|
+
noOptionsMessage?: ClassNameValue;
|
|
36
|
+
option_focused?: ClassNameValue;
|
|
37
|
+
option_selected?: ClassNameValue;
|
|
38
|
+
selectContainer?: ClassNameValue;
|
|
39
|
+
singleValue?: ClassNameValue;
|
|
40
|
+
valueContainer?: ClassNameValue;
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
} | {
|
|
44
|
+
[x: string]: {
|
|
45
|
+
[x: string]: ClassNameValue | {
|
|
46
|
+
base?: ClassNameValue;
|
|
47
|
+
label?: ClassNameValue;
|
|
48
|
+
control?: ClassNameValue;
|
|
49
|
+
input?: ClassNameValue;
|
|
50
|
+
placeholder?: ClassNameValue;
|
|
51
|
+
menu?: ClassNameValue;
|
|
52
|
+
option?: ClassNameValue;
|
|
53
|
+
group?: ClassNameValue;
|
|
54
|
+
clearIndicator?: ClassNameValue;
|
|
55
|
+
control_focused?: ClassNameValue;
|
|
56
|
+
crossIcon?: ClassNameValue;
|
|
57
|
+
downChevron?: ClassNameValue;
|
|
58
|
+
dropdownIndicator?: ClassNameValue;
|
|
59
|
+
groupHeading?: ClassNameValue;
|
|
60
|
+
indicatorsContainer?: ClassNameValue;
|
|
61
|
+
indicatorSeparator?: ClassNameValue;
|
|
62
|
+
loadingIndicator?: ClassNameValue;
|
|
63
|
+
loadingMessage?: ClassNameValue;
|
|
64
|
+
menuList?: ClassNameValue;
|
|
65
|
+
menuPortal?: ClassNameValue;
|
|
66
|
+
multiValue?: ClassNameValue;
|
|
67
|
+
multiValueContainer?: ClassNameValue;
|
|
68
|
+
multiValueLabel?: ClassNameValue;
|
|
69
|
+
multiValueRemove?: ClassNameValue;
|
|
70
|
+
noOptionsMessage?: ClassNameValue;
|
|
71
|
+
option_focused?: ClassNameValue;
|
|
72
|
+
option_selected?: ClassNameValue;
|
|
73
|
+
selectContainer?: ClassNameValue;
|
|
74
|
+
singleValue?: ClassNameValue;
|
|
75
|
+
valueContainer?: ClassNameValue;
|
|
76
|
+
};
|
|
77
|
+
};
|
|
78
|
+
} | {}, {
|
|
79
|
+
base: string;
|
|
80
|
+
clearIndicator: string;
|
|
81
|
+
control: string;
|
|
82
|
+
control_focused: string;
|
|
83
|
+
crossIcon: string;
|
|
84
|
+
downChevron: string;
|
|
85
|
+
dropdownIndicator: string;
|
|
86
|
+
group: string;
|
|
87
|
+
groupHeading: string;
|
|
88
|
+
indicatorsContainer: string;
|
|
89
|
+
indicatorSeparator: string;
|
|
90
|
+
input: string;
|
|
91
|
+
label: string;
|
|
92
|
+
loadingIndicator: string;
|
|
93
|
+
loadingMessage: string;
|
|
94
|
+
menu: string;
|
|
95
|
+
menuList: string;
|
|
96
|
+
menuPortal: string;
|
|
97
|
+
multiValue: string;
|
|
98
|
+
multiValueContainer: string;
|
|
99
|
+
multiValueLabel: string;
|
|
100
|
+
multiValueRemove: string;
|
|
101
|
+
noOptionsMessage: string;
|
|
102
|
+
option_focused: string;
|
|
103
|
+
option_selected: string;
|
|
104
|
+
option: string;
|
|
105
|
+
placeholder: string;
|
|
106
|
+
selectContainer: string;
|
|
107
|
+
singleValue: string;
|
|
108
|
+
valueContainer: string;
|
|
109
|
+
}, undefined, {
|
|
110
|
+
[key: string]: {
|
|
111
|
+
[key: string]: ClassNameValue | {
|
|
112
|
+
base?: ClassNameValue;
|
|
113
|
+
label?: ClassNameValue;
|
|
114
|
+
control?: ClassNameValue;
|
|
115
|
+
input?: ClassNameValue;
|
|
116
|
+
placeholder?: ClassNameValue;
|
|
117
|
+
menu?: ClassNameValue;
|
|
118
|
+
option?: ClassNameValue;
|
|
119
|
+
group?: ClassNameValue;
|
|
120
|
+
clearIndicator?: ClassNameValue;
|
|
121
|
+
control_focused?: ClassNameValue;
|
|
122
|
+
crossIcon?: ClassNameValue;
|
|
123
|
+
downChevron?: ClassNameValue;
|
|
124
|
+
dropdownIndicator?: ClassNameValue;
|
|
125
|
+
groupHeading?: ClassNameValue;
|
|
126
|
+
indicatorsContainer?: ClassNameValue;
|
|
127
|
+
indicatorSeparator?: ClassNameValue;
|
|
128
|
+
loadingIndicator?: ClassNameValue;
|
|
129
|
+
loadingMessage?: ClassNameValue;
|
|
130
|
+
menuList?: ClassNameValue;
|
|
131
|
+
menuPortal?: ClassNameValue;
|
|
132
|
+
multiValue?: ClassNameValue;
|
|
133
|
+
multiValueContainer?: ClassNameValue;
|
|
134
|
+
multiValueLabel?: ClassNameValue;
|
|
135
|
+
multiValueRemove?: ClassNameValue;
|
|
136
|
+
noOptionsMessage?: ClassNameValue;
|
|
137
|
+
option_focused?: ClassNameValue;
|
|
138
|
+
option_selected?: ClassNameValue;
|
|
139
|
+
selectContainer?: ClassNameValue;
|
|
140
|
+
singleValue?: ClassNameValue;
|
|
141
|
+
valueContainer?: ClassNameValue;
|
|
142
|
+
};
|
|
143
|
+
};
|
|
144
|
+
} | {}, {
|
|
145
|
+
base: string;
|
|
146
|
+
clearIndicator: string;
|
|
147
|
+
control: string;
|
|
148
|
+
control_focused: string;
|
|
149
|
+
crossIcon: string;
|
|
150
|
+
downChevron: string;
|
|
151
|
+
dropdownIndicator: string;
|
|
152
|
+
group: string;
|
|
153
|
+
groupHeading: string;
|
|
154
|
+
indicatorsContainer: string;
|
|
155
|
+
indicatorSeparator: string;
|
|
156
|
+
input: string;
|
|
157
|
+
label: string;
|
|
158
|
+
loadingIndicator: string;
|
|
159
|
+
loadingMessage: string;
|
|
160
|
+
menu: string;
|
|
161
|
+
menuList: string;
|
|
162
|
+
menuPortal: string;
|
|
163
|
+
multiValue: string;
|
|
164
|
+
multiValueContainer: string;
|
|
165
|
+
multiValueLabel: string;
|
|
166
|
+
multiValueRemove: string;
|
|
167
|
+
noOptionsMessage: string;
|
|
168
|
+
option_focused: string;
|
|
169
|
+
option_selected: string;
|
|
170
|
+
option: string;
|
|
171
|
+
placeholder: string;
|
|
172
|
+
selectContainer: string;
|
|
173
|
+
singleValue: string;
|
|
174
|
+
valueContainer: string;
|
|
175
|
+
}, TVReturnType<unknown, {
|
|
176
|
+
base: string;
|
|
177
|
+
clearIndicator: string;
|
|
178
|
+
control: string;
|
|
179
|
+
control_focused: string;
|
|
180
|
+
crossIcon: string;
|
|
181
|
+
downChevron: string;
|
|
182
|
+
dropdownIndicator: string;
|
|
183
|
+
group: string;
|
|
184
|
+
groupHeading: string;
|
|
185
|
+
indicatorsContainer: string;
|
|
186
|
+
indicatorSeparator: string;
|
|
187
|
+
input: string;
|
|
188
|
+
label: string;
|
|
189
|
+
loadingIndicator: string;
|
|
190
|
+
loadingMessage: string;
|
|
191
|
+
menu: string;
|
|
192
|
+
menuList: string;
|
|
193
|
+
menuPortal: string;
|
|
194
|
+
multiValue: string;
|
|
195
|
+
multiValueContainer: string;
|
|
196
|
+
multiValueLabel: string;
|
|
197
|
+
multiValueRemove: string;
|
|
198
|
+
noOptionsMessage: string;
|
|
199
|
+
option_focused: string;
|
|
200
|
+
option_selected: string;
|
|
201
|
+
option: string;
|
|
202
|
+
placeholder: string;
|
|
203
|
+
selectContainer: string;
|
|
204
|
+
singleValue: string;
|
|
205
|
+
valueContainer: string;
|
|
206
|
+
}, undefined, unknown, unknown, undefined>>;
|
|
207
|
+
interface SelectOption {
|
|
208
|
+
/**
|
|
209
|
+
* True when option was auto-generated because the value wasn't found in options.
|
|
210
|
+
* Use in renderOptionLabel to render a component that fetches the real label.
|
|
211
|
+
*/
|
|
212
|
+
isFallback?: boolean;
|
|
213
|
+
/** option label */
|
|
214
|
+
label?: ReactNode;
|
|
215
|
+
/** option value */
|
|
216
|
+
value: string | number;
|
|
217
|
+
}
|
|
218
|
+
type VariantProps = TVProps<typeof selectVariants>;
|
|
219
|
+
type ClassName = TVClassName<typeof selectVariants>;
|
|
220
|
+
interface SelectProps extends VariantProps {
|
|
221
|
+
/** Custom aria-label for accessibility. If not provided, falls back to field name when no visible label exists */
|
|
222
|
+
ariaLabel?: string;
|
|
223
|
+
/** CSS class name */
|
|
224
|
+
className?: ClassName;
|
|
225
|
+
/** Determine if the */
|
|
226
|
+
clearable?: boolean;
|
|
227
|
+
/** Set the select to disabled state. */
|
|
228
|
+
disabled?: boolean;
|
|
229
|
+
/** Filter Select Options */
|
|
230
|
+
filterOption?: undefined | ((option?: SelectOption, inputValue?: string) => boolean);
|
|
231
|
+
/** Format the label of the option */
|
|
232
|
+
renderOptionLabel?: undefined | Props['formatOptionLabel'];
|
|
233
|
+
/** The value of the search input */
|
|
234
|
+
inputValue?: string;
|
|
235
|
+
/** Label that should be associated with the select. */
|
|
236
|
+
label?: ReactNode;
|
|
237
|
+
/** Set the select to a loading state. */
|
|
238
|
+
loading?: boolean;
|
|
239
|
+
/** switch between single and multi select mode. */
|
|
240
|
+
multiSelect?: boolean;
|
|
241
|
+
/** The name for the Select component, used by react-hook-form */
|
|
242
|
+
name: string;
|
|
243
|
+
/** Placeholder that is displayed when nothing is selected */
|
|
244
|
+
placeholder?: string;
|
|
245
|
+
/** The options for the Select component */
|
|
246
|
+
options: SelectOption[];
|
|
247
|
+
/** Handle change events on the input */
|
|
248
|
+
onInputChange?: Props['onInputChange'];
|
|
249
|
+
/**
|
|
250
|
+
* Fallback option(s) for async selects when value isn't in current options.
|
|
251
|
+
* Use when the selected value may not be in the options list (e.g., after
|
|
252
|
+
* search results change). Used only if value not found in options.
|
|
253
|
+
* For single select: pass the option object or undefined
|
|
254
|
+
* For multi-select: pass an array of option objects
|
|
255
|
+
*/
|
|
256
|
+
selectedOptionFallback?: SelectOption | SelectOption[];
|
|
257
|
+
/** HTML data-testid attribute used in e2e tests */
|
|
258
|
+
testId?: string;
|
|
259
|
+
}
|
|
260
|
+
/** Select component based on [HeroUI Select](https://www.heroui.com//docs/components/select) and [React-Select](https://react-select.com/home) */
|
|
261
|
+
declare const Select: ({
|
|
262
|
+
className,
|
|
263
|
+
clearable,
|
|
264
|
+
filterOption,
|
|
265
|
+
renderOptionLabel,
|
|
266
|
+
inputValue,
|
|
267
|
+
loading,
|
|
268
|
+
multiSelect,
|
|
269
|
+
name,
|
|
270
|
+
onInputChange,
|
|
271
|
+
options,
|
|
272
|
+
placeholder,
|
|
273
|
+
selectedOptionFallback,
|
|
274
|
+
...uniformFieldProps
|
|
275
|
+
}: SelectProps) => _$react_jsx_runtime0.JSX.Element;
|
|
276
|
+
//#endregion
|
|
277
|
+
export { SelectProps as n, Select as t };
|
|
278
|
+
//# sourceMappingURL=index-B0Fw1BAy.d.cts.map
|