@fuf-stack/uniform 1.10.3 → 1.11.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 +4 -18
- package/dist/Checkboxes/index.d.cts +2 -11
- package/dist/Checkboxes/index.d.ts +2 -11
- package/dist/Checkboxes/index.js +3 -19
- package/dist/Checkboxes-CGWhnpBp.js +115 -0
- package/dist/Checkboxes-CGWhnpBp.js.map +1 -0
- package/dist/Checkboxes-Ds6bzl6p.cjs +127 -0
- package/dist/Checkboxes-Ds6bzl6p.cjs.map +1 -0
- package/dist/FieldArray/index.cjs +4 -21
- package/dist/FieldArray/index.d.cts +2 -10
- package/dist/FieldArray/index.d.ts +2 -10
- package/dist/FieldArray/index.js +3 -22
- package/dist/FieldArray-BexXN9bO.cjs +515 -0
- package/dist/FieldArray-BexXN9bO.cjs.map +1 -0
- package/dist/FieldArray-D3iUaRLo.js +503 -0
- package/dist/FieldArray-D3iUaRLo.js.map +1 -0
- package/dist/FieldCard/index.cjs +3 -18
- package/dist/FieldCard/index.d.cts +2 -97
- package/dist/FieldCard/index.d.ts +2 -97
- package/dist/FieldCard/index.js +3 -19
- package/dist/FieldCard-mpmErfDK.js +121 -0
- package/dist/FieldCard-mpmErfDK.js.map +1 -0
- package/dist/FieldCard-pP7aniZU.cjs +133 -0
- package/dist/FieldCard-pP7aniZU.cjs.map +1 -0
- package/dist/FieldCopyTestIdButton-AaLwu_8y.cjs +41 -0
- package/dist/FieldCopyTestIdButton-AaLwu_8y.cjs.map +1 -0
- package/dist/FieldCopyTestIdButton-Cx8AXJhO.js +29 -0
- package/dist/FieldCopyTestIdButton-Cx8AXJhO.js.map +1 -0
- package/dist/FieldValidationError-Cq6aI0tE.cjs +65 -0
- package/dist/FieldValidationError-Cq6aI0tE.cjs.map +1 -0
- package/dist/FieldValidationError-D86DPSOH.js +53 -0
- package/dist/FieldValidationError-D86DPSOH.js.map +1 -0
- package/dist/Form/index.cjs +4 -13
- package/dist/Form/index.d.cts +2 -11
- package/dist/Form/index.d.ts +3 -11
- package/dist/Form/index.js +3 -14
- package/dist/Form-CFmCTl60.js +119 -0
- package/dist/Form-CFmCTl60.js.map +1 -0
- package/dist/Form-FvN3SXfF.cjs +130 -0
- package/dist/Form-FvN3SXfF.cjs.map +1 -0
- package/dist/FormContext-C2_WMi_v.d.ts +18 -0
- package/dist/FormContext-C2_WMi_v.d.ts.map +1 -0
- package/dist/FormContext-C3GymQOA.cjs +275 -0
- package/dist/FormContext-C3GymQOA.cjs.map +1 -0
- package/dist/FormContext-CN9n_KdE.js +229 -0
- package/dist/FormContext-CN9n_KdE.js.map +1 -0
- package/dist/FormContext-Dl7KL_wl.d.cts +18 -0
- package/dist/FormContext-Dl7KL_wl.d.cts.map +1 -0
- package/dist/Grid/index.cjs +4 -9
- package/dist/Grid/index.d.cts +2 -8
- package/dist/Grid/index.d.ts +2 -8
- package/dist/Grid/index.js +3 -10
- package/dist/Grid-DEH7Sezi.js +23 -0
- package/dist/Grid-DEH7Sezi.js.map +1 -0
- package/dist/Grid-DG60vYYG.cjs +35 -0
- package/dist/Grid-DG60vYYG.cjs.map +1 -0
- package/dist/Input/index.cjs +4 -19
- package/dist/Input/index.d.cts +2 -11
- package/dist/Input/index.d.ts +2 -11
- package/dist/Input/index.js +3 -20
- package/dist/Input--h5t7Sbl.js +94 -0
- package/dist/Input--h5t7Sbl.js.map +1 -0
- package/dist/Input-DKfFFOpo.cjs +106 -0
- package/dist/Input-DKfFFOpo.cjs.map +1 -0
- package/dist/RadioBoxes/index.cjs +5 -20
- package/dist/RadioBoxes/index.d.cts +2 -10
- package/dist/RadioBoxes/index.d.ts +2 -10
- package/dist/RadioBoxes/index.js +3 -21
- package/dist/RadioBoxes-7qdHj3ti.js +138 -0
- package/dist/RadioBoxes-7qdHj3ti.js.map +1 -0
- package/dist/RadioBoxes-Bd9ahl4i.cjs +156 -0
- package/dist/RadioBoxes-Bd9ahl4i.cjs.map +1 -0
- package/dist/RadioTabs/index.cjs +4 -18
- package/dist/RadioTabs/index.d.cts +2 -10
- package/dist/RadioTabs/index.d.ts +2 -10
- package/dist/RadioTabs/index.js +3 -19
- package/dist/RadioTabs-DXs98jng.js +119 -0
- package/dist/RadioTabs-DXs98jng.js.map +1 -0
- package/dist/RadioTabs-DcEUdW7r.cjs +132 -0
- package/dist/RadioTabs-DcEUdW7r.cjs.map +1 -0
- package/dist/Radios/index.cjs +4 -18
- package/dist/Radios/index.d.cts +2 -9
- package/dist/Radios/index.d.ts +2 -9
- package/dist/Radios/index.js +3 -19
- package/dist/Radios-BIx06mzU.js +75 -0
- package/dist/Radios-BIx06mzU.js.map +1 -0
- package/dist/Radios-CIPNqPzi.cjs +87 -0
- package/dist/Radios-CIPNqPzi.cjs.map +1 -0
- package/dist/Select/index.cjs +4 -19
- package/dist/Select/index.d.cts +2 -11
- package/dist/Select/index.d.ts +2 -11
- package/dist/Select/index.js +3 -20
- package/dist/Select-BsL7qn2v.cjs +246 -0
- package/dist/Select-BsL7qn2v.cjs.map +1 -0
- package/dist/Select-CBjqYDcs.js +233 -0
- package/dist/Select-CBjqYDcs.js.map +1 -0
- package/dist/Slider/index.cjs +4 -18
- package/dist/Slider/index.d.cts +2 -10
- package/dist/Slider/index.d.ts +2 -10
- package/dist/Slider/index.js +3 -19
- package/dist/Slider-BDLbD7d5.cjs +123 -0
- package/dist/Slider-BDLbD7d5.cjs.map +1 -0
- package/dist/Slider-BHjHSoIk.js +111 -0
- package/dist/Slider-BHjHSoIk.js.map +1 -0
- package/dist/SubmitButton/index.cjs +4 -13
- package/dist/SubmitButton/index.d.cts +2 -9
- package/dist/SubmitButton/index.d.ts +2 -9
- package/dist/SubmitButton/index.js +3 -14
- package/dist/SubmitButton-7iOaKzhB.js +34 -0
- package/dist/SubmitButton-7iOaKzhB.js.map +1 -0
- package/dist/SubmitButton-DhtPJuro.cjs +46 -0
- package/dist/SubmitButton-DhtPJuro.cjs.map +1 -0
- package/dist/Switch/index.cjs +4 -18
- package/dist/Switch/index.d.cts +2 -11
- package/dist/Switch/index.d.ts +2 -11
- package/dist/Switch/index.js +3 -19
- package/dist/Switch-DCxAgt_L.js +84 -0
- package/dist/Switch-DCxAgt_L.js.map +1 -0
- package/dist/Switch-Dczzog3v.cjs +96 -0
- package/dist/Switch-Dczzog3v.cjs.map +1 -0
- package/dist/SwitchBox/index.cjs +5 -20
- package/dist/SwitchBox/index.d.cts +2 -11
- package/dist/SwitchBox/index.d.ts +2 -11
- package/dist/SwitchBox/index.js +3 -21
- package/dist/SwitchBox-DPHryDOM.js +156 -0
- package/dist/SwitchBox-DPHryDOM.js.map +1 -0
- package/dist/SwitchBox-DqVmZYId.cjs +174 -0
- package/dist/SwitchBox-DqVmZYId.cjs.map +1 -0
- package/dist/TextArea/index.cjs +4 -19
- package/dist/TextArea/index.d.cts +2 -10
- package/dist/TextArea/index.d.ts +2 -10
- package/dist/TextArea/index.js +3 -20
- package/dist/TextArea-BR6e-Fio.js +64 -0
- package/dist/TextArea-BR6e-Fio.js.map +1 -0
- package/dist/TextArea-CH-F6_ax.cjs +76 -0
- package/dist/TextArea-CH-F6_ax.cjs.map +1 -0
- package/dist/helpers/index.cjs +8 -18
- package/dist/helpers/index.d.cts +2 -132
- package/dist/helpers/index.d.ts +2 -132
- package/dist/helpers/index.js +3 -18
- package/dist/helpers-B-CJOBt3.js +236 -0
- package/dist/helpers-B-CJOBt3.js.map +1 -0
- package/dist/helpers-KTgXi0lA.cjs +272 -0
- package/dist/helpers-KTgXi0lA.cjs.map +1 -0
- package/dist/hooks/useClientValidation/index.cjs +6 -10
- package/dist/hooks/useClientValidation/index.cjs.map +1 -1
- package/dist/hooks/useClientValidation/index.d.cts +2 -147
- package/dist/hooks/useClientValidation/index.d.ts +2 -147
- package/dist/hooks/useClientValidation/index.js +7 -12
- package/dist/hooks/useClientValidation/index.js.map +1 -1
- package/dist/hooks/useController/index.cjs +5 -7
- package/dist/hooks/useController/index.cjs.map +1 -1
- package/dist/hooks/useController/index.d.cts +2 -29
- package/dist/hooks/useController/index.d.ts +3 -29
- package/dist/hooks/useController/index.js +7 -9
- package/dist/hooks/useController/index.js.map +1 -1
- package/dist/hooks/useFormContext/index.cjs +3 -12
- package/dist/hooks/useFormContext/index.d.cts +2 -62
- package/dist/hooks/useFormContext/index.d.ts +4 -62
- package/dist/hooks/useFormContext/index.js +3 -13
- package/dist/hooks/useInput/index.cjs +11 -5
- package/dist/hooks/useInput/index.cjs.map +1 -1
- package/dist/hooks/useInput/index.d.cts +2 -1
- package/dist/hooks/useInput/index.d.ts +2 -1
- package/dist/hooks/useInput/index.js +7 -7
- package/dist/hooks/useInput/index.js.map +1 -1
- package/dist/hooks/useInputValueDebounce/index.cjs +2 -7
- package/dist/hooks/useInputValueDebounce/index.d.cts +2 -55
- package/dist/hooks/useInputValueDebounce/index.d.ts +2 -55
- package/dist/hooks/useInputValueDebounce/index.js +3 -8
- package/dist/hooks/useInputValueTransform/index.cjs +5 -5
- package/dist/hooks/useInputValueTransform/index.cjs.map +1 -1
- package/dist/hooks/useInputValueTransform/index.d.cts +2 -102
- package/dist/hooks/useInputValueTransform/index.d.ts +2 -102
- package/dist/hooks/useInputValueTransform/index.js +7 -7
- package/dist/hooks/useInputValueTransform/index.js.map +1 -1
- package/dist/hooks/useUniformField/index.cjs +2 -15
- package/dist/hooks/useUniformField/index.d.cts +2 -98
- package/dist/hooks/useUniformField/index.d.ts +6 -98
- package/dist/hooks/useUniformField/index.js +3 -16
- package/dist/hooks/useUniformFieldArray/index.cjs +2 -17
- package/dist/hooks/useUniformFieldArray/index.d.cts +2 -71
- package/dist/hooks/useUniformFieldArray/index.d.ts +7 -71
- package/dist/hooks/useUniformFieldArray/index.js +3 -18
- package/dist/hooks/useWatchUserChange/index.cjs +5 -8
- package/dist/hooks/useWatchUserChange/index.cjs.map +1 -1
- package/dist/hooks/useWatchUserChange/index.d.cts +2 -73
- package/dist/hooks/useWatchUserChange/index.d.ts +2 -73
- package/dist/hooks/useWatchUserChange/index.js +7 -10
- package/dist/hooks/useWatchUserChange/index.js.map +1 -1
- package/dist/index-1gPh6Uoh.d.cts +16 -0
- package/dist/index-1gPh6Uoh.d.cts.map +1 -0
- package/dist/index-B3Z8gdjC.d.ts +1 -0
- package/dist/index-B4Wkijem.d.ts +169 -0
- package/dist/index-B4Wkijem.d.ts.map +1 -0
- package/dist/index-B74QlCAy.d.cts +169 -0
- package/dist/index-B74QlCAy.d.cts.map +1 -0
- package/dist/index-BLREDRDJ.d.cts +1 -0
- package/dist/index-BM4XWo1K.d.ts +118 -0
- package/dist/index-BM4XWo1K.d.ts.map +1 -0
- package/dist/index-BMN2XNyT.d.cts +23 -0
- package/dist/index-BMN2XNyT.d.cts.map +1 -0
- package/dist/index-BOI0cy-n.d.cts +118 -0
- package/dist/index-BOI0cy-n.d.cts.map +1 -0
- package/dist/index-BTEsKen4.d.ts +264 -0
- package/dist/index-BTEsKen4.d.ts.map +1 -0
- package/dist/index-BW9EUWZE.d.cts +23 -0
- package/dist/index-BW9EUWZE.d.cts.map +1 -0
- package/dist/index-BXpMZvwA.d.cts +1 -0
- package/dist/index-BYrmFhKl.d.ts +1 -0
- package/dist/index-BaBZGCqS.d.cts +177 -0
- package/dist/index-BaBZGCqS.d.cts.map +1 -0
- package/dist/index-C1fYmoY0.d.ts +123 -0
- package/dist/index-C1fYmoY0.d.ts.map +1 -0
- package/dist/index-C56I3SOi.d.cts +148 -0
- package/dist/index-C56I3SOi.d.cts.map +1 -0
- package/dist/index-CHmS3ri3.d.ts +16 -0
- package/dist/index-CHmS3ri3.d.ts.map +1 -0
- package/dist/index-CI9QBUoM.d.cts +97 -0
- package/dist/index-CI9QBUoM.d.cts.map +1 -0
- package/dist/index-CJNLQVjx.d.ts +1 -0
- package/dist/index-CO-l7RmT.d.cts +181 -0
- package/dist/index-CO-l7RmT.d.cts.map +1 -0
- package/dist/index-CQWoxgWk.d.ts +23 -0
- package/dist/index-CQWoxgWk.d.ts.map +1 -0
- package/dist/index-CVY05bZf.d.ts +39 -0
- package/dist/index-CVY05bZf.d.ts.map +1 -0
- package/dist/index-C_ATGeaX.d.ts +104 -0
- package/dist/index-C_ATGeaX.d.ts.map +1 -0
- package/dist/index-CbAh0Kfo.d.cts +39 -0
- package/dist/index-CbAh0Kfo.d.cts.map +1 -0
- package/dist/index-CqV2Q3da.d.cts +264 -0
- package/dist/index-CqV2Q3da.d.cts.map +1 -0
- package/dist/index-CraZe1qS.d.ts +97 -0
- package/dist/index-CraZe1qS.d.ts.map +1 -0
- package/dist/index-CvA5yKx9.d.ts +177 -0
- package/dist/index-CvA5yKx9.d.ts.map +1 -0
- package/dist/index-CwSIy_W-.d.cts +1 -0
- package/dist/index-CzypMcVS.d.cts +104 -0
- package/dist/index-CzypMcVS.d.cts.map +1 -0
- package/dist/index-D6RB3b5L.d.ts +148 -0
- package/dist/index-D6RB3b5L.d.ts.map +1 -0
- package/dist/index-DA5um0u6.d.cts +123 -0
- package/dist/index-DA5um0u6.d.cts.map +1 -0
- package/dist/index-DHHBSmJb.d.ts +23 -0
- package/dist/index-DHHBSmJb.d.ts.map +1 -0
- package/dist/index-DhMSgdwM.d.ts +156 -0
- package/dist/index-DhMSgdwM.d.ts.map +1 -0
- package/dist/index-Dklb-p_1.d.cts +156 -0
- package/dist/index-Dklb-p_1.d.cts.map +1 -0
- package/dist/index-DpD4MxGD.d.cts +177 -0
- package/dist/index-DpD4MxGD.d.cts.map +1 -0
- package/dist/index-Drl7euco.d.ts +115 -0
- package/dist/index-Drl7euco.d.ts.map +1 -0
- package/dist/index-DzuP5q-2.d.ts +181 -0
- package/dist/index-DzuP5q-2.d.ts.map +1 -0
- package/dist/index-G0IgQWoU.d.cts +134 -0
- package/dist/index-G0IgQWoU.d.cts.map +1 -0
- package/dist/index-RvYO46Vg.d.ts +178 -0
- package/dist/index-RvYO46Vg.d.ts.map +1 -0
- package/dist/index-UjKqRe-8.d.ts +134 -0
- package/dist/index-UjKqRe-8.d.ts.map +1 -0
- package/dist/index-aHcGnXHf.d.ts +44 -0
- package/dist/index-aHcGnXHf.d.ts.map +1 -0
- package/dist/index-iuLEYAix.d.cts +115 -0
- package/dist/index-iuLEYAix.d.cts.map +1 -0
- package/dist/index-jmQP58tO.d.cts +44 -0
- package/dist/index-jmQP58tO.d.cts.map +1 -0
- package/dist/index.cjs +75 -133
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +28 -38
- package/dist/index.d.ts +31 -38
- package/dist/index.js +33 -133
- package/dist/index.js.map +1 -1
- package/dist/partials/FieldCopyTestIdButton/index.cjs +4 -9
- package/dist/partials/FieldCopyTestIdButton/index.d.cts +2 -7
- package/dist/partials/FieldCopyTestIdButton/index.d.ts +2 -7
- package/dist/partials/FieldCopyTestIdButton/index.js +3 -10
- package/dist/partials/FieldValidationError/index.cjs +4 -9
- package/dist/partials/FieldValidationError/index.d.cts +2 -8
- package/dist/partials/FieldValidationError/index.d.ts +2 -8
- package/dist/partials/FieldValidationError/index.js +3 -10
- package/dist/useClientValidation-BnnscAEe.js +179 -0
- package/dist/useClientValidation-BnnscAEe.js.map +1 -0
- package/dist/useClientValidation-C3Q5UCy9.d.cts +150 -0
- package/dist/useClientValidation-C3Q5UCy9.d.cts.map +1 -0
- package/dist/useClientValidation-CkBtUSco.d.ts +150 -0
- package/dist/useClientValidation-CkBtUSco.d.ts.map +1 -0
- package/dist/useClientValidation-oZd4_ocQ.cjs +191 -0
- package/dist/useClientValidation-oZd4_ocQ.cjs.map +1 -0
- package/dist/useController-BzkCcbSo.cjs +48 -0
- package/dist/useController-BzkCcbSo.cjs.map +1 -0
- package/dist/useController-C_MZLZIp.d.cts +31 -0
- package/dist/useController-C_MZLZIp.d.cts.map +1 -0
- package/dist/useController-CumIERks.js +43 -0
- package/dist/useController-CumIERks.js.map +1 -0
- package/dist/useController-hjpJQf0w.d.ts +31 -0
- package/dist/useController-hjpJQf0w.d.ts.map +1 -0
- package/dist/useFormContext-356X5XAY.js +6 -0
- package/dist/useFormContext-356X5XAY.js.map +1 -0
- package/dist/useFormContext-3AAPT6eZ.d.ts +64 -0
- package/dist/useFormContext-3AAPT6eZ.d.ts.map +1 -0
- package/dist/useFormContext-CWuN-_7P.cjs +134 -0
- package/dist/useFormContext-CWuN-_7P.cjs.map +1 -0
- package/dist/useFormContext-CZh7pv8f.d.cts +64 -0
- package/dist/useFormContext-CZh7pv8f.d.cts.map +1 -0
- package/dist/useFormContext-CkeSOfWD.cjs +6 -0
- package/dist/useFormContext-CkeSOfWD.cjs.map +1 -0
- package/dist/useFormContext-JCm1UR_e.js +123 -0
- package/dist/useFormContext-JCm1UR_e.js.map +1 -0
- package/dist/useInput-DZ6KGBxw.js +3 -0
- package/dist/useInput-IGJqJ2tR.d.ts +2 -0
- package/dist/useInput-NMHJNZ5A.d.cts +2 -0
- package/dist/useInputValueDebounce-B2RzCWty.d.cts +62 -0
- package/dist/useInputValueDebounce-B2RzCWty.d.cts.map +1 -0
- package/dist/useInputValueDebounce-C7_bvNGH.d.ts +62 -0
- package/dist/useInputValueDebounce-C7_bvNGH.d.ts.map +1 -0
- package/dist/useInputValueDebounce-DaH5ONlQ.js +84 -0
- package/dist/useInputValueDebounce-DaH5ONlQ.js.map +1 -0
- package/dist/useInputValueDebounce-tL8maIp8.cjs +90 -0
- package/dist/useInputValueDebounce-tL8maIp8.cjs.map +1 -0
- package/dist/useInputValueTransform-BID-CQ-y.d.cts +107 -0
- package/dist/useInputValueTransform-BID-CQ-y.d.cts.map +1 -0
- package/dist/useInputValueTransform-C-uSW8Y3.cjs +116 -0
- package/dist/useInputValueTransform-C-uSW8Y3.cjs.map +1 -0
- package/dist/useInputValueTransform-D7LfyYRe.d.ts +107 -0
- package/dist/useInputValueTransform-D7LfyYRe.d.ts.map +1 -0
- package/dist/useInputValueTransform-aiIf8lq5.js +110 -0
- package/dist/useInputValueTransform-aiIf8lq5.js.map +1 -0
- package/dist/useUniformField-BMvnRC_r.cjs +136 -0
- package/dist/useUniformField-BMvnRC_r.cjs.map +1 -0
- package/dist/useUniformField-Be3kdnhK.d.cts +98 -0
- package/dist/useUniformField-Be3kdnhK.d.cts.map +1 -0
- package/dist/useUniformField-ClprfrES.js +129 -0
- package/dist/useUniformField-ClprfrES.js.map +1 -0
- package/dist/useUniformField-DDHQ5B11.d.ts +98 -0
- package/dist/useUniformField-DDHQ5B11.d.ts.map +1 -0
- package/dist/useUniformFieldArray-BBFw08qL.d.cts +79 -0
- package/dist/useUniformFieldArray-BBFw08qL.d.cts.map +1 -0
- package/dist/useUniformFieldArray-BhPi3gPv.d.ts +79 -0
- package/dist/useUniformFieldArray-BhPi3gPv.d.ts.map +1 -0
- package/dist/useUniformFieldArray-C-0OXG3N.js +84 -0
- package/dist/useUniformFieldArray-C-0OXG3N.js.map +1 -0
- package/dist/useUniformFieldArray-btjvJdZ6.cjs +90 -0
- package/dist/useUniformFieldArray-btjvJdZ6.cjs.map +1 -0
- package/dist/useWatchUserChange-BAdiqg2q.d.ts +78 -0
- package/dist/useWatchUserChange-BAdiqg2q.d.ts.map +1 -0
- package/dist/useWatchUserChange-C1ezpj0t.js +83 -0
- package/dist/useWatchUserChange-C1ezpj0t.js.map +1 -0
- package/dist/useWatchUserChange-C5dr12By.cjs +89 -0
- package/dist/useWatchUserChange-C5dr12By.cjs.map +1 -0
- package/dist/useWatchUserChange-COVdHmki.d.cts +78 -0
- package/dist/useWatchUserChange-COVdHmki.d.cts.map +1 -0
- package/package.json +73 -100
- package/dist/Checkboxes/index.cjs.map +0 -1
- package/dist/Checkboxes/index.js.map +0 -1
- package/dist/Checkboxes-CBgO9itq.d.cts +0 -171
- package/dist/Checkboxes-CFbsc6zg.d.ts +0 -171
- package/dist/FieldArray/index.cjs.map +0 -1
- package/dist/FieldArray/index.js.map +0 -1
- package/dist/FieldArray-72vn2MG9.d.cts +0 -160
- package/dist/FieldArray-72vn2MG9.d.ts +0 -160
- package/dist/FieldCard/index.cjs.map +0 -1
- package/dist/FieldCard/index.js.map +0 -1
- package/dist/FieldCopyTestIdButton-_TDlmw0L.d.cts +0 -11
- package/dist/FieldCopyTestIdButton-_TDlmw0L.d.ts +0 -11
- package/dist/FieldValidationError-DwtLkGMo.d.cts +0 -17
- package/dist/FieldValidationError-DwtLkGMo.d.ts +0 -17
- package/dist/Form/index.cjs.map +0 -1
- package/dist/Form/index.js.map +0 -1
- package/dist/Form-BZZJPLsi.d.cts +0 -32
- package/dist/Form-zsUjI2yq.d.ts +0 -32
- package/dist/FormContext-9Firwt4k.d.cts +0 -14
- package/dist/FormContext-9Firwt4k.d.ts +0 -14
- package/dist/Grid/index.cjs.map +0 -1
- package/dist/Grid/index.js.map +0 -1
- package/dist/Grid-DF3L9NF3.d.cts +0 -17
- package/dist/Grid-DF3L9NF3.d.ts +0 -17
- package/dist/Input/index.cjs.map +0 -1
- package/dist/Input/index.js.map +0 -1
- package/dist/Input-BGYDOpbo.d.cts +0 -101
- package/dist/Input-__SqMh2n.d.ts +0 -101
- package/dist/RadioBox-DnqCiTR1.d.cts +0 -168
- package/dist/RadioBox-DnqCiTR1.d.ts +0 -168
- package/dist/RadioBoxes/index.cjs.map +0 -1
- package/dist/RadioBoxes/index.js.map +0 -1
- package/dist/RadioTabs/index.cjs.map +0 -1
- package/dist/RadioTabs/index.js.map +0 -1
- package/dist/RadioTabs-DkR5fvl4.d.cts +0 -138
- package/dist/RadioTabs-DkR5fvl4.d.ts +0 -138
- package/dist/Radios/index.cjs.map +0 -1
- package/dist/Radios/index.js.map +0 -1
- package/dist/Radios-lLVlvY_B.d.cts +0 -115
- package/dist/Radios-lLVlvY_B.d.ts +0 -115
- package/dist/Select/index.cjs.map +0 -1
- package/dist/Select/index.js.map +0 -1
- package/dist/Select-DWlnKj5c.d.cts +0 -249
- package/dist/Select-DWlnKj5c.d.ts +0 -249
- package/dist/Slider/index.cjs.map +0 -1
- package/dist/Slider/index.js.map +0 -1
- package/dist/Slider-CxHvafJA.d.cts +0 -155
- package/dist/Slider-CxHvafJA.d.ts +0 -155
- package/dist/SubmitButton/index.cjs.map +0 -1
- package/dist/SubmitButton/index.js.map +0 -1
- package/dist/SubmitButton-DqaxyVpp.d.cts +0 -28
- package/dist/SubmitButton-DqaxyVpp.d.ts +0 -28
- package/dist/Switch/index.cjs.map +0 -1
- package/dist/Switch/index.js.map +0 -1
- package/dist/Switch-B4AuHAMX.d.cts +0 -108
- package/dist/Switch-B4AuHAMX.d.ts +0 -108
- package/dist/SwitchBox/index.cjs.map +0 -1
- package/dist/SwitchBox/index.js.map +0 -1
- package/dist/SwitchBox-q1I7a0NX.d.cts +0 -146
- package/dist/SwitchBox-q1I7a0NX.d.ts +0 -146
- package/dist/TextArea/index.cjs.map +0 -1
- package/dist/TextArea/index.js.map +0 -1
- package/dist/TextArea-CYcFOcun.d.cts +0 -88
- package/dist/TextArea-CYcFOcun.d.ts +0 -88
- package/dist/chunk-264VRHMT.js +0 -105
- package/dist/chunk-264VRHMT.js.map +0 -1
- package/dist/chunk-26VE4IGU.js +0 -68
- package/dist/chunk-26VE4IGU.js.map +0 -1
- package/dist/chunk-2HDXHQOC.js +0 -215
- package/dist/chunk-2HDXHQOC.js.map +0 -1
- package/dist/chunk-2UQCRQEJ.cjs +0 -68
- package/dist/chunk-2UQCRQEJ.cjs.map +0 -1
- package/dist/chunk-36LBVB45.js +0 -1
- package/dist/chunk-36LBVB45.js.map +0 -1
- package/dist/chunk-3JAVQAL5.cjs +0 -1
- package/dist/chunk-3JAVQAL5.cjs.map +0 -1
- package/dist/chunk-3ZQXSGR2.cjs +0 -67
- package/dist/chunk-3ZQXSGR2.cjs.map +0 -1
- package/dist/chunk-4CQWTUQR.js +0 -292
- package/dist/chunk-4CQWTUQR.js.map +0 -1
- package/dist/chunk-4HFPBJ3O.cjs +0 -171
- package/dist/chunk-4HFPBJ3O.cjs.map +0 -1
- package/dist/chunk-4RQJCFM7.js +0 -154
- package/dist/chunk-4RQJCFM7.js.map +0 -1
- package/dist/chunk-555JRYCS.cjs +0 -61
- package/dist/chunk-555JRYCS.cjs.map +0 -1
- package/dist/chunk-55VJM3KD.cjs +0 -118
- package/dist/chunk-55VJM3KD.cjs.map +0 -1
- package/dist/chunk-56TQOKG7.cjs +0 -48
- package/dist/chunk-56TQOKG7.cjs.map +0 -1
- package/dist/chunk-5MTIQ6WD.js +0 -41
- package/dist/chunk-5MTIQ6WD.js.map +0 -1
- package/dist/chunk-6AWHOBNL.cjs +0 -41
- package/dist/chunk-6AWHOBNL.cjs.map +0 -1
- package/dist/chunk-6GN62PBG.cjs +0 -182
- package/dist/chunk-6GN62PBG.cjs.map +0 -1
- package/dist/chunk-7MOAXLQZ.js +0 -103
- package/dist/chunk-7MOAXLQZ.js.map +0 -1
- package/dist/chunk-7OMJ26AT.js +0 -165
- package/dist/chunk-7OMJ26AT.js.map +0 -1
- package/dist/chunk-7ZE7IZ5R.cjs +0 -103
- package/dist/chunk-7ZE7IZ5R.cjs.map +0 -1
- package/dist/chunk-AHJJIANM.js +0 -7
- package/dist/chunk-AHJJIANM.js.map +0 -1
- package/dist/chunk-AQJLKHAE.cjs +0 -277
- package/dist/chunk-AQJLKHAE.cjs.map +0 -1
- package/dist/chunk-B62HKKMS.js +0 -20
- package/dist/chunk-B62HKKMS.js.map +0 -1
- package/dist/chunk-C6WYP35Z.js +0 -219
- package/dist/chunk-C6WYP35Z.js.map +0 -1
- package/dist/chunk-CNTOODUQ.js +0 -48
- package/dist/chunk-CNTOODUQ.js.map +0 -1
- package/dist/chunk-ECUVOZGQ.cjs +0 -148
- package/dist/chunk-ECUVOZGQ.cjs.map +0 -1
- package/dist/chunk-ELYGQTXB.js +0 -47
- package/dist/chunk-ELYGQTXB.js.map +0 -1
- package/dist/chunk-EVASKP6Q.js +0 -148
- package/dist/chunk-EVASKP6Q.js.map +0 -1
- package/dist/chunk-FYN7ZWLW.cjs +0 -115
- package/dist/chunk-FYN7ZWLW.cjs.map +0 -1
- package/dist/chunk-GEC75GNL.js +0 -137
- package/dist/chunk-GEC75GNL.js.map +0 -1
- package/dist/chunk-HEPNEBRF.cjs +0 -26
- package/dist/chunk-HEPNEBRF.cjs.map +0 -1
- package/dist/chunk-IR75YRIZ.js +0 -171
- package/dist/chunk-IR75YRIZ.js.map +0 -1
- package/dist/chunk-IV45K4WU.js +0 -277
- package/dist/chunk-IV45K4WU.js.map +0 -1
- package/dist/chunk-K2V4ULA2.js +0 -61
- package/dist/chunk-K2V4ULA2.js.map +0 -1
- package/dist/chunk-KBKMMDLM.js +0 -118
- package/dist/chunk-KBKMMDLM.js.map +0 -1
- package/dist/chunk-KDNO5YO5.cjs +0 -105
- package/dist/chunk-KDNO5YO5.cjs.map +0 -1
- package/dist/chunk-LEMQGDFE.js +0 -67
- package/dist/chunk-LEMQGDFE.js.map +0 -1
- package/dist/chunk-LO7UKHOS.js +0 -26
- package/dist/chunk-LO7UKHOS.js.map +0 -1
- package/dist/chunk-LWPZZ2AW.cjs +0 -172
- package/dist/chunk-LWPZZ2AW.cjs.map +0 -1
- package/dist/chunk-NG3CJ3UE.js +0 -699
- package/dist/chunk-NG3CJ3UE.js.map +0 -1
- package/dist/chunk-NHEZXA4H.cjs +0 -47
- package/dist/chunk-NHEZXA4H.cjs.map +0 -1
- package/dist/chunk-NTDKZW4E.js +0 -35
- package/dist/chunk-NTDKZW4E.js.map +0 -1
- package/dist/chunk-O2XJNQQK.js +0 -154
- package/dist/chunk-O2XJNQQK.js.map +0 -1
- package/dist/chunk-OE5BOGGX.cjs +0 -35
- package/dist/chunk-OE5BOGGX.cjs.map +0 -1
- package/dist/chunk-OKJWLH7T.cjs +0 -154
- package/dist/chunk-OKJWLH7T.cjs.map +0 -1
- package/dist/chunk-OORASWXL.js +0 -49
- package/dist/chunk-OORASWXL.js.map +0 -1
- package/dist/chunk-OT3A4LEE.cjs +0 -154
- package/dist/chunk-OT3A4LEE.cjs.map +0 -1
- package/dist/chunk-PCTYJUY7.cjs +0 -7
- package/dist/chunk-PCTYJUY7.cjs.map +0 -1
- package/dist/chunk-PRUIH5LI.js +0 -131
- package/dist/chunk-PRUIH5LI.js.map +0 -1
- package/dist/chunk-QLNJZDVF.js +0 -182
- package/dist/chunk-QLNJZDVF.js.map +0 -1
- package/dist/chunk-RVBTLB5G.cjs +0 -131
- package/dist/chunk-RVBTLB5G.cjs.map +0 -1
- package/dist/chunk-SJWL6EMI.js +0 -115
- package/dist/chunk-SJWL6EMI.js.map +0 -1
- package/dist/chunk-SW3NGBCE.cjs +0 -215
- package/dist/chunk-SW3NGBCE.cjs.map +0 -1
- package/dist/chunk-THDHNYP7.cjs +0 -219
- package/dist/chunk-THDHNYP7.cjs.map +0 -1
- package/dist/chunk-TTD3KL6E.cjs +0 -20
- package/dist/chunk-TTD3KL6E.cjs.map +0 -1
- package/dist/chunk-UB7CSOZU.js +0 -172
- package/dist/chunk-UB7CSOZU.js.map +0 -1
- package/dist/chunk-V3M7HL26.cjs +0 -137
- package/dist/chunk-V3M7HL26.cjs.map +0 -1
- package/dist/chunk-WXSISX5Y.cjs +0 -49
- package/dist/chunk-WXSISX5Y.cjs.map +0 -1
- package/dist/chunk-WYM6IAIJ.cjs +0 -292
- package/dist/chunk-WYM6IAIJ.cjs.map +0 -1
- package/dist/chunk-YYR23V5P.cjs +0 -165
- package/dist/chunk-YYR23V5P.cjs.map +0 -1
- package/dist/chunk-Z6QACVK7.cjs +0 -699
- package/dist/chunk-Z6QACVK7.cjs.map +0 -1
- package/dist/helpers/index.cjs.map +0 -1
- package/dist/helpers/index.js.map +0 -1
- package/dist/hooks/useFormContext/index.cjs.map +0 -1
- package/dist/hooks/useFormContext/index.js.map +0 -1
- package/dist/hooks/useInputValueDebounce/index.cjs.map +0 -1
- package/dist/hooks/useInputValueDebounce/index.js.map +0 -1
- package/dist/hooks/useUniformField/index.cjs.map +0 -1
- package/dist/hooks/useUniformField/index.js.map +0 -1
- package/dist/hooks/useUniformFieldArray/index.cjs.map +0 -1
- package/dist/hooks/useUniformFieldArray/index.js.map +0 -1
- package/dist/partials/FieldCopyTestIdButton/index.cjs.map +0 -1
- package/dist/partials/FieldCopyTestIdButton/index.js.map +0 -1
- package/dist/partials/FieldValidationError/index.cjs.map +0 -1
- package/dist/partials/FieldValidationError/index.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldValidationError-Cq6aI0tE.cjs","names":["AnimatePresence","motion","FieldValidationError"],"sources":["../src/partials/FieldValidationError/FieldValidationError.tsx","../src/partials/FieldValidationError/index.ts"],"sourcesContent":["import type { FieldError } from 'react-hook-form';\n\nimport {\n AnimatePresence,\n motion,\n useReducedMotion,\n} from '@fuf-stack/pixel-motion';\nimport { slugify } from '@fuf-stack/pixel-utils';\n\nexport interface FieldValidationErrorProps {\n /** CSS class name */\n className?: string;\n /** Field errors */\n error?: FieldError[];\n /** HTML data-testid attribute used in e2e tests */\n testId: string;\n}\n\n/**\n * Renders a validation error of a field\n */\nconst FieldValidationError = ({\n className = undefined,\n error = undefined,\n testId,\n}: FieldValidationErrorProps) => {\n // disable all animation if user prefers reduced motion\n const disableAnimation = useReducedMotion();\n\n return (\n <ul\n aria-label={`Validation errors of field ${testId}`}\n className={className}\n data-testid={slugify(`${testId}_error`)}\n >\n <AnimatePresence initial={!disableAnimation}>\n {error?.map(({ message }, i) => {\n return (\n <motion.li\n key={slugify(`${testId}_error_${i}`)}\n exit={disableAnimation ? undefined : { opacity: 0, height: 0 }}\n initial={disableAnimation ? false : { height: 0, opacity: 0 }}\n style={{ overflow: 'hidden' }}\n transition={{ duration: 0.2, ease: 'circOut' }}\n animate={\n disableAnimation ? undefined : { opacity: 1, height: 'auto' }\n }\n >\n {/* wrap in div to apply padding and animation does not jump */}\n <div className=\"px-1 pt-1\">{message}</div>\n </motion.li>\n );\n })}\n </AnimatePresence>\n </ul>\n );\n};\n\nexport default FieldValidationError;\n","import FieldValidationError from './FieldValidationError';\n\nexport type { FieldValidationErrorProps } from './FieldValidationError';\n\nexport { FieldValidationError };\n\nexport default FieldValidationError;\n"],"mappings":";;;;;;;;;AAqBA,MAAM,wBAAwB,EAC5B,YAAY,QACZ,QAAQ,QACR,aAC+B;CAE/B,MAAM,mEAAqC;AAE3C,QACE,2CAAC;EACC,cAAY,8BAA8B;EAC/B;EACX,oDAAqB,GAAG,OAAO,QAAQ;YAEvC,2CAACA;GAAgB,SAAS,CAAC;aACxB,OAAO,KAAK,EAAE,WAAW,MAAM;AAC9B,WACE,2CAACC,gCAAO;KAEN,MAAM,mBAAmB,SAAY;MAAE,SAAS;MAAG,QAAQ;MAAG;KAC9D,SAAS,mBAAmB,QAAQ;MAAE,QAAQ;MAAG,SAAS;MAAG;KAC7D,OAAO,EAAE,UAAU,UAAU;KAC7B,YAAY;MAAE,UAAU;MAAK,MAAM;MAAW;KAC9C,SACE,mBAAmB,SAAY;MAAE,SAAS;MAAG,QAAQ;MAAQ;eAI/D,2CAAC;MAAI,WAAU;gBAAa;OAAc;4CAV7B,GAAG,OAAO,SAAS,IAAI,CAW1B;KAEd;IACc;GACf;;AAIT,mCAAe;;;;ACpDf,qCAAeC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { slugify } from "@fuf-stack/pixel-utils";
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
import { AnimatePresence, motion, useReducedMotion } from "@fuf-stack/pixel-motion";
|
|
4
|
+
|
|
5
|
+
//#region src/partials/FieldValidationError/FieldValidationError.tsx
|
|
6
|
+
/**
|
|
7
|
+
* Renders a validation error of a field
|
|
8
|
+
*/
|
|
9
|
+
const FieldValidationError = ({ className = void 0, error = void 0, testId }) => {
|
|
10
|
+
const disableAnimation = useReducedMotion();
|
|
11
|
+
return /* @__PURE__ */ jsx("ul", {
|
|
12
|
+
"aria-label": `Validation errors of field ${testId}`,
|
|
13
|
+
className,
|
|
14
|
+
"data-testid": slugify(`${testId}_error`),
|
|
15
|
+
children: /* @__PURE__ */ jsx(AnimatePresence, {
|
|
16
|
+
initial: !disableAnimation,
|
|
17
|
+
children: error?.map(({ message }, i) => {
|
|
18
|
+
return /* @__PURE__ */ jsx(motion.li, {
|
|
19
|
+
exit: disableAnimation ? void 0 : {
|
|
20
|
+
opacity: 0,
|
|
21
|
+
height: 0
|
|
22
|
+
},
|
|
23
|
+
initial: disableAnimation ? false : {
|
|
24
|
+
height: 0,
|
|
25
|
+
opacity: 0
|
|
26
|
+
},
|
|
27
|
+
style: { overflow: "hidden" },
|
|
28
|
+
transition: {
|
|
29
|
+
duration: .2,
|
|
30
|
+
ease: "circOut"
|
|
31
|
+
},
|
|
32
|
+
animate: disableAnimation ? void 0 : {
|
|
33
|
+
opacity: 1,
|
|
34
|
+
height: "auto"
|
|
35
|
+
},
|
|
36
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
37
|
+
className: "px-1 pt-1",
|
|
38
|
+
children: message
|
|
39
|
+
})
|
|
40
|
+
}, slugify(`${testId}_error_${i}`));
|
|
41
|
+
})
|
|
42
|
+
})
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
var FieldValidationError_default = FieldValidationError;
|
|
46
|
+
|
|
47
|
+
//#endregion
|
|
48
|
+
//#region src/partials/FieldValidationError/index.ts
|
|
49
|
+
var FieldValidationError_default$1 = FieldValidationError_default;
|
|
50
|
+
|
|
51
|
+
//#endregion
|
|
52
|
+
export { FieldValidationError_default as n, FieldValidationError_default$1 as t };
|
|
53
|
+
//# sourceMappingURL=FieldValidationError-D86DPSOH.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FieldValidationError-D86DPSOH.js","names":["FieldValidationError"],"sources":["../src/partials/FieldValidationError/FieldValidationError.tsx","../src/partials/FieldValidationError/index.ts"],"sourcesContent":["import type { FieldError } from 'react-hook-form';\n\nimport {\n AnimatePresence,\n motion,\n useReducedMotion,\n} from '@fuf-stack/pixel-motion';\nimport { slugify } from '@fuf-stack/pixel-utils';\n\nexport interface FieldValidationErrorProps {\n /** CSS class name */\n className?: string;\n /** Field errors */\n error?: FieldError[];\n /** HTML data-testid attribute used in e2e tests */\n testId: string;\n}\n\n/**\n * Renders a validation error of a field\n */\nconst FieldValidationError = ({\n className = undefined,\n error = undefined,\n testId,\n}: FieldValidationErrorProps) => {\n // disable all animation if user prefers reduced motion\n const disableAnimation = useReducedMotion();\n\n return (\n <ul\n aria-label={`Validation errors of field ${testId}`}\n className={className}\n data-testid={slugify(`${testId}_error`)}\n >\n <AnimatePresence initial={!disableAnimation}>\n {error?.map(({ message }, i) => {\n return (\n <motion.li\n key={slugify(`${testId}_error_${i}`)}\n exit={disableAnimation ? undefined : { opacity: 0, height: 0 }}\n initial={disableAnimation ? false : { height: 0, opacity: 0 }}\n style={{ overflow: 'hidden' }}\n transition={{ duration: 0.2, ease: 'circOut' }}\n animate={\n disableAnimation ? undefined : { opacity: 1, height: 'auto' }\n }\n >\n {/* wrap in div to apply padding and animation does not jump */}\n <div className=\"px-1 pt-1\">{message}</div>\n </motion.li>\n );\n })}\n </AnimatePresence>\n </ul>\n );\n};\n\nexport default FieldValidationError;\n","import FieldValidationError from './FieldValidationError';\n\nexport type { FieldValidationErrorProps } from './FieldValidationError';\n\nexport { FieldValidationError };\n\nexport default FieldValidationError;\n"],"mappings":";;;;;;;;AAqBA,MAAM,wBAAwB,EAC5B,YAAY,QACZ,QAAQ,QACR,aAC+B;CAE/B,MAAM,mBAAmB,kBAAkB;AAE3C,QACE,oBAAC;EACC,cAAY,8BAA8B;EAC/B;EACX,eAAa,QAAQ,GAAG,OAAO,QAAQ;YAEvC,oBAAC;GAAgB,SAAS,CAAC;aACxB,OAAO,KAAK,EAAE,WAAW,MAAM;AAC9B,WACE,oBAAC,OAAO;KAEN,MAAM,mBAAmB,SAAY;MAAE,SAAS;MAAG,QAAQ;MAAG;KAC9D,SAAS,mBAAmB,QAAQ;MAAE,QAAQ;MAAG,SAAS;MAAG;KAC7D,OAAO,EAAE,UAAU,UAAU;KAC7B,YAAY;MAAE,UAAU;MAAK,MAAM;MAAW;KAC9C,SACE,mBAAmB,SAAY;MAAE,SAAS;MAAG,QAAQ;MAAQ;eAI/D,oBAAC;MAAI,WAAU;gBAAa;OAAc;OAVrC,QAAQ,GAAG,OAAO,SAAS,IAAI,CAW1B;KAEd;IACc;GACf;;AAIT,mCAAe;;;;ACpDf,qCAAeA"}
|
package/dist/Form/index.cjs
CHANGED
|
@@ -1,14 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
+
const require_Form = require('../Form-FvN3SXfF.cjs');
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
require('../chunk-3JAVQAL5.cjs');
|
|
6
|
-
require('../chunk-FYN7ZWLW.cjs');
|
|
7
|
-
require('../chunk-AQJLKHAE.cjs');
|
|
8
|
-
require('../chunk-OKJWLH7T.cjs');
|
|
9
|
-
require('../chunk-555JRYCS.cjs');
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
exports.Form = _chunkLWPZZ2AWcjs.Form_default; exports.default = _chunkLWPZZ2AWcjs.Form_default2;
|
|
14
|
-
//# sourceMappingURL=index.cjs.map
|
|
4
|
+
exports.Form = require_Form.Form_default$1;
|
|
5
|
+
exports.default = require_Form.Form_default;
|
package/dist/Form/index.d.cts
CHANGED
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import 'react/jsx-runtime';
|
|
4
|
-
import '@fuf-stack/veto';
|
|
5
|
-
import 'react';
|
|
6
|
-
import 'react-hook-form';
|
|
7
|
-
import '../FormContext-9Firwt4k.cjs';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export { Form, Form as default };
|
|
1
|
+
import { n as FormProps, t as Form } from "../index-jmQP58tO.cjs";
|
|
2
|
+
export { Form, Form as default, FormProps };
|
package/dist/Form/index.d.ts
CHANGED
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import '@fuf-stack/veto';
|
|
5
|
-
import 'react';
|
|
6
|
-
import 'react-hook-form';
|
|
7
|
-
import '../FormContext-9Firwt4k.js';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export { Form, Form as default };
|
|
1
|
+
import "../FormContext-C2_WMi_v.js";
|
|
2
|
+
import { n as FormProps, t as Form } from "../index-aHcGnXHf.js";
|
|
3
|
+
export { Form, Form as default, FormProps };
|
package/dist/Form/index.js
CHANGED
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} from "../chunk-UB7CSOZU.js";
|
|
5
|
-
import "../chunk-36LBVB45.js";
|
|
6
|
-
import "../chunk-SJWL6EMI.js";
|
|
7
|
-
import "../chunk-IV45K4WU.js";
|
|
8
|
-
import "../chunk-O2XJNQQK.js";
|
|
9
|
-
import "../chunk-K2V4ULA2.js";
|
|
10
|
-
export {
|
|
11
|
-
Form_default as Form,
|
|
12
|
-
Form_default2 as default
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import { n as Form_default, t as Form_default$1 } from "../Form-CFmCTl60.js";
|
|
2
|
+
|
|
3
|
+
export { Form_default as Form, Form_default$1 as default };
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { t as FormContext_default } from "./FormContext-CN9n_KdE.js";
|
|
2
|
+
import { n as useFormContext } from "./useFormContext-JCm1UR_e.js";
|
|
3
|
+
import { cn, slugify } from "@fuf-stack/pixel-utils";
|
|
4
|
+
import { useEffect, useState } from "react";
|
|
5
|
+
import { FaBug, FaBullseye } from "react-icons/fa6";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { FaTimes } from "react-icons/fa";
|
|
8
|
+
import { Button } from "@fuf-stack/pixels/Button";
|
|
9
|
+
import { Card } from "@fuf-stack/pixels/Card";
|
|
10
|
+
import { Json } from "@fuf-stack/pixels/Json";
|
|
11
|
+
import "@fuf-stack/pixels/Json.css";
|
|
12
|
+
|
|
13
|
+
//#region src/Form/subcomponents/FormDebugViewer.tsx
|
|
14
|
+
/** Renders a form debug panel with information about the current form state */
|
|
15
|
+
const FormDebugViewer = ({ className = void 0 }) => {
|
|
16
|
+
const { debugMode, formState: { isValid, isSubmitting, submitCount, isSubmitSuccessful }, getValues, setDebugMode, validation: { errors }, subscribe } = useFormContext();
|
|
17
|
+
const showDebugButton = debugMode === "off";
|
|
18
|
+
const showDebugCard = debugMode === "debug" || debugMode === "debug-testids";
|
|
19
|
+
const showDebugTestIds = debugMode === "debug-testids";
|
|
20
|
+
const [values, setValues] = useState({});
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
if (!showDebugCard) return;
|
|
23
|
+
setValues(getValues() ?? {});
|
|
24
|
+
const subscription = subscribe({
|
|
25
|
+
formState: { values: true },
|
|
26
|
+
callback: (state) => {
|
|
27
|
+
setValues(state.values ?? {});
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
return () => {
|
|
31
|
+
subscription();
|
|
32
|
+
};
|
|
33
|
+
}, [showDebugCard]);
|
|
34
|
+
if (showDebugButton) return /* @__PURE__ */ jsx(Button, {
|
|
35
|
+
ariaLabel: "Enable form debug mode",
|
|
36
|
+
className: "fixed bottom-2.5 right-2.5 w-5 text-default-400",
|
|
37
|
+
icon: /* @__PURE__ */ jsx(FaBug, {}),
|
|
38
|
+
variant: "light",
|
|
39
|
+
onClick: () => {
|
|
40
|
+
setDebugMode("debug");
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
if (!showDebugCard) return null;
|
|
44
|
+
return /* @__PURE__ */ jsxs(Card, {
|
|
45
|
+
className: cn(className),
|
|
46
|
+
header: /* @__PURE__ */ jsxs("div", {
|
|
47
|
+
className: "flex w-full flex-row justify-between",
|
|
48
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
49
|
+
className: "text-lg",
|
|
50
|
+
children: "Debug Mode"
|
|
51
|
+
}), /* @__PURE__ */ jsx(Button, {
|
|
52
|
+
color: "danger",
|
|
53
|
+
icon: /* @__PURE__ */ jsx(FaTimes, {}),
|
|
54
|
+
size: "sm",
|
|
55
|
+
variant: "light",
|
|
56
|
+
onClick: () => {
|
|
57
|
+
setDebugMode("off");
|
|
58
|
+
}
|
|
59
|
+
})]
|
|
60
|
+
}),
|
|
61
|
+
children: [/* @__PURE__ */ jsx(Button, {
|
|
62
|
+
className: "mb-4 ml-auto mr-auto",
|
|
63
|
+
icon: /* @__PURE__ */ jsx(FaBullseye, {}),
|
|
64
|
+
variant: showDebugTestIds ? "solid" : "light",
|
|
65
|
+
onClick: () => {
|
|
66
|
+
setDebugMode(debugMode === "debug" ? "debug-testids" : "debug");
|
|
67
|
+
},
|
|
68
|
+
children: showDebugTestIds ? "Hide CopyButton" : "Show CopyButton"
|
|
69
|
+
}), /* @__PURE__ */ jsx(Json, { value: {
|
|
70
|
+
values,
|
|
71
|
+
errors: errors ?? null,
|
|
72
|
+
submit: {
|
|
73
|
+
isValid,
|
|
74
|
+
isSubmitting,
|
|
75
|
+
isSubmitSuccessful,
|
|
76
|
+
submitCount
|
|
77
|
+
}
|
|
78
|
+
} })]
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
var FormDebugViewer_default = FormDebugViewer;
|
|
82
|
+
|
|
83
|
+
//#endregion
|
|
84
|
+
//#region src/Form/Form.tsx
|
|
85
|
+
const IS_TEST = process.env.NODE_ENV === "test";
|
|
86
|
+
/**
|
|
87
|
+
* Form component that has to wrap every uniform
|
|
88
|
+
*/
|
|
89
|
+
const Form = ({ children, className = void 0, debug = void 0, initialValues = void 0, name = void 0, onSubmit, testId = void 0, validation = void 0, validationTrigger = "all" }) => {
|
|
90
|
+
return /* @__PURE__ */ jsx(FormContext_default, {
|
|
91
|
+
debugModeSettings: debug,
|
|
92
|
+
initialValues,
|
|
93
|
+
onSubmit,
|
|
94
|
+
validation,
|
|
95
|
+
validationTrigger,
|
|
96
|
+
children: ({ handleSubmit, isValid }) => {
|
|
97
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
98
|
+
className: "flex w-full flex-row justify-between gap-6",
|
|
99
|
+
children: [/* @__PURE__ */ jsx("form", {
|
|
100
|
+
className: cn("grow", className),
|
|
101
|
+
"data-form-is-valid": isValid,
|
|
102
|
+
"data-testid": slugify(testId ?? name ?? ""),
|
|
103
|
+
name,
|
|
104
|
+
onSubmit: handleSubmit,
|
|
105
|
+
children
|
|
106
|
+
}), !IS_TEST && !debug?.disable && /* @__PURE__ */ jsx(FormDebugViewer_default, { className: "w-96 shrink" })]
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
var Form_default = Form;
|
|
112
|
+
|
|
113
|
+
//#endregion
|
|
114
|
+
//#region src/Form/index.ts
|
|
115
|
+
var Form_default$1 = Form_default;
|
|
116
|
+
|
|
117
|
+
//#endregion
|
|
118
|
+
export { Form_default as n, Form_default$1 as t };
|
|
119
|
+
//# sourceMappingURL=Form-CFmCTl60.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Form-CFmCTl60.js","names":["FormProvider","FormDebugViewer","Form"],"sources":["../src/Form/subcomponents/FormDebugViewer.tsx","../src/Form/Form.tsx","../src/Form/index.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\nimport { FaTimes } from 'react-icons/fa';\nimport { FaBug, FaBullseye } from 'react-icons/fa6';\n\nimport { cn } from '@fuf-stack/pixel-utils';\nimport { Button } from '@fuf-stack/pixels/Button';\nimport { Card } from '@fuf-stack/pixels/Card';\nimport { Json } from '@fuf-stack/pixels/Json';\n\nimport { useFormContext } from '../../hooks/useFormContext';\n\n// import Json css (theme)\nimport '@fuf-stack/pixels/Json.css';\n\ninterface FormDebugViewerProps {\n /** CSS class name */\n className?: string;\n}\n\n/** Renders a form debug panel with information about the current form state */\nconst FormDebugViewer = ({ className = undefined }: FormDebugViewerProps) => {\n const {\n debugMode,\n formState: { isValid, isSubmitting, submitCount, isSubmitSuccessful },\n getValues,\n setDebugMode,\n validation: { errors },\n subscribe,\n } = useFormContext();\n\n const showDebugButton = debugMode === 'off';\n const showDebugCard = debugMode === 'debug' || debugMode === 'debug-testids';\n const showDebugTestIds = debugMode === 'debug-testids';\n\n // Use subscribe instead of watch() to avoid triggering re-renders on parent components.\n // This component manages its own state and only updates itself when form values change.\n const [values, setValues] = useState<Record<string, unknown>>({});\n\n useEffect(() => {\n // Only subscribe when debug card is visible\n if (!showDebugCard) {\n return undefined;\n }\n\n // Initialize with current values when debug card is opened\n setValues(getValues() ?? {});\n\n const subscription = subscribe({\n formState: { values: true },\n callback: (state) => {\n setValues(state.values ?? {});\n },\n });\n\n return () => {\n subscription();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [showDebugCard]);\n\n if (showDebugButton) {\n return (\n <Button\n ariaLabel=\"Enable form debug mode\"\n className=\"fixed bottom-2.5 right-2.5 w-5 text-default-400\"\n icon={<FaBug />}\n variant=\"light\"\n onClick={() => {\n setDebugMode('debug');\n }}\n />\n );\n }\n\n // do not show card\n if (!showDebugCard) {\n return null;\n }\n\n return (\n <Card\n className={cn(className)}\n header={\n <div className=\"flex w-full flex-row justify-between\">\n <span className=\"text-lg\">Debug Mode</span>\n <Button\n color=\"danger\"\n icon={<FaTimes />}\n size=\"sm\"\n variant=\"light\"\n onClick={() => {\n setDebugMode('off');\n }}\n />\n </div>\n }\n >\n <Button\n className=\"mb-4 ml-auto mr-auto\"\n icon={<FaBullseye />}\n variant={showDebugTestIds ? 'solid' : 'light'}\n onClick={() => {\n setDebugMode(debugMode === 'debug' ? 'debug-testids' : 'debug');\n }}\n >\n {showDebugTestIds ? 'Hide CopyButton' : 'Show CopyButton'}\n </Button>\n <Json\n value={{\n values,\n errors: errors ?? null,\n submit: {\n isValid,\n isSubmitting,\n isSubmitSuccessful,\n submitCount,\n },\n }}\n />\n </Card>\n );\n};\n\nexport default FormDebugViewer;\n","import type { VetoInstance } from '@fuf-stack/veto';\nimport type { ReactNode } from 'react';\nimport type { FieldValues, SubmitHandler } from 'react-hook-form';\nimport type { DebugModeSettings } from './subcomponents/FormContext';\n\nimport { cn, slugify } from '@fuf-stack/pixel-utils';\n\nimport FormProvider from './subcomponents/FormContext';\nimport FormDebugViewer from './subcomponents/FormDebugViewer';\n\nconst IS_TEST = process.env.NODE_ENV === 'test';\n\nexport interface FormProps {\n /** form children */\n children: ReactNode | ReactNode[];\n /** CSS class name */\n className?: string | string[];\n /** settings for from debug mode */\n debug?: DebugModeSettings;\n /** initial form values */\n initialValues?: FieldValues;\n /** name of the form */\n name?: string;\n /** form submit handler */\n onSubmit: SubmitHandler<FieldValues>;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** veto validation schema */\n validation?: VetoInstance;\n /** when the validation should be triggered */\n validationTrigger?: 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all';\n}\n\n/**\n * Form component that has to wrap every uniform\n */\nconst Form = ({\n children,\n className = undefined,\n debug = undefined,\n initialValues = undefined,\n name = undefined,\n onSubmit,\n testId = undefined,\n validation = undefined,\n validationTrigger = 'all',\n}: FormProps) => {\n return (\n <FormProvider\n debugModeSettings={debug}\n initialValues={initialValues}\n onSubmit={onSubmit}\n validation={validation}\n validationTrigger={validationTrigger}\n >\n {({ handleSubmit, isValid }) => {\n return (\n <div className=\"flex w-full flex-row justify-between gap-6\">\n <form\n className={cn('grow', className)}\n data-form-is-valid={isValid}\n data-testid={slugify(testId ?? name ?? '')}\n name={name}\n onSubmit={handleSubmit}\n >\n {children}\n </form>\n {/* render debug viewer when not in test environment and debug not disabled */}\n {!IS_TEST && !debug?.disable && (\n <FormDebugViewer className=\"w-96 shrink\" />\n )}\n </div>\n );\n }}\n </FormProvider>\n );\n};\n\nexport default Form;\n","import Form from './Form';\n\nexport type { FormProps } from './Form';\n\nexport { Form };\n\nexport default Form;\n"],"mappings":";;;;;;;;;;;;;;AAoBA,MAAM,mBAAmB,EAAE,YAAY,aAAsC;CAC3E,MAAM,EACJ,WACA,WAAW,EAAE,SAAS,cAAc,aAAa,sBACjD,WACA,cACA,YAAY,EAAE,UACd,cACE,gBAAgB;CAEpB,MAAM,kBAAkB,cAAc;CACtC,MAAM,gBAAgB,cAAc,WAAW,cAAc;CAC7D,MAAM,mBAAmB,cAAc;CAIvC,MAAM,CAAC,QAAQ,aAAa,SAAkC,EAAE,CAAC;AAEjE,iBAAgB;AAEd,MAAI,CAAC,cACH;AAIF,YAAU,WAAW,IAAI,EAAE,CAAC;EAE5B,MAAM,eAAe,UAAU;GAC7B,WAAW,EAAE,QAAQ,MAAM;GAC3B,WAAW,UAAU;AACnB,cAAU,MAAM,UAAU,EAAE,CAAC;;GAEhC,CAAC;AAEF,eAAa;AACX,iBAAc;;IAGf,CAAC,cAAc,CAAC;AAEnB,KAAI,gBACF,QACE,oBAAC;EACC,WAAU;EACV,WAAU;EACV,MAAM,oBAAC,UAAQ;EACf,SAAQ;EACR,eAAe;AACb,gBAAa,QAAQ;;GAEvB;AAKN,KAAI,CAAC,cACH,QAAO;AAGT,QACE,qBAAC;EACC,WAAW,GAAG,UAAU;EACxB,QACE,qBAAC;GAAI,WAAU;cACb,oBAAC;IAAK,WAAU;cAAU;KAAiB,EAC3C,oBAAC;IACC,OAAM;IACN,MAAM,oBAAC,YAAU;IACjB,MAAK;IACL,SAAQ;IACR,eAAe;AACb,kBAAa,MAAM;;KAErB;IACE;aAGR,oBAAC;GACC,WAAU;GACV,MAAM,oBAAC,eAAa;GACpB,SAAS,mBAAmB,UAAU;GACtC,eAAe;AACb,iBAAa,cAAc,UAAU,kBAAkB,QAAQ;;aAGhE,mBAAmB,oBAAoB;IACjC,EACT,oBAAC,QACC,OAAO;GACL;GACA,QAAQ,UAAU;GAClB,QAAQ;IACN;IACA;IACA;IACA;IACD;GACF,GACD;GACG;;AAIX,8BAAe;;;;ACjHf,MAAM,UAAU,QAAQ,IAAI,aAAa;;;;AA0BzC,MAAM,QAAQ,EACZ,UACA,YAAY,QACZ,QAAQ,QACR,gBAAgB,QAChB,OAAO,QACP,UACA,SAAS,QACT,aAAa,QACb,oBAAoB,YACL;AACf,QACE,oBAACA;EACC,mBAAmB;EACJ;EACL;EACE;EACO;aAEjB,EAAE,cAAc,cAAc;AAC9B,UACE,qBAAC;IAAI,WAAU;eACb,oBAAC;KACC,WAAW,GAAG,QAAQ,UAAU;KAChC,sBAAoB;KACpB,eAAa,QAAQ,UAAU,QAAQ,GAAG;KACpC;KACN,UAAU;KAET;MACI,EAEN,CAAC,WAAW,CAAC,OAAO,WACnB,oBAACC,2BAAgB,WAAU,gBAAgB;KAEzC;;GAGG;;AAInB,mBAAe;;;;ACxEf,qBAAeC"}
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
const require_FormContext = require('./FormContext-C3GymQOA.cjs');
|
|
2
|
+
const require_useFormContext = require('./useFormContext-CWuN-_7P.cjs');
|
|
3
|
+
let __fuf_stack_pixel_utils = require("@fuf-stack/pixel-utils");
|
|
4
|
+
let react = require("react");
|
|
5
|
+
let react_icons_fa6 = require("react-icons/fa6");
|
|
6
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
|
+
let react_icons_fa = require("react-icons/fa");
|
|
8
|
+
let __fuf_stack_pixels_Button = require("@fuf-stack/pixels/Button");
|
|
9
|
+
let __fuf_stack_pixels_Card = require("@fuf-stack/pixels/Card");
|
|
10
|
+
let __fuf_stack_pixels_Json = require("@fuf-stack/pixels/Json");
|
|
11
|
+
require("@fuf-stack/pixels/Json.css");
|
|
12
|
+
|
|
13
|
+
//#region src/Form/subcomponents/FormDebugViewer.tsx
|
|
14
|
+
/** Renders a form debug panel with information about the current form state */
|
|
15
|
+
const FormDebugViewer = ({ className = void 0 }) => {
|
|
16
|
+
const { debugMode, formState: { isValid, isSubmitting, submitCount, isSubmitSuccessful }, getValues, setDebugMode, validation: { errors }, subscribe } = require_useFormContext.useFormContext();
|
|
17
|
+
const showDebugButton = debugMode === "off";
|
|
18
|
+
const showDebugCard = debugMode === "debug" || debugMode === "debug-testids";
|
|
19
|
+
const showDebugTestIds = debugMode === "debug-testids";
|
|
20
|
+
const [values, setValues] = (0, react.useState)({});
|
|
21
|
+
(0, react.useEffect)(() => {
|
|
22
|
+
if (!showDebugCard) return;
|
|
23
|
+
setValues(getValues() ?? {});
|
|
24
|
+
const subscription = subscribe({
|
|
25
|
+
formState: { values: true },
|
|
26
|
+
callback: (state) => {
|
|
27
|
+
setValues(state.values ?? {});
|
|
28
|
+
}
|
|
29
|
+
});
|
|
30
|
+
return () => {
|
|
31
|
+
subscription();
|
|
32
|
+
};
|
|
33
|
+
}, [showDebugCard]);
|
|
34
|
+
if (showDebugButton) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__fuf_stack_pixels_Button.Button, {
|
|
35
|
+
ariaLabel: "Enable form debug mode",
|
|
36
|
+
className: "fixed bottom-2.5 right-2.5 w-5 text-default-400",
|
|
37
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_icons_fa6.FaBug, {}),
|
|
38
|
+
variant: "light",
|
|
39
|
+
onClick: () => {
|
|
40
|
+
setDebugMode("debug");
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
if (!showDebugCard) return null;
|
|
44
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(__fuf_stack_pixels_Card.Card, {
|
|
45
|
+
className: (0, __fuf_stack_pixel_utils.cn)(className),
|
|
46
|
+
header: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
47
|
+
className: "flex w-full flex-row justify-between",
|
|
48
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
49
|
+
className: "text-lg",
|
|
50
|
+
children: "Debug Mode"
|
|
51
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__fuf_stack_pixels_Button.Button, {
|
|
52
|
+
color: "danger",
|
|
53
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_icons_fa.FaTimes, {}),
|
|
54
|
+
size: "sm",
|
|
55
|
+
variant: "light",
|
|
56
|
+
onClick: () => {
|
|
57
|
+
setDebugMode("off");
|
|
58
|
+
}
|
|
59
|
+
})]
|
|
60
|
+
}),
|
|
61
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__fuf_stack_pixels_Button.Button, {
|
|
62
|
+
className: "mb-4 ml-auto mr-auto",
|
|
63
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_icons_fa6.FaBullseye, {}),
|
|
64
|
+
variant: showDebugTestIds ? "solid" : "light",
|
|
65
|
+
onClick: () => {
|
|
66
|
+
setDebugMode(debugMode === "debug" ? "debug-testids" : "debug");
|
|
67
|
+
},
|
|
68
|
+
children: showDebugTestIds ? "Hide CopyButton" : "Show CopyButton"
|
|
69
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__fuf_stack_pixels_Json.Json, { value: {
|
|
70
|
+
values,
|
|
71
|
+
errors: errors ?? null,
|
|
72
|
+
submit: {
|
|
73
|
+
isValid,
|
|
74
|
+
isSubmitting,
|
|
75
|
+
isSubmitSuccessful,
|
|
76
|
+
submitCount
|
|
77
|
+
}
|
|
78
|
+
} })]
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
var FormDebugViewer_default = FormDebugViewer;
|
|
82
|
+
|
|
83
|
+
//#endregion
|
|
84
|
+
//#region src/Form/Form.tsx
|
|
85
|
+
const IS_TEST = process.env.NODE_ENV === "test";
|
|
86
|
+
/**
|
|
87
|
+
* Form component that has to wrap every uniform
|
|
88
|
+
*/
|
|
89
|
+
const Form = ({ children, className = void 0, debug = void 0, initialValues = void 0, name = void 0, onSubmit, testId = void 0, validation = void 0, validationTrigger = "all" }) => {
|
|
90
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_FormContext.FormContext_default, {
|
|
91
|
+
debugModeSettings: debug,
|
|
92
|
+
initialValues,
|
|
93
|
+
onSubmit,
|
|
94
|
+
validation,
|
|
95
|
+
validationTrigger,
|
|
96
|
+
children: ({ handleSubmit, isValid }) => {
|
|
97
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
98
|
+
className: "flex w-full flex-row justify-between gap-6",
|
|
99
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("form", {
|
|
100
|
+
className: (0, __fuf_stack_pixel_utils.cn)("grow", className),
|
|
101
|
+
"data-form-is-valid": isValid,
|
|
102
|
+
"data-testid": (0, __fuf_stack_pixel_utils.slugify)(testId ?? name ?? ""),
|
|
103
|
+
name,
|
|
104
|
+
onSubmit: handleSubmit,
|
|
105
|
+
children
|
|
106
|
+
}), !IS_TEST && !debug?.disable && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FormDebugViewer_default, { className: "w-96 shrink" })]
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
var Form_default = Form;
|
|
112
|
+
|
|
113
|
+
//#endregion
|
|
114
|
+
//#region src/Form/index.ts
|
|
115
|
+
var Form_default$1 = Form_default;
|
|
116
|
+
|
|
117
|
+
//#endregion
|
|
118
|
+
Object.defineProperty(exports, 'Form_default', {
|
|
119
|
+
enumerable: true,
|
|
120
|
+
get: function () {
|
|
121
|
+
return Form_default$1;
|
|
122
|
+
}
|
|
123
|
+
});
|
|
124
|
+
Object.defineProperty(exports, 'Form_default$1', {
|
|
125
|
+
enumerable: true,
|
|
126
|
+
get: function () {
|
|
127
|
+
return Form_default;
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
//# sourceMappingURL=Form-FvN3SXfF.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Form-FvN3SXfF.cjs","names":["useFormContext","Button","FaBug","Card","FaTimes","FaBullseye","Json","FormProvider","FormDebugViewer","Form"],"sources":["../src/Form/subcomponents/FormDebugViewer.tsx","../src/Form/Form.tsx","../src/Form/index.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\nimport { FaTimes } from 'react-icons/fa';\nimport { FaBug, FaBullseye } from 'react-icons/fa6';\n\nimport { cn } from '@fuf-stack/pixel-utils';\nimport { Button } from '@fuf-stack/pixels/Button';\nimport { Card } from '@fuf-stack/pixels/Card';\nimport { Json } from '@fuf-stack/pixels/Json';\n\nimport { useFormContext } from '../../hooks/useFormContext';\n\n// import Json css (theme)\nimport '@fuf-stack/pixels/Json.css';\n\ninterface FormDebugViewerProps {\n /** CSS class name */\n className?: string;\n}\n\n/** Renders a form debug panel with information about the current form state */\nconst FormDebugViewer = ({ className = undefined }: FormDebugViewerProps) => {\n const {\n debugMode,\n formState: { isValid, isSubmitting, submitCount, isSubmitSuccessful },\n getValues,\n setDebugMode,\n validation: { errors },\n subscribe,\n } = useFormContext();\n\n const showDebugButton = debugMode === 'off';\n const showDebugCard = debugMode === 'debug' || debugMode === 'debug-testids';\n const showDebugTestIds = debugMode === 'debug-testids';\n\n // Use subscribe instead of watch() to avoid triggering re-renders on parent components.\n // This component manages its own state and only updates itself when form values change.\n const [values, setValues] = useState<Record<string, unknown>>({});\n\n useEffect(() => {\n // Only subscribe when debug card is visible\n if (!showDebugCard) {\n return undefined;\n }\n\n // Initialize with current values when debug card is opened\n setValues(getValues() ?? {});\n\n const subscription = subscribe({\n formState: { values: true },\n callback: (state) => {\n setValues(state.values ?? {});\n },\n });\n\n return () => {\n subscription();\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [showDebugCard]);\n\n if (showDebugButton) {\n return (\n <Button\n ariaLabel=\"Enable form debug mode\"\n className=\"fixed bottom-2.5 right-2.5 w-5 text-default-400\"\n icon={<FaBug />}\n variant=\"light\"\n onClick={() => {\n setDebugMode('debug');\n }}\n />\n );\n }\n\n // do not show card\n if (!showDebugCard) {\n return null;\n }\n\n return (\n <Card\n className={cn(className)}\n header={\n <div className=\"flex w-full flex-row justify-between\">\n <span className=\"text-lg\">Debug Mode</span>\n <Button\n color=\"danger\"\n icon={<FaTimes />}\n size=\"sm\"\n variant=\"light\"\n onClick={() => {\n setDebugMode('off');\n }}\n />\n </div>\n }\n >\n <Button\n className=\"mb-4 ml-auto mr-auto\"\n icon={<FaBullseye />}\n variant={showDebugTestIds ? 'solid' : 'light'}\n onClick={() => {\n setDebugMode(debugMode === 'debug' ? 'debug-testids' : 'debug');\n }}\n >\n {showDebugTestIds ? 'Hide CopyButton' : 'Show CopyButton'}\n </Button>\n <Json\n value={{\n values,\n errors: errors ?? null,\n submit: {\n isValid,\n isSubmitting,\n isSubmitSuccessful,\n submitCount,\n },\n }}\n />\n </Card>\n );\n};\n\nexport default FormDebugViewer;\n","import type { VetoInstance } from '@fuf-stack/veto';\nimport type { ReactNode } from 'react';\nimport type { FieldValues, SubmitHandler } from 'react-hook-form';\nimport type { DebugModeSettings } from './subcomponents/FormContext';\n\nimport { cn, slugify } from '@fuf-stack/pixel-utils';\n\nimport FormProvider from './subcomponents/FormContext';\nimport FormDebugViewer from './subcomponents/FormDebugViewer';\n\nconst IS_TEST = process.env.NODE_ENV === 'test';\n\nexport interface FormProps {\n /** form children */\n children: ReactNode | ReactNode[];\n /** CSS class name */\n className?: string | string[];\n /** settings for from debug mode */\n debug?: DebugModeSettings;\n /** initial form values */\n initialValues?: FieldValues;\n /** name of the form */\n name?: string;\n /** form submit handler */\n onSubmit: SubmitHandler<FieldValues>;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** veto validation schema */\n validation?: VetoInstance;\n /** when the validation should be triggered */\n validationTrigger?: 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all';\n}\n\n/**\n * Form component that has to wrap every uniform\n */\nconst Form = ({\n children,\n className = undefined,\n debug = undefined,\n initialValues = undefined,\n name = undefined,\n onSubmit,\n testId = undefined,\n validation = undefined,\n validationTrigger = 'all',\n}: FormProps) => {\n return (\n <FormProvider\n debugModeSettings={debug}\n initialValues={initialValues}\n onSubmit={onSubmit}\n validation={validation}\n validationTrigger={validationTrigger}\n >\n {({ handleSubmit, isValid }) => {\n return (\n <div className=\"flex w-full flex-row justify-between gap-6\">\n <form\n className={cn('grow', className)}\n data-form-is-valid={isValid}\n data-testid={slugify(testId ?? name ?? '')}\n name={name}\n onSubmit={handleSubmit}\n >\n {children}\n </form>\n {/* render debug viewer when not in test environment and debug not disabled */}\n {!IS_TEST && !debug?.disable && (\n <FormDebugViewer className=\"w-96 shrink\" />\n )}\n </div>\n );\n }}\n </FormProvider>\n );\n};\n\nexport default Form;\n","import Form from './Form';\n\nexport type { FormProps } from './Form';\n\nexport { Form };\n\nexport default Form;\n"],"mappings":";;;;;;;;;;;;;;AAoBA,MAAM,mBAAmB,EAAE,YAAY,aAAsC;CAC3E,MAAM,EACJ,WACA,WAAW,EAAE,SAAS,cAAc,aAAa,sBACjD,WACA,cACA,YAAY,EAAE,UACd,cACEA,uCAAgB;CAEpB,MAAM,kBAAkB,cAAc;CACtC,MAAM,gBAAgB,cAAc,WAAW,cAAc;CAC7D,MAAM,mBAAmB,cAAc;CAIvC,MAAM,CAAC,QAAQ,iCAA+C,EAAE,CAAC;AAEjE,4BAAgB;AAEd,MAAI,CAAC,cACH;AAIF,YAAU,WAAW,IAAI,EAAE,CAAC;EAE5B,MAAM,eAAe,UAAU;GAC7B,WAAW,EAAE,QAAQ,MAAM;GAC3B,WAAW,UAAU;AACnB,cAAU,MAAM,UAAU,EAAE,CAAC;;GAEhC,CAAC;AAEF,eAAa;AACX,iBAAc;;IAGf,CAAC,cAAc,CAAC;AAEnB,KAAI,gBACF,QACE,2CAACC;EACC,WAAU;EACV,WAAU;EACV,MAAM,2CAACC,0BAAQ;EACf,SAAQ;EACR,eAAe;AACb,gBAAa,QAAQ;;GAEvB;AAKN,KAAI,CAAC,cACH,QAAO;AAGT,QACE,4CAACC;EACC,2CAAc,UAAU;EACxB,QACE,4CAAC;GAAI,WAAU;cACb,2CAAC;IAAK,WAAU;cAAU;KAAiB,EAC3C,2CAACF;IACC,OAAM;IACN,MAAM,2CAACG,2BAAU;IACjB,MAAK;IACL,SAAQ;IACR,eAAe;AACb,kBAAa,MAAM;;KAErB;IACE;aAGR,2CAACH;GACC,WAAU;GACV,MAAM,2CAACI,+BAAa;GACpB,SAAS,mBAAmB,UAAU;GACtC,eAAe;AACb,iBAAa,cAAc,UAAU,kBAAkB,QAAQ;;aAGhE,mBAAmB,oBAAoB;IACjC,EACT,2CAACC,gCACC,OAAO;GACL;GACA,QAAQ,UAAU;GAClB,QAAQ;IACN;IACA;IACA;IACA;IACD;GACF,GACD;GACG;;AAIX,8BAAe;;;;ACjHf,MAAM,UAAU,QAAQ,IAAI,aAAa;;;;AA0BzC,MAAM,QAAQ,EACZ,UACA,YAAY,QACZ,QAAQ,QACR,gBAAgB,QAChB,OAAO,QACP,UACA,SAAS,QACT,aAAa,QACb,oBAAoB,YACL;AACf,QACE,2CAACC;EACC,mBAAmB;EACJ;EACL;EACE;EACO;aAEjB,EAAE,cAAc,cAAc;AAC9B,UACE,4CAAC;IAAI,WAAU;eACb,2CAAC;KACC,2CAAc,QAAQ,UAAU;KAChC,sBAAoB;KACpB,oDAAqB,UAAU,QAAQ,GAAG;KACpC;KACN,UAAU;KAET;MACI,EAEN,CAAC,WAAW,CAAC,OAAO,WACnB,2CAACC,2BAAgB,WAAU,gBAAgB;KAEzC;;GAGG;;AAInB,mBAAe;;;;ACxEf,qBAAeC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import { FieldValues, Path, SubmitHandler } from "react-hook-form";
|
|
3
|
+
import { VetoFormattedError, VetoInstance, VetoTypeAny } from "@fuf-stack/veto";
|
|
4
|
+
|
|
5
|
+
//#region src/Form/subcomponents/FormContext.d.ts
|
|
6
|
+
interface DebugModeSettings {
|
|
7
|
+
/** disable form debug completely */
|
|
8
|
+
disable?: boolean;
|
|
9
|
+
/** custom localStorage key to save debug mode state */
|
|
10
|
+
localStorageKey?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Listener function that gets called when a field changes due to user input
|
|
14
|
+
*/
|
|
15
|
+
type UserChangeListener<TFieldValues extends object = object> = (fieldName: Path<TFieldValues>, value: unknown) => void;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { UserChangeListener as n, DebugModeSettings as t };
|
|
18
|
+
//# sourceMappingURL=FormContext-C2_WMi_v.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FormContext-C2_WMi_v.d.ts","names":[],"sources":["../src/Form/subcomponents/FormContext.tsx"],"sourcesContent":[],"mappings":";;;;;AAsBiB,UAAA,iBAAA,CAAiB;EAUtB;;;;;;;;KAAA,uEACC,KAAK"}
|