@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
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import 'react/jsx-runtime';
|
|
4
|
-
import '@fuf-stack/pixels';
|
|
5
|
-
import 'react';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export { SubmitButton, SubmitButton as default };
|
|
1
|
+
import { n as SubmitButtonProps, t as SubmitButton } from "../index-CVY05bZf.js";
|
|
2
|
+
export { SubmitButton, SubmitButton as default, SubmitButtonProps };
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} from "../chunk-OORASWXL.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
|
-
SubmitButton_default as SubmitButton,
|
|
12
|
-
SubmitButton_default2 as default
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import { n as SubmitButton_default, t as SubmitButton_default$1 } from "../SubmitButton-7iOaKzhB.js";
|
|
2
|
+
|
|
3
|
+
export { SubmitButton_default as SubmitButton, SubmitButton_default$1 as default };
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { n as useFormContext } from "./useFormContext-JCm1UR_e.js";
|
|
2
|
+
import { cn, slugify } from "@fuf-stack/pixel-utils";
|
|
3
|
+
import { Button } from "@fuf-stack/pixels";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
|
|
6
|
+
//#region src/SubmitButton/SubmitButton.tsx
|
|
7
|
+
/**
|
|
8
|
+
* From SubmitButton
|
|
9
|
+
*/
|
|
10
|
+
const SubmitButton = ({ ariaLabel = "Submit form", children = "Submit", className = void 0, color = "success", icon = void 0, loading = false, size = "md", testId = "form_submit_button" }) => {
|
|
11
|
+
const { formState: { isSubmitting }, triggerSubmit } = useFormContext();
|
|
12
|
+
return /* @__PURE__ */ jsx(Button, {
|
|
13
|
+
ariaLabel,
|
|
14
|
+
className: cn(className),
|
|
15
|
+
color,
|
|
16
|
+
disabled: isSubmitting,
|
|
17
|
+
icon,
|
|
18
|
+
loading: loading || isSubmitting,
|
|
19
|
+
onClick: triggerSubmit,
|
|
20
|
+
size,
|
|
21
|
+
testId: slugify(testId, { replaceDots: true }),
|
|
22
|
+
type: "submit",
|
|
23
|
+
children
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
var SubmitButton_default = SubmitButton;
|
|
27
|
+
|
|
28
|
+
//#endregion
|
|
29
|
+
//#region src/SubmitButton/index.ts
|
|
30
|
+
var SubmitButton_default$1 = SubmitButton_default;
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
export { SubmitButton_default as n, SubmitButton_default$1 as t };
|
|
34
|
+
//# sourceMappingURL=SubmitButton-7iOaKzhB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubmitButton-7iOaKzhB.js","names":["SubmitButton"],"sources":["../src/SubmitButton/SubmitButton.tsx","../src/SubmitButton/index.ts"],"sourcesContent":["import type { ButtonProps } from '@fuf-stack/pixels';\nimport type { ReactNode } from 'react';\n\nimport { cn, slugify } from '@fuf-stack/pixel-utils';\nimport { Button } from '@fuf-stack/pixels';\n\nimport { useFormContext } from '../hooks/useFormContext';\n\nexport interface SubmitButtonProps {\n /** sets HTML aria-label attribute */\n ariaLabel?: string;\n /** child components */\n children?: ReactNode;\n /** CSS class name */\n className?: string;\n /** color of the submit button */\n color?: ButtonProps['color'];\n /** icon of the submit button */\n icon?: ButtonProps['icon'];\n /** If set loading animation is shown */\n loading?: boolean;\n /** size of the submit button */\n size?: ButtonProps['size'];\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\n/**\n * From SubmitButton\n */\nconst SubmitButton = ({\n ariaLabel = 'Submit form',\n children = 'Submit',\n className = undefined,\n color = 'success',\n icon = undefined,\n loading = false,\n size = 'md',\n testId = 'form_submit_button',\n}: SubmitButtonProps) => {\n const {\n formState: { isSubmitting },\n triggerSubmit,\n } = useFormContext();\n\n return (\n <Button\n ariaLabel={ariaLabel}\n className={cn(className)}\n color={color}\n disabled={isSubmitting}\n icon={icon}\n loading={loading || isSubmitting}\n // @ts-expect-error we use form context triggerSubmit\n // here so that submit button also works in special\n // scenarios (e.g. when used in modal)\n onClick={triggerSubmit}\n size={size}\n testId={slugify(testId, { replaceDots: true })}\n type=\"submit\"\n >\n {children}\n </Button>\n );\n};\n\nexport default SubmitButton;\n","import SubmitButton from './SubmitButton';\n\nexport type { SubmitButtonProps } from './SubmitButton';\n\nexport { SubmitButton };\n\nexport default SubmitButton;\n"],"mappings":";;;;;;;;;AA8BA,MAAM,gBAAgB,EACpB,YAAY,eACZ,WAAW,UACX,YAAY,QACZ,QAAQ,WACR,OAAO,QACP,UAAU,OACV,OAAO,MACP,SAAS,2BACc;CACvB,MAAM,EACJ,WAAW,EAAE,gBACb,kBACE,gBAAgB;AAEpB,QACE,oBAAC;EACY;EACX,WAAW,GAAG,UAAU;EACjB;EACP,UAAU;EACJ;EACN,SAAS,WAAW;EAIpB,SAAS;EACH;EACN,QAAQ,QAAQ,QAAQ,EAAE,aAAa,MAAM,CAAC;EAC9C,MAAK;EAEJ;GACM;;AAIb,2BAAe;;;;AC5Df,6BAAeA"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
const require_FormContext = require('./FormContext-C3GymQOA.cjs');
|
|
2
|
+
const require_useFormContext = require('./useFormContext-CWuN-_7P.cjs');
|
|
3
|
+
let __fuf_stack_pixel_utils = require("@fuf-stack/pixel-utils");
|
|
4
|
+
let __fuf_stack_pixels = require("@fuf-stack/pixels");
|
|
5
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
|
+
|
|
7
|
+
//#region src/SubmitButton/SubmitButton.tsx
|
|
8
|
+
/**
|
|
9
|
+
* From SubmitButton
|
|
10
|
+
*/
|
|
11
|
+
const SubmitButton = ({ ariaLabel = "Submit form", children = "Submit", className = void 0, color = "success", icon = void 0, loading = false, size = "md", testId = "form_submit_button" }) => {
|
|
12
|
+
const { formState: { isSubmitting }, triggerSubmit } = require_useFormContext.useFormContext();
|
|
13
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__fuf_stack_pixels.Button, {
|
|
14
|
+
ariaLabel,
|
|
15
|
+
className: (0, __fuf_stack_pixel_utils.cn)(className),
|
|
16
|
+
color,
|
|
17
|
+
disabled: isSubmitting,
|
|
18
|
+
icon,
|
|
19
|
+
loading: loading || isSubmitting,
|
|
20
|
+
onClick: triggerSubmit,
|
|
21
|
+
size,
|
|
22
|
+
testId: (0, __fuf_stack_pixel_utils.slugify)(testId, { replaceDots: true }),
|
|
23
|
+
type: "submit",
|
|
24
|
+
children
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
var SubmitButton_default = SubmitButton;
|
|
28
|
+
|
|
29
|
+
//#endregion
|
|
30
|
+
//#region src/SubmitButton/index.ts
|
|
31
|
+
var SubmitButton_default$1 = SubmitButton_default;
|
|
32
|
+
|
|
33
|
+
//#endregion
|
|
34
|
+
Object.defineProperty(exports, 'SubmitButton_default', {
|
|
35
|
+
enumerable: true,
|
|
36
|
+
get: function () {
|
|
37
|
+
return SubmitButton_default$1;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
Object.defineProperty(exports, 'SubmitButton_default$1', {
|
|
41
|
+
enumerable: true,
|
|
42
|
+
get: function () {
|
|
43
|
+
return SubmitButton_default;
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
//# sourceMappingURL=SubmitButton-DhtPJuro.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubmitButton-DhtPJuro.cjs","names":["useFormContext","Button","SubmitButton"],"sources":["../src/SubmitButton/SubmitButton.tsx","../src/SubmitButton/index.ts"],"sourcesContent":["import type { ButtonProps } from '@fuf-stack/pixels';\nimport type { ReactNode } from 'react';\n\nimport { cn, slugify } from '@fuf-stack/pixel-utils';\nimport { Button } from '@fuf-stack/pixels';\n\nimport { useFormContext } from '../hooks/useFormContext';\n\nexport interface SubmitButtonProps {\n /** sets HTML aria-label attribute */\n ariaLabel?: string;\n /** child components */\n children?: ReactNode;\n /** CSS class name */\n className?: string;\n /** color of the submit button */\n color?: ButtonProps['color'];\n /** icon of the submit button */\n icon?: ButtonProps['icon'];\n /** If set loading animation is shown */\n loading?: boolean;\n /** size of the submit button */\n size?: ButtonProps['size'];\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\n/**\n * From SubmitButton\n */\nconst SubmitButton = ({\n ariaLabel = 'Submit form',\n children = 'Submit',\n className = undefined,\n color = 'success',\n icon = undefined,\n loading = false,\n size = 'md',\n testId = 'form_submit_button',\n}: SubmitButtonProps) => {\n const {\n formState: { isSubmitting },\n triggerSubmit,\n } = useFormContext();\n\n return (\n <Button\n ariaLabel={ariaLabel}\n className={cn(className)}\n color={color}\n disabled={isSubmitting}\n icon={icon}\n loading={loading || isSubmitting}\n // @ts-expect-error we use form context triggerSubmit\n // here so that submit button also works in special\n // scenarios (e.g. when used in modal)\n onClick={triggerSubmit}\n size={size}\n testId={slugify(testId, { replaceDots: true })}\n type=\"submit\"\n >\n {children}\n </Button>\n );\n};\n\nexport default SubmitButton;\n","import SubmitButton from './SubmitButton';\n\nexport type { SubmitButtonProps } from './SubmitButton';\n\nexport { SubmitButton };\n\nexport default SubmitButton;\n"],"mappings":";;;;;;;;;;AA8BA,MAAM,gBAAgB,EACpB,YAAY,eACZ,WAAW,UACX,YAAY,QACZ,QAAQ,WACR,OAAO,QACP,UAAU,OACV,OAAO,MACP,SAAS,2BACc;CACvB,MAAM,EACJ,WAAW,EAAE,gBACb,kBACEA,uCAAgB;AAEpB,QACE,2CAACC;EACY;EACX,2CAAc,UAAU;EACjB;EACP,UAAU;EACJ;EACN,SAAS,WAAW;EAIpB,SAAS;EACH;EACN,6CAAgB,QAAQ,EAAE,aAAa,MAAM,CAAC;EAC9C,MAAK;EAEJ;GACM;;AAIb,2BAAe;;;;AC5Df,6BAAeC"}
|
package/dist/Switch/index.cjs
CHANGED
|
@@ -1,19 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
+
const require_Switch = require('../Switch-Dczzog3v.cjs');
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
require('../chunk-V3M7HL26.cjs');
|
|
6
|
-
require('../chunk-OE5BOGGX.cjs');
|
|
7
|
-
require('../chunk-NHEZXA4H.cjs');
|
|
8
|
-
require('../chunk-6AWHOBNL.cjs');
|
|
9
|
-
require('../chunk-PCTYJUY7.cjs');
|
|
10
|
-
require('../chunk-56TQOKG7.cjs');
|
|
11
|
-
require('../chunk-FYN7ZWLW.cjs');
|
|
12
|
-
require('../chunk-AQJLKHAE.cjs');
|
|
13
|
-
require('../chunk-OKJWLH7T.cjs');
|
|
14
|
-
require('../chunk-555JRYCS.cjs');
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
exports.Switch = _chunkRVBTLB5Gcjs.Switch_default; exports.default = _chunkRVBTLB5Gcjs.Switch_default2;
|
|
19
|
-
//# sourceMappingURL=index.cjs.map
|
|
4
|
+
exports.Switch = require_Switch.Switch_default$1;
|
|
5
|
+
exports.default = require_Switch.Switch_default;
|
package/dist/Switch/index.d.cts
CHANGED
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import 'react/jsx-runtime';
|
|
4
|
-
import 'tailwind-variants';
|
|
5
|
-
import '@fuf-stack/pixel-utils';
|
|
6
|
-
import '@heroui/switch';
|
|
7
|
-
import 'react';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export { Switch, Switch as default };
|
|
1
|
+
import { n as SwitchProps, t as Switch } from "../index-BOI0cy-n.cjs";
|
|
2
|
+
export { Switch, Switch as default, SwitchProps };
|
package/dist/Switch/index.d.ts
CHANGED
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import 'react/jsx-runtime';
|
|
4
|
-
import 'tailwind-variants';
|
|
5
|
-
import '@fuf-stack/pixel-utils';
|
|
6
|
-
import '@heroui/switch';
|
|
7
|
-
import 'react';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export { Switch, Switch as default };
|
|
1
|
+
import { n as SwitchProps, t as Switch } from "../index-BM4XWo1K.js";
|
|
2
|
+
export { Switch, Switch as default, SwitchProps };
|
package/dist/Switch/index.js
CHANGED
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} from "../chunk-PRUIH5LI.js";
|
|
5
|
-
import "../chunk-GEC75GNL.js";
|
|
6
|
-
import "../chunk-NTDKZW4E.js";
|
|
7
|
-
import "../chunk-ELYGQTXB.js";
|
|
8
|
-
import "../chunk-5MTIQ6WD.js";
|
|
9
|
-
import "../chunk-AHJJIANM.js";
|
|
10
|
-
import "../chunk-CNTOODUQ.js";
|
|
11
|
-
import "../chunk-SJWL6EMI.js";
|
|
12
|
-
import "../chunk-IV45K4WU.js";
|
|
13
|
-
import "../chunk-O2XJNQQK.js";
|
|
14
|
-
import "../chunk-K2V4ULA2.js";
|
|
15
|
-
export {
|
|
16
|
-
Switch_default as Switch,
|
|
17
|
-
Switch_default2 as default
|
|
18
|
-
};
|
|
19
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import { n as Switch_default, t as Switch_default$1 } from "../Switch-DCxAgt_L.js";
|
|
2
|
+
|
|
3
|
+
export { Switch_default as Switch, Switch_default$1 as default };
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { t as useUniformField } from "./useUniformField-ClprfrES.js";
|
|
2
|
+
import { cn, tv, variantsToClassNames } from "@fuf-stack/pixel-utils";
|
|
3
|
+
import { useRef } from "react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { VisuallyHidden } from "@react-aria/visually-hidden";
|
|
6
|
+
import { Switch } from "@heroui/switch";
|
|
7
|
+
|
|
8
|
+
//#region src/Switch/Switch.tsx
|
|
9
|
+
const switchVariants = tv({ slots: {
|
|
10
|
+
base: "",
|
|
11
|
+
endContent: "",
|
|
12
|
+
errorMessage: "ml-1 mt-1",
|
|
13
|
+
label: "text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:!text-danger group-data-[required=true]:after:ml-0.5 group-data-[required=true]:after:text-danger group-data-[required=true]:after:content-[\"*\"]",
|
|
14
|
+
outerWrapper: "place-content-center",
|
|
15
|
+
startContent: "",
|
|
16
|
+
thumb: "",
|
|
17
|
+
thumbIcon: "",
|
|
18
|
+
wrapper: ""
|
|
19
|
+
} });
|
|
20
|
+
/**
|
|
21
|
+
* Switch component based on [HeroUI Switch](https://www.heroui.com//docs/components/switch)
|
|
22
|
+
*/
|
|
23
|
+
const Switch$1 = ({ className = void 0, endContent = void 0, name, size = void 0, startContent = void 0, thumbIcon = void 0, ...uniformFieldProps }) => {
|
|
24
|
+
const { ariaLabel, defaultValue, disabled, errorMessage, field, getErrorMessageProps, getHelperWrapperProps, invalid, label, onBlur, onChange, ref, required, testId } = useUniformField({
|
|
25
|
+
name,
|
|
26
|
+
...uniformFieldProps
|
|
27
|
+
});
|
|
28
|
+
const visualSwitchRef = useRef(null);
|
|
29
|
+
const classNames = variantsToClassNames(switchVariants(), className, "outerWrapper");
|
|
30
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
31
|
+
className: classNames.outerWrapper,
|
|
32
|
+
children: [
|
|
33
|
+
/* @__PURE__ */ jsx(VisuallyHidden, { children: /* @__PURE__ */ jsx("input", {
|
|
34
|
+
ref,
|
|
35
|
+
"aria-label": ariaLabel,
|
|
36
|
+
checked: !!field.value,
|
|
37
|
+
name,
|
|
38
|
+
onBlur,
|
|
39
|
+
type: "checkbox",
|
|
40
|
+
onChange: (e) => {
|
|
41
|
+
onChange(e.target.checked);
|
|
42
|
+
},
|
|
43
|
+
onFocus: () => {
|
|
44
|
+
visualSwitchRef.current?.focus();
|
|
45
|
+
}
|
|
46
|
+
}) }),
|
|
47
|
+
/* @__PURE__ */ jsx(Switch, {
|
|
48
|
+
ref: visualSwitchRef,
|
|
49
|
+
"aria-label": ariaLabel,
|
|
50
|
+
classNames,
|
|
51
|
+
"data-invalid": invalid,
|
|
52
|
+
"data-required": required,
|
|
53
|
+
"data-testid": testId,
|
|
54
|
+
defaultSelected: !!defaultValue,
|
|
55
|
+
endContent,
|
|
56
|
+
isDisabled: disabled,
|
|
57
|
+
isSelected: !!field.value,
|
|
58
|
+
name: `${name}_switch`,
|
|
59
|
+
onValueChange: onChange,
|
|
60
|
+
size,
|
|
61
|
+
startContent,
|
|
62
|
+
thumbIcon,
|
|
63
|
+
children: label
|
|
64
|
+
}),
|
|
65
|
+
invalid ? /* @__PURE__ */ jsx("div", {
|
|
66
|
+
...getHelperWrapperProps(),
|
|
67
|
+
className: cn(getHelperWrapperProps()?.className, "ml-0 block"),
|
|
68
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
69
|
+
...getErrorMessageProps(),
|
|
70
|
+
children: errorMessage
|
|
71
|
+
})
|
|
72
|
+
}) : null
|
|
73
|
+
]
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
var Switch_default = Switch$1;
|
|
77
|
+
|
|
78
|
+
//#endregion
|
|
79
|
+
//#region src/Switch/index.ts
|
|
80
|
+
var Switch_default$1 = Switch_default;
|
|
81
|
+
|
|
82
|
+
//#endregion
|
|
83
|
+
export { Switch_default as n, Switch_default$1 as t };
|
|
84
|
+
//# sourceMappingURL=Switch-DCxAgt_L.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Switch-DCxAgt_L.js","names":["Switch","HeroSwitch","Switch"],"sources":["../src/Switch/Switch.tsx","../src/Switch/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { SwitchProps as HeroSwitchProps } from '@heroui/switch';\nimport type { ReactNode } from 'react';\n\nimport { useRef } from 'react';\n\nimport { Switch as HeroSwitch } from '@heroui/switch';\nimport { VisuallyHidden } from '@react-aria/visually-hidden';\n\nimport { cn, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../hooks/useUniformField';\n\nexport const switchVariants = tv({\n slots: {\n base: '',\n endContent: '',\n errorMessage: 'ml-1 mt-1',\n // see HeroUI styles for group-data condition,\n // e.g.: https://github.com/heroui-inc/heroui/blob/main/packages/core/theme/src/components/select.ts\n label:\n 'text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:!text-danger group-data-[required=true]:after:ml-0.5 group-data-[required=true]:after:text-danger group-data-[required=true]:after:content-[\"*\"]',\n outerWrapper: 'place-content-center',\n startContent: '',\n thumb: '',\n thumbIcon: '',\n wrapper: '',\n },\n});\n\ntype VariantProps = TVProps<typeof switchVariants>;\ntype ClassName = TVClassName<typeof switchVariants>;\n\nexport interface SwitchProps extends VariantProps {\n /** Custom aria-label for accessibility. If not provided, falls back to field name when no visible label exists */\n ariaLabel?: string;\n /** CSS class name */\n className?: ClassName;\n /** whether the select should be disabled */\n disabled?: boolean;\n /** Icon to be displayed at the end of the switch (when enabled) */\n endContent?: ReactNode;\n /** component displayed next to the switch */\n label?: ReactNode;\n /** name the field is registered under */\n name: string;\n /* Size of the switch */\n size?: 'sm' | 'md' | 'lg';\n /** Icon to be displayed at the start of the switch (when disabled) */\n startContent?: ReactNode;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** Icon to be displayed inside the thumb */\n thumbIcon?: HeroSwitchProps['thumbIcon'];\n}\n\n/**\n * Switch component based on [HeroUI Switch](https://www.heroui.com//docs/components/switch)\n */\nconst Switch = ({\n className = undefined,\n endContent = undefined,\n name,\n size = undefined,\n startContent = undefined,\n thumbIcon = undefined,\n ...uniformFieldProps\n}: SwitchProps) => {\n const {\n ariaLabel,\n defaultValue,\n disabled,\n errorMessage,\n field,\n getErrorMessageProps,\n getHelperWrapperProps,\n invalid,\n label,\n onBlur,\n onChange,\n ref,\n required,\n testId,\n } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n // Ref for the visual switch to forward focus\n const visualSwitchRef = useRef<HTMLInputElement>(null);\n\n // classNames from slots\n const variants = switchVariants();\n const classNames = variantsToClassNames(variants, className, 'outerWrapper');\n\n return (\n <div className={classNames.outerWrapper}>\n {/* Visually hidden input for form accessibility and focus management */}\n <VisuallyHidden>\n <input\n ref={ref}\n aria-label={ariaLabel}\n checked={!!field.value}\n name={name}\n onBlur={onBlur}\n type=\"checkbox\"\n onChange={(e) => {\n onChange(e.target.checked);\n }}\n onFocus={() => {\n // When RHF focuses this hidden input (e.g., on validation error),\n // forward focus to the visual switch to show focus ring\n visualSwitchRef.current?.focus();\n }}\n />\n </VisuallyHidden>\n {/* Visual HeroSwitch component */}\n <HeroSwitch\n ref={visualSwitchRef}\n aria-label={ariaLabel}\n classNames={classNames}\n data-invalid={invalid}\n data-required={required}\n data-testid={testId}\n defaultSelected={!!defaultValue}\n endContent={endContent}\n isDisabled={disabled}\n isSelected={!!field.value}\n name={`${name}_switch`}\n onValueChange={onChange}\n size={size}\n startContent={startContent}\n thumbIcon={thumbIcon}\n >\n {label}\n </HeroSwitch>\n {invalid ? (\n <div\n {...getHelperWrapperProps()}\n className={cn(\n getHelperWrapperProps()?.className,\n // force helper to be visible (for some reason it's hidden by default) and remove margin\n 'ml-0 block',\n )}\n >\n <div {...getErrorMessageProps()}>{errorMessage}</div>\n </div>\n ) : null}\n </div>\n );\n};\n\nexport default Switch;\n","import Switch from './Switch';\n\nexport type { SwitchProps } from './Switch';\n\nexport { Switch };\n\nexport default Switch;\n"],"mappings":";;;;;;;;AAaA,MAAa,iBAAiB,GAAG,EAC/B,OAAO;CACL,MAAM;CACN,YAAY;CACZ,cAAc;CAGd,OACE;CACF,cAAc;CACd,cAAc;CACd,OAAO;CACP,WAAW;CACX,SAAS;CACV,EACF,CAAC;;;;AA+BF,MAAMA,YAAU,EACd,YAAY,QACZ,aAAa,QACb,MACA,OAAO,QACP,eAAe,QACf,YAAY,QACZ,GAAG,wBACc;CACjB,MAAM,EACJ,WACA,cACA,UACA,cACA,OACA,sBACA,uBACA,SACA,OACA,QACA,UACA,KACA,UACA,WACE,gBAAgB;EAClB;EACA,GAAG;EACJ,CAAC;CAGF,MAAM,kBAAkB,OAAyB,KAAK;CAItD,MAAM,aAAa,qBADF,gBAAgB,EACiB,WAAW,eAAe;AAE5E,QACE,qBAAC;EAAI,WAAW,WAAW;;GAEzB,oBAAC,4BACC,oBAAC;IACM;IACL,cAAY;IACZ,SAAS,CAAC,CAAC,MAAM;IACX;IACE;IACR,MAAK;IACL,WAAW,MAAM;AACf,cAAS,EAAE,OAAO,QAAQ;;IAE5B,eAAe;AAGb,qBAAgB,SAAS,OAAO;;KAElC,GACa;GAEjB,oBAACC;IACC,KAAK;IACL,cAAY;IACA;IACZ,gBAAc;IACd,iBAAe;IACf,eAAa;IACb,iBAAiB,CAAC,CAAC;IACP;IACZ,YAAY;IACZ,YAAY,CAAC,CAAC,MAAM;IACpB,MAAM,GAAG,KAAK;IACd,eAAe;IACT;IACQ;IACH;cAEV;KACU;GACZ,UACC,oBAAC;IACC,GAAI,uBAAuB;IAC3B,WAAW,GACT,uBAAuB,EAAE,WAEzB,aACD;cAED,oBAAC;KAAI,GAAI,sBAAsB;eAAG;MAAmB;KACjD,GACJ;;GACA;;AAIV,qBAAeD;;;;AClJf,uBAAeE"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
const require_FormContext = require('./FormContext-C3GymQOA.cjs');
|
|
2
|
+
const require_useUniformField = require('./useUniformField-BMvnRC_r.cjs');
|
|
3
|
+
let __fuf_stack_pixel_utils = require("@fuf-stack/pixel-utils");
|
|
4
|
+
let react = require("react");
|
|
5
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
|
+
let __react_aria_visually_hidden = require("@react-aria/visually-hidden");
|
|
7
|
+
let __heroui_switch = require("@heroui/switch");
|
|
8
|
+
|
|
9
|
+
//#region src/Switch/Switch.tsx
|
|
10
|
+
const switchVariants = (0, __fuf_stack_pixel_utils.tv)({ slots: {
|
|
11
|
+
base: "",
|
|
12
|
+
endContent: "",
|
|
13
|
+
errorMessage: "ml-1 mt-1",
|
|
14
|
+
label: "text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:!text-danger group-data-[required=true]:after:ml-0.5 group-data-[required=true]:after:text-danger group-data-[required=true]:after:content-[\"*\"]",
|
|
15
|
+
outerWrapper: "place-content-center",
|
|
16
|
+
startContent: "",
|
|
17
|
+
thumb: "",
|
|
18
|
+
thumbIcon: "",
|
|
19
|
+
wrapper: ""
|
|
20
|
+
} });
|
|
21
|
+
/**
|
|
22
|
+
* Switch component based on [HeroUI Switch](https://www.heroui.com//docs/components/switch)
|
|
23
|
+
*/
|
|
24
|
+
const Switch = ({ className = void 0, endContent = void 0, name, size = void 0, startContent = void 0, thumbIcon = void 0, ...uniformFieldProps }) => {
|
|
25
|
+
const { ariaLabel, defaultValue, disabled, errorMessage, field, getErrorMessageProps, getHelperWrapperProps, invalid, label, onBlur, onChange, ref, required, testId } = require_useUniformField.useUniformField({
|
|
26
|
+
name,
|
|
27
|
+
...uniformFieldProps
|
|
28
|
+
});
|
|
29
|
+
const visualSwitchRef = (0, react.useRef)(null);
|
|
30
|
+
const classNames = (0, __fuf_stack_pixel_utils.variantsToClassNames)(switchVariants(), className, "outerWrapper");
|
|
31
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
32
|
+
className: classNames.outerWrapper,
|
|
33
|
+
children: [
|
|
34
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__react_aria_visually_hidden.VisuallyHidden, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
35
|
+
ref,
|
|
36
|
+
"aria-label": ariaLabel,
|
|
37
|
+
checked: !!field.value,
|
|
38
|
+
name,
|
|
39
|
+
onBlur,
|
|
40
|
+
type: "checkbox",
|
|
41
|
+
onChange: (e) => {
|
|
42
|
+
onChange(e.target.checked);
|
|
43
|
+
},
|
|
44
|
+
onFocus: () => {
|
|
45
|
+
visualSwitchRef.current?.focus();
|
|
46
|
+
}
|
|
47
|
+
}) }),
|
|
48
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__heroui_switch.Switch, {
|
|
49
|
+
ref: visualSwitchRef,
|
|
50
|
+
"aria-label": ariaLabel,
|
|
51
|
+
classNames,
|
|
52
|
+
"data-invalid": invalid,
|
|
53
|
+
"data-required": required,
|
|
54
|
+
"data-testid": testId,
|
|
55
|
+
defaultSelected: !!defaultValue,
|
|
56
|
+
endContent,
|
|
57
|
+
isDisabled: disabled,
|
|
58
|
+
isSelected: !!field.value,
|
|
59
|
+
name: `${name}_switch`,
|
|
60
|
+
onValueChange: onChange,
|
|
61
|
+
size,
|
|
62
|
+
startContent,
|
|
63
|
+
thumbIcon,
|
|
64
|
+
children: label
|
|
65
|
+
}),
|
|
66
|
+
invalid ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
67
|
+
...getHelperWrapperProps(),
|
|
68
|
+
className: (0, __fuf_stack_pixel_utils.cn)(getHelperWrapperProps()?.className, "ml-0 block"),
|
|
69
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
70
|
+
...getErrorMessageProps(),
|
|
71
|
+
children: errorMessage
|
|
72
|
+
})
|
|
73
|
+
}) : null
|
|
74
|
+
]
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
var Switch_default = Switch;
|
|
78
|
+
|
|
79
|
+
//#endregion
|
|
80
|
+
//#region src/Switch/index.ts
|
|
81
|
+
var Switch_default$1 = Switch_default;
|
|
82
|
+
|
|
83
|
+
//#endregion
|
|
84
|
+
Object.defineProperty(exports, 'Switch_default', {
|
|
85
|
+
enumerable: true,
|
|
86
|
+
get: function () {
|
|
87
|
+
return Switch_default$1;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
Object.defineProperty(exports, 'Switch_default$1', {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
get: function () {
|
|
93
|
+
return Switch_default;
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
//# sourceMappingURL=Switch-Dczzog3v.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Switch-Dczzog3v.cjs","names":["useUniformField","VisuallyHidden","HeroSwitch","Switch"],"sources":["../src/Switch/Switch.tsx","../src/Switch/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { SwitchProps as HeroSwitchProps } from '@heroui/switch';\nimport type { ReactNode } from 'react';\n\nimport { useRef } from 'react';\n\nimport { Switch as HeroSwitch } from '@heroui/switch';\nimport { VisuallyHidden } from '@react-aria/visually-hidden';\n\nimport { cn, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../hooks/useUniformField';\n\nexport const switchVariants = tv({\n slots: {\n base: '',\n endContent: '',\n errorMessage: 'ml-1 mt-1',\n // see HeroUI styles for group-data condition,\n // e.g.: https://github.com/heroui-inc/heroui/blob/main/packages/core/theme/src/components/select.ts\n label:\n 'text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:!text-danger group-data-[required=true]:after:ml-0.5 group-data-[required=true]:after:text-danger group-data-[required=true]:after:content-[\"*\"]',\n outerWrapper: 'place-content-center',\n startContent: '',\n thumb: '',\n thumbIcon: '',\n wrapper: '',\n },\n});\n\ntype VariantProps = TVProps<typeof switchVariants>;\ntype ClassName = TVClassName<typeof switchVariants>;\n\nexport interface SwitchProps extends VariantProps {\n /** Custom aria-label for accessibility. If not provided, falls back to field name when no visible label exists */\n ariaLabel?: string;\n /** CSS class name */\n className?: ClassName;\n /** whether the select should be disabled */\n disabled?: boolean;\n /** Icon to be displayed at the end of the switch (when enabled) */\n endContent?: ReactNode;\n /** component displayed next to the switch */\n label?: ReactNode;\n /** name the field is registered under */\n name: string;\n /* Size of the switch */\n size?: 'sm' | 'md' | 'lg';\n /** Icon to be displayed at the start of the switch (when disabled) */\n startContent?: ReactNode;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** Icon to be displayed inside the thumb */\n thumbIcon?: HeroSwitchProps['thumbIcon'];\n}\n\n/**\n * Switch component based on [HeroUI Switch](https://www.heroui.com//docs/components/switch)\n */\nconst Switch = ({\n className = undefined,\n endContent = undefined,\n name,\n size = undefined,\n startContent = undefined,\n thumbIcon = undefined,\n ...uniformFieldProps\n}: SwitchProps) => {\n const {\n ariaLabel,\n defaultValue,\n disabled,\n errorMessage,\n field,\n getErrorMessageProps,\n getHelperWrapperProps,\n invalid,\n label,\n onBlur,\n onChange,\n ref,\n required,\n testId,\n } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n // Ref for the visual switch to forward focus\n const visualSwitchRef = useRef<HTMLInputElement>(null);\n\n // classNames from slots\n const variants = switchVariants();\n const classNames = variantsToClassNames(variants, className, 'outerWrapper');\n\n return (\n <div className={classNames.outerWrapper}>\n {/* Visually hidden input for form accessibility and focus management */}\n <VisuallyHidden>\n <input\n ref={ref}\n aria-label={ariaLabel}\n checked={!!field.value}\n name={name}\n onBlur={onBlur}\n type=\"checkbox\"\n onChange={(e) => {\n onChange(e.target.checked);\n }}\n onFocus={() => {\n // When RHF focuses this hidden input (e.g., on validation error),\n // forward focus to the visual switch to show focus ring\n visualSwitchRef.current?.focus();\n }}\n />\n </VisuallyHidden>\n {/* Visual HeroSwitch component */}\n <HeroSwitch\n ref={visualSwitchRef}\n aria-label={ariaLabel}\n classNames={classNames}\n data-invalid={invalid}\n data-required={required}\n data-testid={testId}\n defaultSelected={!!defaultValue}\n endContent={endContent}\n isDisabled={disabled}\n isSelected={!!field.value}\n name={`${name}_switch`}\n onValueChange={onChange}\n size={size}\n startContent={startContent}\n thumbIcon={thumbIcon}\n >\n {label}\n </HeroSwitch>\n {invalid ? (\n <div\n {...getHelperWrapperProps()}\n className={cn(\n getHelperWrapperProps()?.className,\n // force helper to be visible (for some reason it's hidden by default) and remove margin\n 'ml-0 block',\n )}\n >\n <div {...getErrorMessageProps()}>{errorMessage}</div>\n </div>\n ) : null}\n </div>\n );\n};\n\nexport default Switch;\n","import Switch from './Switch';\n\nexport type { SwitchProps } from './Switch';\n\nexport { Switch };\n\nexport default Switch;\n"],"mappings":";;;;;;;;;AAaA,MAAa,iDAAoB,EAC/B,OAAO;CACL,MAAM;CACN,YAAY;CACZ,cAAc;CAGd,OACE;CACF,cAAc;CACd,cAAc;CACd,OAAO;CACP,WAAW;CACX,SAAS;CACV,EACF,CAAC;;;;AA+BF,MAAM,UAAU,EACd,YAAY,QACZ,aAAa,QACb,MACA,OAAO,QACP,eAAe,QACf,YAAY,QACZ,GAAG,wBACc;CACjB,MAAM,EACJ,WACA,cACA,UACA,cACA,OACA,sBACA,uBACA,SACA,OACA,QACA,UACA,KACA,UACA,WACEA,wCAAgB;EAClB;EACA,GAAG;EACJ,CAAC;CAGF,MAAM,oCAA2C,KAAK;CAItD,MAAM,+DADW,gBAAgB,EACiB,WAAW,eAAe;AAE5E,QACE,4CAAC;EAAI,WAAW,WAAW;;GAEzB,2CAACC,yDACC,2CAAC;IACM;IACL,cAAY;IACZ,SAAS,CAAC,CAAC,MAAM;IACX;IACE;IACR,MAAK;IACL,WAAW,MAAM;AACf,cAAS,EAAE,OAAO,QAAQ;;IAE5B,eAAe;AAGb,qBAAgB,SAAS,OAAO;;KAElC,GACa;GAEjB,2CAACC;IACC,KAAK;IACL,cAAY;IACA;IACZ,gBAAc;IACd,iBAAe;IACf,eAAa;IACb,iBAAiB,CAAC,CAAC;IACP;IACZ,YAAY;IACZ,YAAY,CAAC,CAAC,MAAM;IACpB,MAAM,GAAG,KAAK;IACd,eAAe;IACT;IACQ;IACH;cAEV;KACU;GACZ,UACC,2CAAC;IACC,GAAI,uBAAuB;IAC3B,2CACE,uBAAuB,EAAE,WAEzB,aACD;cAED,2CAAC;KAAI,GAAI,sBAAsB;eAAG;MAAmB;KACjD,GACJ;;GACA;;AAIV,qBAAe;;;;AClJf,uBAAeC"}
|
package/dist/SwitchBox/index.cjs
CHANGED
|
@@ -1,21 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
+
const require_SwitchBox = require('../SwitchBox-DqVmZYId.cjs');
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
require('../chunk-V3M7HL26.cjs');
|
|
7
|
-
require('../chunk-OE5BOGGX.cjs');
|
|
8
|
-
require('../chunk-NHEZXA4H.cjs');
|
|
9
|
-
require('../chunk-6AWHOBNL.cjs');
|
|
10
|
-
require('../chunk-PCTYJUY7.cjs');
|
|
11
|
-
require('../chunk-56TQOKG7.cjs');
|
|
12
|
-
require('../chunk-FYN7ZWLW.cjs');
|
|
13
|
-
require('../chunk-AQJLKHAE.cjs');
|
|
14
|
-
require('../chunk-OKJWLH7T.cjs');
|
|
15
|
-
require('../chunk-555JRYCS.cjs');
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
exports.SwitchBox = _chunkSW3NGBCEcjs.SwitchBox_default; exports.default = _chunkSW3NGBCEcjs.SwitchBox_default2; exports.switchBoxVariants = _chunkSW3NGBCEcjs.switchBoxVariants;
|
|
21
|
-
//# sourceMappingURL=index.cjs.map
|
|
4
|
+
exports.SwitchBox = require_SwitchBox.SwitchBox_default$1;
|
|
5
|
+
exports.default = require_SwitchBox.SwitchBox_default;
|
|
6
|
+
exports.switchBoxVariants = require_SwitchBox.switchBoxVariants;
|
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import 'react/jsx-runtime';
|
|
4
|
-
import 'tailwind-variants';
|
|
5
|
-
import '@fuf-stack/pixel-utils';
|
|
6
|
-
import '@heroui/switch';
|
|
7
|
-
import 'react';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export { SwitchBox, SwitchBox as default };
|
|
1
|
+
import { n as SwitchBoxProps, r as switchBoxVariants, t as SwitchBox } from "../index-Dklb-p_1.cjs";
|
|
2
|
+
export { SwitchBox, SwitchBox as default, SwitchBoxProps, switchBoxVariants };
|
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import 'react/jsx-runtime';
|
|
4
|
-
import 'tailwind-variants';
|
|
5
|
-
import '@fuf-stack/pixel-utils';
|
|
6
|
-
import '@heroui/switch';
|
|
7
|
-
import 'react';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export { SwitchBox, SwitchBox as default };
|
|
1
|
+
import { n as SwitchBoxProps, r as switchBoxVariants, t as SwitchBox } from "../index-DhMSgdwM.js";
|
|
2
|
+
export { SwitchBox, SwitchBox as default, SwitchBoxProps, switchBoxVariants };
|
package/dist/SwitchBox/index.js
CHANGED
|
@@ -1,21 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
switchBoxVariants
|
|
5
|
-
} from "../chunk-2HDXHQOC.js";
|
|
6
|
-
import "../chunk-GEC75GNL.js";
|
|
7
|
-
import "../chunk-NTDKZW4E.js";
|
|
8
|
-
import "../chunk-ELYGQTXB.js";
|
|
9
|
-
import "../chunk-5MTIQ6WD.js";
|
|
10
|
-
import "../chunk-AHJJIANM.js";
|
|
11
|
-
import "../chunk-CNTOODUQ.js";
|
|
12
|
-
import "../chunk-SJWL6EMI.js";
|
|
13
|
-
import "../chunk-IV45K4WU.js";
|
|
14
|
-
import "../chunk-O2XJNQQK.js";
|
|
15
|
-
import "../chunk-K2V4ULA2.js";
|
|
16
|
-
export {
|
|
17
|
-
SwitchBox_default as SwitchBox,
|
|
18
|
-
SwitchBox_default2 as default,
|
|
19
|
-
switchBoxVariants
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import { n as SwitchBox_default, r as switchBoxVariants, t as SwitchBox_default$1 } from "../SwitchBox-DPHryDOM.js";
|
|
2
|
+
|
|
3
|
+
export { SwitchBox_default as SwitchBox, SwitchBox_default$1 as default, switchBoxVariants };
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { t as useUniformField } from "./useUniformField-ClprfrES.js";
|
|
2
|
+
import { cn, tv, variantsToClassNames } from "@fuf-stack/pixel-utils";
|
|
3
|
+
import { useRef } from "react";
|
|
4
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
+
import { VisuallyHidden } from "@react-aria/visually-hidden";
|
|
6
|
+
import { useSwitch } from "@heroui/switch";
|
|
7
|
+
|
|
8
|
+
//#region src/SwitchBox/SwitchBox.tsx
|
|
9
|
+
const switchBoxVariants = tv({
|
|
10
|
+
slots: {
|
|
11
|
+
box: "group inline-flex w-full cursor-pointer items-center justify-between rounded-lg border-2 border-default hover:bg-content2 data-[selected=true]:border-focus",
|
|
12
|
+
description: "text-foreground opacity-70",
|
|
13
|
+
icon: "",
|
|
14
|
+
label: "font-medium text-foreground group-data-[required=true]:after:ml-0.5 group-data-[required=true]:after:text-danger group-data-[required=true]:after:content-[\"*\"]",
|
|
15
|
+
wrapper: "",
|
|
16
|
+
thumb: "",
|
|
17
|
+
thumbIcon: ""
|
|
18
|
+
},
|
|
19
|
+
variants: {
|
|
20
|
+
isDisabled: { true: { box: "pointer-events-none opacity-disabled" } },
|
|
21
|
+
isInvalid: { true: {
|
|
22
|
+
box: "!border-danger",
|
|
23
|
+
label: "!text-danger"
|
|
24
|
+
} },
|
|
25
|
+
size: {
|
|
26
|
+
sm: {
|
|
27
|
+
box: "gap-2 p-3",
|
|
28
|
+
description: "text-xs",
|
|
29
|
+
label: "text-xs"
|
|
30
|
+
},
|
|
31
|
+
md: {
|
|
32
|
+
box: "gap-4 p-4",
|
|
33
|
+
description: "text-small",
|
|
34
|
+
label: "text-sm"
|
|
35
|
+
},
|
|
36
|
+
lg: {
|
|
37
|
+
box: "gap-4 p-5",
|
|
38
|
+
description: "text-small",
|
|
39
|
+
label: "text-base"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
defaultVariants: { size: "md" }
|
|
44
|
+
});
|
|
45
|
+
/**
|
|
46
|
+
* SwitchBox component - A card-like box with a switch control
|
|
47
|
+
*/
|
|
48
|
+
const SwitchBox = ({ className = void 0, description = void 0, icon = void 0, name, size = void 0, thumbIcon = void 0, ...uniformFieldProps }) => {
|
|
49
|
+
const { defaultValue, disabled, errorMessage, field, getErrorMessageProps, getHelperWrapperProps, invalid, label, onBlur, onChange, ref, required, testId } = useUniformField({
|
|
50
|
+
name,
|
|
51
|
+
...uniformFieldProps
|
|
52
|
+
});
|
|
53
|
+
const visualSwitchRef = useRef(null);
|
|
54
|
+
const { Component, slots, isSelected, getBaseProps, getInputProps, getWrapperProps } = useSwitch({
|
|
55
|
+
defaultSelected: !!defaultValue,
|
|
56
|
+
isDisabled: disabled,
|
|
57
|
+
isSelected: !!field.value,
|
|
58
|
+
name: `${name}_switch`,
|
|
59
|
+
onValueChange: onChange,
|
|
60
|
+
size,
|
|
61
|
+
thumbIcon
|
|
62
|
+
});
|
|
63
|
+
const classNames = variantsToClassNames(switchBoxVariants({
|
|
64
|
+
isDisabled: disabled,
|
|
65
|
+
isInvalid: invalid,
|
|
66
|
+
size
|
|
67
|
+
}), className, "box");
|
|
68
|
+
return /* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsxs(Component, {
|
|
69
|
+
...getBaseProps(),
|
|
70
|
+
className: classNames.box,
|
|
71
|
+
"data-invalid": invalid,
|
|
72
|
+
"data-required": required,
|
|
73
|
+
"data-testid": testId,
|
|
74
|
+
children: [
|
|
75
|
+
/* @__PURE__ */ jsxs(VisuallyHidden, { children: [/* @__PURE__ */ jsx("input", {
|
|
76
|
+
ref,
|
|
77
|
+
"aria-label": typeof label === "string" ? label : name,
|
|
78
|
+
checked: !!field.value,
|
|
79
|
+
name,
|
|
80
|
+
tabIndex: -1,
|
|
81
|
+
type: "checkbox",
|
|
82
|
+
onChange: (e) => {
|
|
83
|
+
onChange(e.target.checked);
|
|
84
|
+
},
|
|
85
|
+
onFocus: () => {
|
|
86
|
+
visualSwitchRef.current?.focus();
|
|
87
|
+
}
|
|
88
|
+
}), /* @__PURE__ */ jsx("input", {
|
|
89
|
+
ref: visualSwitchRef,
|
|
90
|
+
...getInputProps(),
|
|
91
|
+
onBlur: (e) => {
|
|
92
|
+
getInputProps().onBlur?.(e);
|
|
93
|
+
onBlur();
|
|
94
|
+
}
|
|
95
|
+
})] }),
|
|
96
|
+
!icon ? /* @__PURE__ */ jsx("span", {
|
|
97
|
+
...getWrapperProps(),
|
|
98
|
+
className: cn(getWrapperProps().className, classNames.wrapper),
|
|
99
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
100
|
+
className: cn(slots.thumb({ class: classNames.thumb })),
|
|
101
|
+
children: thumbIcon && typeof thumbIcon === "function" ? thumbIcon({
|
|
102
|
+
isSelected: !!isSelected,
|
|
103
|
+
className: slots.thumbIcon({ class: classNames.thumbIcon }),
|
|
104
|
+
width: "1em",
|
|
105
|
+
height: "1em",
|
|
106
|
+
"data-checked": isSelected ? "true" : "false"
|
|
107
|
+
}) : thumbIcon
|
|
108
|
+
})
|
|
109
|
+
}) : null,
|
|
110
|
+
icon ? /* @__PURE__ */ jsx("div", {
|
|
111
|
+
className: classNames.icon,
|
|
112
|
+
children: icon
|
|
113
|
+
}) : null,
|
|
114
|
+
/* @__PURE__ */ jsxs("div", {
|
|
115
|
+
className: "grow",
|
|
116
|
+
children: [label ? /* @__PURE__ */ jsx("div", {
|
|
117
|
+
className: classNames.label,
|
|
118
|
+
children: label
|
|
119
|
+
}) : null, description ? /* @__PURE__ */ jsx("div", {
|
|
120
|
+
className: classNames.description,
|
|
121
|
+
children: description
|
|
122
|
+
}) : null]
|
|
123
|
+
}),
|
|
124
|
+
icon ? /* @__PURE__ */ jsx("span", {
|
|
125
|
+
...getWrapperProps(),
|
|
126
|
+
className: cn(getWrapperProps().className, classNames.wrapper),
|
|
127
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
128
|
+
className: cn(slots.thumb({ class: classNames.thumb })),
|
|
129
|
+
children: thumbIcon && typeof thumbIcon === "function" ? thumbIcon({
|
|
130
|
+
isSelected: !!isSelected,
|
|
131
|
+
className: slots.thumbIcon({ class: classNames.thumbIcon }),
|
|
132
|
+
width: "1em",
|
|
133
|
+
height: "1em",
|
|
134
|
+
"data-checked": isSelected ? "true" : "false"
|
|
135
|
+
}) : thumbIcon
|
|
136
|
+
})
|
|
137
|
+
}) : null
|
|
138
|
+
]
|
|
139
|
+
}), invalid ? /* @__PURE__ */ jsx("div", {
|
|
140
|
+
...getHelperWrapperProps(),
|
|
141
|
+
className: cn(getHelperWrapperProps()?.className, "ml-0 block"),
|
|
142
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
143
|
+
...getErrorMessageProps(),
|
|
144
|
+
children: errorMessage
|
|
145
|
+
})
|
|
146
|
+
}) : null] });
|
|
147
|
+
};
|
|
148
|
+
var SwitchBox_default = SwitchBox;
|
|
149
|
+
|
|
150
|
+
//#endregion
|
|
151
|
+
//#region src/SwitchBox/index.ts
|
|
152
|
+
var SwitchBox_default$1 = SwitchBox_default;
|
|
153
|
+
|
|
154
|
+
//#endregion
|
|
155
|
+
export { SwitchBox_default as n, switchBoxVariants as r, SwitchBox_default$1 as t };
|
|
156
|
+
//# sourceMappingURL=SwitchBox-DPHryDOM.js.map
|