@fuf-stack/uniform 1.22.5 → 1.22.7
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 +113 -4
- package/dist/Checkboxes/index.cjs.map +1 -0
- package/dist/Checkboxes/index.d.cts +534 -2
- package/dist/Checkboxes/index.d.cts.map +1 -0
- package/dist/Checkboxes/index.d.ts +534 -2
- package/dist/Checkboxes/index.d.ts.map +1 -0
- package/dist/Checkboxes/index.js +112 -2
- package/dist/Checkboxes/index.js.map +1 -0
- package/dist/DatePicker/index.cjs +194 -4
- package/dist/DatePicker/index.cjs.map +1 -0
- package/dist/DatePicker/index.d.cts +1413 -2
- package/dist/{index-D7AUghFx.d.ts.map → DatePicker/index.d.cts.map} +1 -1
- package/dist/DatePicker/index.d.ts +1413 -2
- package/dist/{index-CD0Wpla3.d.cts.map → DatePicker/index.d.ts.map} +1 -1
- package/dist/DatePicker/index.js +193 -2
- package/dist/DatePicker/index.js.map +1 -0
- package/dist/FieldArray/index.cjs +495 -4
- package/dist/FieldArray/index.cjs.map +1 -0
- package/dist/FieldArray/index.d.cts +539 -2
- package/dist/{index-B4XExHDi.d.cts.map → FieldArray/index.d.cts.map} +1 -1
- package/dist/FieldArray/index.d.ts +539 -2
- package/dist/{index-yYjVSHlN.d.ts.map → FieldArray/index.d.ts.map} +1 -1
- package/dist/FieldArray/index.js +494 -2
- package/dist/FieldArray/index.js.map +1 -0
- package/dist/FieldCard/index.cjs +226 -4
- package/dist/FieldCard/index.cjs.map +1 -0
- package/dist/FieldCard/index.d.cts +314 -2
- package/dist/FieldCard/index.d.cts.map +1 -0
- package/dist/FieldCard/index.d.ts +314 -2
- package/dist/FieldCard/index.d.ts.map +1 -0
- package/dist/FieldCard/index.js +225 -2
- package/dist/FieldCard/index.js.map +1 -0
- package/dist/{FieldCopyTestIdButton-Dpmo0uBV.js → FieldCopyTestIdButton-CRJBix9D.js} +2 -2
- package/dist/{FieldCopyTestIdButton-Dpmo0uBV.js.map → FieldCopyTestIdButton-CRJBix9D.js.map} +1 -1
- package/dist/{FieldCopyTestIdButton-ptoB1F75.cjs → FieldCopyTestIdButton-D3D_LmJh.cjs} +1 -8
- package/dist/{FieldCopyTestIdButton-ptoB1F75.cjs.map → FieldCopyTestIdButton-D3D_LmJh.cjs.map} +1 -1
- package/dist/{FieldValidationError-ktTyyyip.js → FieldValidationError-ByRoIxaM.js} +5 -5
- package/dist/{FieldValidationError-ktTyyyip.js.map → FieldValidationError-ByRoIxaM.js.map} +1 -1
- package/dist/{FieldValidationError-BQcvvU9i.cjs → FieldValidationError-CfYKzl7P.cjs} +5 -6
- package/dist/{FieldValidationError-BQcvvU9i.cjs.map → FieldValidationError-CfYKzl7P.cjs.map} +1 -1
- package/dist/Form/index.cjs +122 -3
- package/dist/Form/index.cjs.map +1 -0
- package/dist/Form/index.d.cts +43 -2
- package/dist/Form/index.d.cts.map +1 -0
- package/dist/Form/index.d.ts +43 -2
- package/dist/Form/index.d.ts.map +1 -0
- package/dist/Form/index.js +122 -2
- package/dist/Form/index.js.map +1 -0
- package/dist/{FormContext-3kamRn2C.d.cts → FormContext-BLWS7bhO.d.cts} +1 -1
- package/dist/{FormContext-3kamRn2C.d.cts.map → FormContext-BLWS7bhO.d.cts.map} +1 -1
- package/dist/{FormContext-BQeKOV-0.js → FormContext-DjJOJKxj.js} +1 -1
- package/dist/{FormContext-BQeKOV-0.js.map → FormContext-DjJOJKxj.js.map} +1 -1
- package/dist/{FormContext-DsmS_mkO.cjs → FormContext-EGH0cVnH.cjs} +1 -1
- package/dist/{FormContext-DsmS_mkO.cjs.map → FormContext-EGH0cVnH.cjs.map} +1 -1
- package/dist/{FormContext-i66vM5f1.d.ts → FormContext-LgzrDWu1.d.ts} +1 -1
- package/dist/{FormContext-i66vM5f1.d.ts.map → FormContext-LgzrDWu1.d.ts.map} +1 -1
- package/dist/Grid/index.cjs +1 -2
- package/dist/Grid/index.d.cts +22 -2
- package/dist/Grid/index.d.cts.map +1 -0
- package/dist/Grid/index.d.ts +22 -2
- package/dist/Grid/index.d.ts.map +1 -0
- package/dist/Grid/index.js +2 -2
- package/dist/{Grid-D-VcRGi9.cjs → Grid-BbqCRkuY.cjs} +1 -8
- package/dist/{Grid-D-VcRGi9.cjs.map → Grid-BbqCRkuY.cjs.map} +1 -1
- package/dist/{Grid-BQpLOB0G.js → Grid-CTs-Rb9G.js} +2 -2
- package/dist/{Grid-BQpLOB0G.js.map → Grid-CTs-Rb9G.js.map} +1 -1
- package/dist/Input/index.cjs +96 -3
- package/dist/Input/index.cjs.map +1 -0
- package/dist/Input/index.d.cts +677 -2
- package/dist/Input/index.d.cts.map +1 -0
- package/dist/Input/index.d.ts +677 -2
- package/dist/Input/index.d.ts.map +1 -0
- package/dist/Input/index.js +96 -2
- package/dist/Input/index.js.map +1 -0
- package/dist/RadioBoxes/index.cjs +136 -4
- package/dist/RadioBoxes/index.cjs.map +1 -0
- package/dist/RadioBoxes/index.d.cts +1477 -2
- package/dist/RadioBoxes/index.d.cts.map +1 -0
- package/dist/RadioBoxes/index.d.ts +1477 -2
- package/dist/RadioBoxes/index.d.ts.map +1 -0
- package/dist/RadioBoxes/index.js +135 -2
- package/dist/RadioBoxes/index.js.map +1 -0
- package/dist/RadioTabs/index.cjs +123 -4
- package/dist/RadioTabs/index.cjs.map +1 -0
- package/dist/RadioTabs/index.d.cts +585 -2
- package/dist/RadioTabs/index.d.cts.map +1 -0
- package/dist/RadioTabs/index.d.ts +585 -2
- package/dist/RadioTabs/index.d.ts.map +1 -0
- package/dist/RadioTabs/index.js +120 -2
- package/dist/RadioTabs/index.js.map +1 -0
- package/dist/Radios/index.cjs +74 -4
- package/dist/Radios/index.cjs.map +1 -0
- package/dist/Radios/index.d.cts +1263 -2
- package/dist/{index-DCwffq1f.d.ts.map → Radios/index.d.cts.map} +1 -1
- package/dist/Radios/index.d.ts +1263 -2
- package/dist/{index-CqXEYILn.d.cts.map → Radios/index.d.ts.map} +1 -1
- package/dist/Radios/index.js +73 -2
- package/dist/Radios/index.js.map +1 -0
- package/dist/Select/index.cjs +286 -4
- package/dist/Select/index.cjs.map +1 -0
- package/dist/Select/index.d.cts +3917 -2
- package/dist/{index-D1cB3mbB.d.ts.map → Select/index.d.cts.map} +1 -1
- package/dist/Select/index.d.ts +3917 -2
- package/dist/{index-veBM95Gw.d.cts.map → Select/index.d.ts.map} +1 -1
- package/dist/Select/index.js +283 -2
- package/dist/Select/index.js.map +1 -0
- package/dist/Slider/index.cjs +109 -4
- package/dist/Slider/index.cjs.map +1 -0
- package/dist/Slider/index.d.cts +1760 -2
- package/dist/{index-BUZEnZDm.d.ts.map → Slider/index.d.cts.map} +1 -1
- package/dist/Slider/index.d.ts +1760 -2
- package/dist/{index-Bie3CWyW.d.cts.map → Slider/index.d.ts.map} +1 -1
- package/dist/Slider/index.js +108 -2
- package/dist/Slider/index.js.map +1 -0
- package/dist/SubmitButton/index.cjs +31 -3
- package/dist/SubmitButton/index.cjs.map +1 -0
- package/dist/SubmitButton/index.d.cts +38 -2
- package/dist/SubmitButton/index.d.cts.map +1 -0
- package/dist/SubmitButton/index.d.ts +38 -2
- package/dist/SubmitButton/index.d.ts.map +1 -0
- package/dist/SubmitButton/index.js +31 -2
- package/dist/SubmitButton/index.js.map +1 -0
- package/dist/Switch/index.cjs +82 -4
- package/dist/Switch/index.cjs.map +1 -0
- package/dist/Switch/index.d.cts +1257 -2
- package/dist/{index-DqMpHpu7.d.ts.map → Switch/index.d.cts.map} +1 -1
- package/dist/Switch/index.d.ts +1257 -2
- package/dist/{index-19JGtN7H.d.cts.map → Switch/index.d.ts.map} +1 -1
- package/dist/Switch/index.js +81 -2
- package/dist/Switch/index.js.map +1 -0
- package/dist/SwitchBox/index.cjs +154 -4
- package/dist/SwitchBox/index.cjs.map +1 -0
- package/dist/SwitchBox/index.d.cts +473 -2
- package/dist/SwitchBox/index.d.cts.map +1 -0
- package/dist/SwitchBox/index.d.ts +473 -2
- package/dist/SwitchBox/index.d.ts.map +1 -0
- package/dist/SwitchBox/index.js +153 -2
- package/dist/SwitchBox/index.js.map +1 -0
- package/dist/TextArea/index.cjs +66 -3
- package/dist/TextArea/index.cjs.map +1 -0
- package/dist/TextArea/index.d.cts +659 -2
- package/dist/TextArea/index.d.cts.map +1 -0
- package/dist/TextArea/index.d.ts +659 -2
- package/dist/TextArea/index.d.ts.map +1 -0
- package/dist/TextArea/index.js +66 -2
- package/dist/TextArea/index.js.map +1 -0
- package/dist/Time/index.cjs +217 -4
- package/dist/Time/index.cjs.map +1 -0
- package/dist/Time/index.d.cts +1028 -2
- package/dist/Time/index.d.cts.map +1 -0
- package/dist/Time/index.d.ts +1028 -2
- package/dist/Time/index.d.ts.map +1 -0
- package/dist/Time/index.js +216 -2
- package/dist/Time/index.js.map +1 -0
- package/dist/helpers/index.cjs +0 -1
- package/dist/helpers/index.cjs.map +1 -1
- package/dist/helpers/index.js.map +1 -1
- package/dist/hooks/useClientValidation/index.cjs +177 -3
- package/dist/hooks/useClientValidation/index.cjs.map +1 -1
- package/dist/hooks/useClientValidation/index.d.cts +148 -2
- package/dist/hooks/useClientValidation/index.d.cts.map +1 -0
- package/dist/hooks/useClientValidation/index.d.ts +148 -2
- package/dist/hooks/useClientValidation/index.d.ts.map +1 -0
- package/dist/hooks/useClientValidation/index.js +175 -1
- package/dist/hooks/useClientValidation/index.js.map +1 -1
- package/dist/hooks/useController/index.cjs +1 -1
- package/dist/hooks/useController/index.d.cts +1 -1
- package/dist/hooks/useController/index.d.ts +1 -1
- package/dist/hooks/useController/index.js +1 -1
- package/dist/hooks/useFormContext/index.cjs +1 -1
- package/dist/hooks/useFormContext/index.d.cts +1 -1
- package/dist/hooks/useFormContext/index.d.ts +1 -1
- package/dist/hooks/useFormContext/index.js +1 -1
- package/dist/hooks/useInput/index.cjs +0 -1
- package/dist/hooks/useInput/index.d.cts +1 -1
- package/dist/hooks/useInput/index.d.ts +1 -1
- package/dist/hooks/useInput/index.js +1 -1
- package/dist/hooks/useInputValueDebounce/index.cjs +1 -2
- package/dist/hooks/useInputValueDebounce/index.cjs.map +1 -1
- package/dist/hooks/useInputValueDebounce/index.d.cts +66 -2
- package/dist/hooks/useInputValueDebounce/index.d.cts.map +1 -0
- package/dist/hooks/useInputValueDebounce/index.d.ts +66 -2
- package/dist/hooks/useInputValueDebounce/index.d.ts.map +1 -0
- package/dist/hooks/useInputValueDebounce/index.js +1 -1
- package/dist/hooks/useInputValueTransform/index.cjs +1 -1
- package/dist/hooks/useInputValueTransform/index.d.cts +1 -1
- package/dist/hooks/useInputValueTransform/index.d.ts +1 -1
- package/dist/hooks/useInputValueTransform/index.js +1 -1
- package/dist/hooks/useUniformField/index.cjs +8 -8
- package/dist/hooks/useUniformField/index.cjs.map +1 -1
- package/dist/hooks/useUniformField/index.d.cts +98 -2
- package/dist/hooks/useUniformField/index.d.cts.map +1 -0
- package/dist/hooks/useUniformField/index.d.ts +98 -2
- package/dist/hooks/useUniformField/index.d.ts.map +1 -0
- package/dist/hooks/useUniformField/index.js +8 -8
- package/dist/hooks/useUniformField/index.js.map +1 -1
- package/dist/hooks/useUniformFieldArray/index.cjs +1 -2
- package/dist/hooks/useUniformFieldArray/index.cjs.map +1 -1
- package/dist/hooks/useUniformFieldArray/index.d.cts +79 -2
- package/dist/hooks/useUniformFieldArray/index.d.cts.map +1 -0
- package/dist/hooks/useUniformFieldArray/index.d.ts +79 -2
- package/dist/hooks/useUniformFieldArray/index.d.ts.map +1 -0
- package/dist/hooks/useUniformFieldArray/index.js +1 -1
- package/dist/hooks/useWatchFormReset/index.cjs +1 -2
- package/dist/hooks/useWatchFormReset/index.cjs.map +1 -1
- package/dist/hooks/useWatchFormReset/index.d.cts +38 -2
- package/dist/hooks/useWatchFormReset/index.d.cts.map +1 -0
- package/dist/hooks/useWatchFormReset/index.d.ts +38 -2
- package/dist/hooks/useWatchFormReset/index.d.ts.map +1 -0
- package/dist/hooks/useWatchFormReset/index.js +1 -1
- package/dist/hooks/useWatchUserChange/index.cjs +82 -2
- package/dist/hooks/useWatchUserChange/index.cjs.map +1 -1
- package/dist/hooks/useWatchUserChange/index.d.cts +80 -2
- package/dist/hooks/useWatchUserChange/index.d.cts.map +1 -0
- package/dist/hooks/useWatchUserChange/index.d.ts +80 -2
- package/dist/hooks/useWatchUserChange/index.d.ts.map +1 -0
- package/dist/hooks/useWatchUserChange/index.js +81 -1
- package/dist/hooks/useWatchUserChange/index.js.map +1 -1
- package/dist/partials/FieldCopyTestIdButton/index.cjs +1 -2
- package/dist/partials/FieldCopyTestIdButton/index.d.cts +14 -2
- package/dist/partials/FieldCopyTestIdButton/index.d.cts.map +1 -0
- package/dist/partials/FieldCopyTestIdButton/index.d.ts +14 -2
- package/dist/partials/FieldCopyTestIdButton/index.d.ts.map +1 -0
- package/dist/partials/FieldCopyTestIdButton/index.js +2 -2
- package/dist/partials/FieldValidationError/index.cjs +1 -2
- package/dist/partials/FieldValidationError/index.d.cts +22 -2
- package/dist/partials/FieldValidationError/index.d.cts.map +1 -0
- package/dist/partials/FieldValidationError/index.d.ts +22 -2
- package/dist/partials/FieldValidationError/index.d.ts.map +1 -0
- package/dist/partials/FieldValidationError/index.js +2 -2
- package/dist/{useController-CzP0aVFC.d.ts → useController-CvQqCvFJ.d.ts} +1 -1
- package/dist/{useController-CzP0aVFC.d.ts.map → useController-CvQqCvFJ.d.ts.map} +1 -1
- package/dist/{useController--lRPWBuD.cjs → useController-Dbe7ADG6.cjs} +2 -2
- package/dist/{useController--lRPWBuD.cjs.map → useController-Dbe7ADG6.cjs.map} +1 -1
- package/dist/{useController-B287flU_.js → useController-DxFS0u7c.js} +2 -2
- package/dist/{useController-B287flU_.js.map → useController-DxFS0u7c.js.map} +1 -1
- package/dist/{useController-BT3Fd0IO.d.cts → useController-fblEApv_.d.cts} +1 -1
- package/dist/{useController-BT3Fd0IO.d.cts.map → useController-fblEApv_.d.cts.map} +1 -1
- package/dist/{useFormContext-Bj1gXLt_.d.ts → useFormContext-B1-deU4Z.d.ts} +2 -2
- package/dist/{useFormContext-Bj1gXLt_.d.ts.map → useFormContext-B1-deU4Z.d.ts.map} +1 -1
- package/dist/{useFormContext-CT8H8xIe.js → useFormContext-BJqa1FoT.js} +2 -2
- package/dist/{useFormContext-CT8H8xIe.js.map → useFormContext-BJqa1FoT.js.map} +1 -1
- package/dist/{useFormContext-M94eQfHm.d.cts → useFormContext-D5vrT2sg.d.cts} +2 -2
- package/dist/{useFormContext-M94eQfHm.d.cts.map → useFormContext-D5vrT2sg.d.cts.map} +1 -1
- package/dist/{useFormContext-CrXwNYiB.cjs → useFormContext-kUHonwgu.cjs} +2 -2
- package/dist/{useFormContext-CrXwNYiB.cjs.map → useFormContext-kUHonwgu.cjs.map} +1 -1
- package/dist/{useInputValueTransform-CNCBU7a9.d.cts → useInputValueTransform-DCXXb2Lp.d.cts} +1 -1
- package/dist/{useInputValueTransform-CNCBU7a9.d.cts.map → useInputValueTransform-DCXXb2Lp.d.cts.map} +1 -1
- package/dist/{useInputValueTransform-dLfFIYW4.d.ts → useInputValueTransform-DCXXb2Lp.d.ts} +1 -1
- package/dist/{useInputValueTransform-dLfFIYW4.d.ts.map → useInputValueTransform-DCXXb2Lp.d.ts.map} +1 -1
- package/dist/{useInputValueTransform-CXdmtc0Q.js → useInputValueTransform-DJ5zkqSy.js} +1 -1
- package/dist/{useInputValueTransform-CXdmtc0Q.js.map → useInputValueTransform-DJ5zkqSy.js.map} +1 -1
- package/dist/{useInputValueTransform-Bm65K8LX.cjs → useInputValueTransform-P62UUZBl.cjs} +1 -2
- package/dist/{useInputValueTransform-Bm65K8LX.cjs.map → useInputValueTransform-P62UUZBl.cjs.map} +1 -1
- package/package.json +5 -12
- package/dist/Checkboxes-DrJqx6O2.cjs +0 -130
- package/dist/Checkboxes-DrJqx6O2.cjs.map +0 -1
- package/dist/Checkboxes-X6FRwI50.js +0 -112
- package/dist/Checkboxes-X6FRwI50.js.map +0 -1
- package/dist/DatePicker-CGIWizz9.js +0 -193
- package/dist/DatePicker-CGIWizz9.js.map +0 -1
- package/dist/DatePicker-CYUuwwsm.cjs +0 -211
- package/dist/DatePicker-CYUuwwsm.cjs.map +0 -1
- package/dist/FieldArray-Dkw6JBnT.js +0 -494
- package/dist/FieldArray-Dkw6JBnT.js.map +0 -1
- package/dist/FieldArray-V66fsvtd.cjs +0 -512
- package/dist/FieldArray-V66fsvtd.cjs.map +0 -1
- package/dist/FieldCard-CAHnM8C0.cjs +0 -243
- package/dist/FieldCard-CAHnM8C0.cjs.map +0 -1
- package/dist/FieldCard-Cg31ce9J.js +0 -225
- package/dist/FieldCard-Cg31ce9J.js.map +0 -1
- package/dist/Form-CYlsIABv.cjs +0 -125
- package/dist/Form-CYlsIABv.cjs.map +0 -1
- package/dist/Form-D3yfDu4L.js +0 -114
- package/dist/Form-D3yfDu4L.js.map +0 -1
- package/dist/Input-B5RxbkNS.js +0 -96
- package/dist/Input-B5RxbkNS.js.map +0 -1
- package/dist/Input-DvVViuWH.cjs +0 -108
- package/dist/Input-DvVViuWH.cjs.map +0 -1
- package/dist/RadioBoxes-BmLrbYXt.cjs +0 -153
- package/dist/RadioBoxes-BmLrbYXt.cjs.map +0 -1
- package/dist/RadioBoxes-DWxJBTKR.js +0 -135
- package/dist/RadioBoxes-DWxJBTKR.js.map +0 -1
- package/dist/RadioTabs-14XTbTJU.cjs +0 -139
- package/dist/RadioTabs-14XTbTJU.cjs.map +0 -1
- package/dist/RadioTabs-DAY6MYJI.js +0 -120
- package/dist/RadioTabs-DAY6MYJI.js.map +0 -1
- package/dist/Radios-C938-msm.js +0 -73
- package/dist/Radios-C938-msm.js.map +0 -1
- package/dist/Radios-D_B9Y8s2.cjs +0 -91
- package/dist/Radios-D_B9Y8s2.cjs.map +0 -1
- package/dist/Select-BL6k_e-D.js +0 -283
- package/dist/Select-BL6k_e-D.js.map +0 -1
- package/dist/Select-D66A-hYm.cjs +0 -302
- package/dist/Select-D66A-hYm.cjs.map +0 -1
- package/dist/Slider-ChC2PZNb.cjs +0 -126
- package/dist/Slider-ChC2PZNb.cjs.map +0 -1
- package/dist/Slider-DmEwhC1T.js +0 -108
- package/dist/Slider-DmEwhC1T.js.map +0 -1
- package/dist/SubmitButton-D-wn1PJV.cjs +0 -43
- package/dist/SubmitButton-D-wn1PJV.cjs.map +0 -1
- package/dist/SubmitButton-D6aU7IgC.js +0 -31
- package/dist/SubmitButton-D6aU7IgC.js.map +0 -1
- package/dist/Switch-Ch6_VInV.cjs +0 -99
- package/dist/Switch-Ch6_VInV.cjs.map +0 -1
- package/dist/Switch-DvKRPFcC.js +0 -81
- package/dist/Switch-DvKRPFcC.js.map +0 -1
- package/dist/SwitchBox-BU1XieaZ.js +0 -153
- package/dist/SwitchBox-BU1XieaZ.js.map +0 -1
- package/dist/SwitchBox-Dl-F5y2m.cjs +0 -171
- package/dist/SwitchBox-Dl-F5y2m.cjs.map +0 -1
- package/dist/TextArea-CMXm-kTK.cjs +0 -78
- package/dist/TextArea-CMXm-kTK.cjs.map +0 -1
- package/dist/TextArea-DAg_K-QP.js +0 -66
- package/dist/TextArea-DAg_K-QP.js.map +0 -1
- package/dist/Time-B_SXrKWK.js +0 -216
- package/dist/Time-B_SXrKWK.js.map +0 -1
- package/dist/Time-CYoWaQsz.cjs +0 -234
- package/dist/Time-CYoWaQsz.cjs.map +0 -1
- package/dist/index-19JGtN7H.d.cts +0 -1257
- package/dist/index-54OZEaUU.d.ts +0 -43
- package/dist/index-54OZEaUU.d.ts.map +0 -1
- package/dist/index-B4XExHDi.d.cts +0 -539
- package/dist/index-BUZEnZDm.d.ts +0 -1760
- package/dist/index-Bbaubtxp.d.cts +0 -677
- package/dist/index-Bbaubtxp.d.cts.map +0 -1
- package/dist/index-BdgFJ-dj.d.ts +0 -1028
- package/dist/index-BdgFJ-dj.d.ts.map +0 -1
- package/dist/index-BiZNkLK3.d.cts +0 -1477
- package/dist/index-BiZNkLK3.d.cts.map +0 -1
- package/dist/index-Bie3CWyW.d.cts +0 -1760
- package/dist/index-BqxDWhNr.d.cts +0 -22
- package/dist/index-BqxDWhNr.d.cts.map +0 -1
- package/dist/index-BsTqcI1C.d.cts +0 -659
- package/dist/index-BsTqcI1C.d.cts.map +0 -1
- package/dist/index-C3-TV4Up.d.cts +0 -43
- package/dist/index-C3-TV4Up.d.cts.map +0 -1
- package/dist/index-C6Y8KybK.d.ts +0 -677
- package/dist/index-C6Y8KybK.d.ts.map +0 -1
- package/dist/index-CD0Wpla3.d.cts +0 -1413
- package/dist/index-CEJxjf5R.d.ts +0 -22
- package/dist/index-CEJxjf5R.d.ts.map +0 -1
- package/dist/index-CHQKk_fN2.d.ts +0 -14
- package/dist/index-CHQKk_fN2.d.ts.map +0 -1
- package/dist/index-CUByIf_d.d.ts +0 -314
- package/dist/index-CUByIf_d.d.ts.map +0 -1
- package/dist/index-CV7wqRev.d.ts +0 -38
- package/dist/index-CV7wqRev.d.ts.map +0 -1
- package/dist/index-CXvUaeCL.d.cts +0 -14
- package/dist/index-CXvUaeCL.d.cts.map +0 -1
- package/dist/index-Cf2B9woY.d.cts +0 -473
- package/dist/index-Cf2B9woY.d.cts.map +0 -1
- package/dist/index-CqXEYILn.d.cts +0 -1263
- package/dist/index-D1cB3mbB.d.ts +0 -3917
- package/dist/index-D7AUghFx.d.ts +0 -1413
- package/dist/index-DCwffq1f.d.ts +0 -1263
- package/dist/index-DFbuWomg.d.ts +0 -534
- package/dist/index-DFbuWomg.d.ts.map +0 -1
- package/dist/index-DXOBPBft.d.ts +0 -659
- package/dist/index-DXOBPBft.d.ts.map +0 -1
- package/dist/index-DY-d4cFe.d.cts +0 -1028
- package/dist/index-DY-d4cFe.d.cts.map +0 -1
- package/dist/index-DpXSZCZe.d.cts +0 -38
- package/dist/index-DpXSZCZe.d.cts.map +0 -1
- package/dist/index-DqMpHpu7.d.ts +0 -1257
- package/dist/index-DwnqyNnX.d.cts +0 -534
- package/dist/index-DwnqyNnX.d.cts.map +0 -1
- package/dist/index-OdNTqjhQ.d.ts +0 -585
- package/dist/index-OdNTqjhQ.d.ts.map +0 -1
- package/dist/index-P30z4VRT.d.cts +0 -22
- package/dist/index-P30z4VRT.d.cts.map +0 -1
- package/dist/index-PWRw2bPH.d.ts +0 -22
- package/dist/index-PWRw2bPH.d.ts.map +0 -1
- package/dist/index-QPDvw5Z5.d.cts +0 -585
- package/dist/index-QPDvw5Z5.d.cts.map +0 -1
- package/dist/index-amMd-sQN.d.ts +0 -473
- package/dist/index-amMd-sQN.d.ts.map +0 -1
- package/dist/index-clztdahp.d.ts +0 -1477
- package/dist/index-clztdahp.d.ts.map +0 -1
- package/dist/index-jK092-MJ.d.cts +0 -314
- package/dist/index-jK092-MJ.d.cts.map +0 -1
- package/dist/index-veBM95Gw.d.cts +0 -3917
- package/dist/index-yYjVSHlN.d.ts +0 -539
- package/dist/index.cjs +0 -94
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -31
- package/dist/index.d.ts +0 -31
- package/dist/index.js +0 -36
- package/dist/index.js.map +0 -1
- package/dist/useClientValidation-BRfhqRom.cjs +0 -190
- package/dist/useClientValidation-BRfhqRom.cjs.map +0 -1
- package/dist/useClientValidation-C2dLJnDI.d.cts +0 -148
- package/dist/useClientValidation-C2dLJnDI.d.cts.map +0 -1
- package/dist/useClientValidation-DpLdzIAb.js +0 -178
- package/dist/useClientValidation-DpLdzIAb.js.map +0 -1
- package/dist/useClientValidation-qRq2_spX.d.ts +0 -148
- package/dist/useClientValidation-qRq2_spX.d.ts.map +0 -1
- package/dist/useInputValueDebounce-CfQDiomI.d.cts +0 -66
- package/dist/useInputValueDebounce-CfQDiomI.d.cts.map +0 -1
- package/dist/useInputValueDebounce-DZgzL7GQ.d.ts +0 -66
- package/dist/useInputValueDebounce-DZgzL7GQ.d.ts.map +0 -1
- package/dist/useUniformField-BE-e3C4Y.d.cts +0 -98
- package/dist/useUniformField-BE-e3C4Y.d.cts.map +0 -1
- package/dist/useUniformField-DUW-svZD.d.ts +0 -98
- package/dist/useUniformField-DUW-svZD.d.ts.map +0 -1
- package/dist/useUniformFieldArray-CdWv1SEk.d.ts +0 -79
- package/dist/useUniformFieldArray-CdWv1SEk.d.ts.map +0 -1
- package/dist/useUniformFieldArray-kkOHxNFF.d.cts +0 -79
- package/dist/useUniformFieldArray-kkOHxNFF.d.cts.map +0 -1
- package/dist/useWatchFormReset-BSd6jMxU.d.cts +0 -38
- package/dist/useWatchFormReset-BSd6jMxU.d.cts.map +0 -1
- package/dist/useWatchFormReset-C7YJ-I3N.d.ts +0 -38
- package/dist/useWatchFormReset-C7YJ-I3N.d.ts.map +0 -1
- package/dist/useWatchUserChange-C1xWHtFG.cjs +0 -90
- package/dist/useWatchUserChange-C1xWHtFG.cjs.map +0 -1
- package/dist/useWatchUserChange-CpyZz2i7.d.ts +0 -80
- package/dist/useWatchUserChange-CpyZz2i7.d.ts.map +0 -1
- package/dist/useWatchUserChange-DSAboNCs.d.cts +0 -80
- package/dist/useWatchUserChange-DSAboNCs.d.cts.map +0 -1
- package/dist/useWatchUserChange-DSQGsl1R.js +0 -84
- package/dist/useWatchUserChange-DSQGsl1R.js.map +0 -1
- /package/dist/{index-BLwMeReG.d.ts → index-BKZ67WMa.d.cts} +0 -0
- /package/dist/{index-C2gUMYkE.d.cts → index-BKZ67WMa.d.ts} +0 -0
- /package/dist/{index-CJgP-E0M.d.cts → index-BVVgDSdq.d.cts} +0 -0
- /package/dist/{index-Cg9utiy0.d.ts → index-BVVgDSdq.d.ts} +0 -0
- /package/dist/{index-CspKFJM1.d.cts → index-DmtQKWjk.d.cts} +0 -0
- /package/dist/{index-h64gcVNJ.d.ts → index-DmtQKWjk.d.ts} +0 -0
- /package/dist/{useInput-CVm3tP78.js → useInput-C0aJaAGe.js} +0 -0
- /package/dist/{useInput-BdH8oftG.d.ts → useInput-ClpHDPdr.d.cts} +0 -0
- /package/dist/{useInput-DZOmMKcp.d.cts → useInput-ClpHDPdr.d.ts} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"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QAAA;;EAEA,UAAA,GAAa,SAAA;;EAEb,KAAA,GAAQ,SAAA;;EAER,IAAA;;EAEA,OAAA;;EAEA,WAAA;;EAEA,IAAA;;EAEA,YAAA,GAAe,SAAA;;EAEf,MAAA;;EAEA,SAAA,GAAY,mBAAA;;EAEZ,IAAA;AAAA;;;;cAMI,KAAA;EAAS,SAAA,EAAA,UAAA;EAAA,SAAA;EAAA,aAAA;EAAA,UAAA;EAAA,IAAA;EAAA,OAAA;EAAA,WAAA;EAAA,IAAA;EAAA,YAAA;EAAA,IAAA;EAAA,GAAA;AAAA,GAYZ,UAAA,iCAAU,GAAA,CAAA,OAAA"}
|
package/dist/Input/index.js
CHANGED
|
@@ -1,2 +1,96 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { useUniformField } from "../hooks/useUniformField/index.js";
|
|
2
|
+
import { useInputValueDebounce } from "../hooks/useInputValueDebounce/index.js";
|
|
3
|
+
import { tv, variantsToClassNames } from "@fuf-stack/pixel-utils";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { Input } from "@heroui/input";
|
|
6
|
+
import { NumberInput } from "@heroui/number-input";
|
|
7
|
+
//#region src/Input/Input.tsx
|
|
8
|
+
const inputVariants = tv({ slots: {
|
|
9
|
+
/** wrapper around the whole input */
|
|
10
|
+
base: "",
|
|
11
|
+
/** clear button */
|
|
12
|
+
clearButton: "",
|
|
13
|
+
/** actual input element */
|
|
14
|
+
input: "",
|
|
15
|
+
/** inner wrapper (HeroUI inputWrapper slot) */
|
|
16
|
+
inputWrapper: "bg-content1 group-data-[focus=true]:border-focus"
|
|
17
|
+
} });
|
|
18
|
+
/**
|
|
19
|
+
* Input component based on [HeroUI Input](https://www.heroui.com//docs/components/input)
|
|
20
|
+
*/
|
|
21
|
+
const Input$1 = ({ className: _className = void 0, clearable = false, debounceDelay = 300, endContent = void 0, name, onClear = void 0, placeholder = " ", size = void 0, startContent = void 0, type = void 0, ...uniformFieldProps }) => {
|
|
22
|
+
const { ariaLabel, disabled, field: { onChange: fieldOnChange, onBlur: fieldOnBlur, value: fieldValue, ref }, errorMessage, invalid, label, required, testId, resetField } = useUniformField({
|
|
23
|
+
name,
|
|
24
|
+
type,
|
|
25
|
+
...uniformFieldProps
|
|
26
|
+
});
|
|
27
|
+
const { onChange, onBlur, value } = useInputValueDebounce({
|
|
28
|
+
debounceDelay,
|
|
29
|
+
name,
|
|
30
|
+
onBlur: fieldOnBlur,
|
|
31
|
+
onChange: fieldOnChange,
|
|
32
|
+
value: fieldValue
|
|
33
|
+
});
|
|
34
|
+
const clearableProps = clearable ? {
|
|
35
|
+
isClearable: true,
|
|
36
|
+
onClear: () => {
|
|
37
|
+
resetField(name, { defaultValue: null });
|
|
38
|
+
if (onClear) onClear();
|
|
39
|
+
}
|
|
40
|
+
} : {};
|
|
41
|
+
const classNames = variantsToClassNames(inputVariants(), _className, "base");
|
|
42
|
+
const commonProps = {
|
|
43
|
+
ref,
|
|
44
|
+
"aria-label": !placeholder || placeholder.trim() === "" ? ariaLabel : void 0,
|
|
45
|
+
autoComplete: "off",
|
|
46
|
+
classNames: {
|
|
47
|
+
base: classNames.base,
|
|
48
|
+
clearButton: classNames.clearButton,
|
|
49
|
+
helperWrapper: "p-0",
|
|
50
|
+
input: classNames.input,
|
|
51
|
+
inputWrapper: classNames.inputWrapper
|
|
52
|
+
},
|
|
53
|
+
"data-testid": testId,
|
|
54
|
+
endContent,
|
|
55
|
+
errorMessage,
|
|
56
|
+
id: testId,
|
|
57
|
+
isDisabled: disabled,
|
|
58
|
+
isInvalid: invalid,
|
|
59
|
+
isRequired: required,
|
|
60
|
+
label,
|
|
61
|
+
labelPlacement: "outside",
|
|
62
|
+
name,
|
|
63
|
+
onBlur,
|
|
64
|
+
placeholder,
|
|
65
|
+
radius: "sm",
|
|
66
|
+
size,
|
|
67
|
+
startContent,
|
|
68
|
+
variant: "bordered",
|
|
69
|
+
...clearableProps
|
|
70
|
+
};
|
|
71
|
+
if (type === "number") {
|
|
72
|
+
const numberValue = value !== "" && value != null && !Number.isNaN(Number(value)) ? Number(value) : null;
|
|
73
|
+
return /* @__PURE__ */ jsx(NumberInput, {
|
|
74
|
+
...commonProps,
|
|
75
|
+
formatOptions: { useGrouping: false },
|
|
76
|
+
onChange: (e) => {
|
|
77
|
+
if (typeof e === "number") onChange({ target: { value: String(e) } });
|
|
78
|
+
else onChange(e);
|
|
79
|
+
},
|
|
80
|
+
value: numberValue
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
return /* @__PURE__ */ jsx(Input, {
|
|
84
|
+
...commonProps,
|
|
85
|
+
onChange,
|
|
86
|
+
type,
|
|
87
|
+
value
|
|
88
|
+
});
|
|
89
|
+
};
|
|
90
|
+
//#endregion
|
|
91
|
+
//#region src/Input/index.ts
|
|
92
|
+
var Input_default = Input$1;
|
|
93
|
+
//#endregion
|
|
94
|
+
export { Input_default as default };
|
|
95
|
+
|
|
96
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["Input","HeroNumberInput","HeroInput","Input"],"sources":["../../src/Input/Input.tsx","../../src/Input/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { InputProps as HeroInputProps } from '@heroui/input';\nimport type { ReactNode } from 'react';\nimport type { InputValueTransform } from '../hooks/useInputValueTransform';\n\nimport { Input as HeroInput } from '@heroui/input';\nimport { NumberInput as HeroNumberInput } from '@heroui/number-input';\n\nimport { tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useInputValueDebounce } from '../hooks/useInputValueDebounce';\nimport { useUniformField } from '../hooks/useUniformField';\n\n// input variants\nexport const inputVariants = tv({\n slots: {\n /** wrapper around the whole input */\n base: '',\n /** clear button */\n clearButton: '',\n /** actual input element */\n input: '',\n /** inner wrapper (HeroUI inputWrapper slot) */\n inputWrapper: 'bg-content1 group-data-[focus=true]:border-focus',\n },\n});\n\ntype VariantProps = TVProps<typeof inputVariants>;\ntype ClassName = TVClassName<typeof inputVariants>;\n\nexport interface InputProps 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 /** shows clear button when input has value */\n clearable?: boolean;\n /** debounce delay in milliseconds for form state updates (default: 300ms) */\n debounceDelay?: number;\n /** input field is disabled */\n disabled?: boolean;\n /** added content to the end of the input Field. */\n endContent?: ReactNode;\n /** form field label */\n label?: ReactNode;\n /** form field name */\n name: string;\n /** callback that is fired when the value is cleared */\n onClear?: () => void;\n /** form field placeholder */\n placeholder?: string;\n /** size of the input */\n size?: 'sm' | 'md' | 'lg';\n /** content added to the start of the input field */\n startContent?: ReactNode;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** allows disentangled display and form values for a field */\n transform?: InputValueTransform<string>;\n /** input type */\n type?: 'number' | 'password';\n}\n\n/**\n * Input component based on [HeroUI Input](https://www.heroui.com//docs/components/input)\n */\nconst Input = ({\n className: _className = undefined,\n clearable = false,\n debounceDelay = 300,\n endContent = undefined,\n name,\n onClear = undefined,\n placeholder = ' ',\n size = undefined,\n startContent = undefined,\n type = undefined,\n ...uniformFieldProps\n}: InputProps) => {\n const {\n ariaLabel,\n disabled,\n field: {\n onChange: fieldOnChange,\n onBlur: fieldOnBlur,\n value: fieldValue,\n ref,\n },\n errorMessage,\n invalid,\n label,\n required,\n testId,\n resetField,\n } = useUniformField({ name, type, ...uniformFieldProps });\n\n // Use hook that provides debounced onChange and enhanced blur handling\n const { onChange, onBlur, value } = useInputValueDebounce({\n debounceDelay,\n name,\n onBlur: fieldOnBlur,\n onChange: fieldOnChange,\n value: fieldValue,\n });\n\n // If input is clearable add props for clearing input value\n const clearableProps: Pick<HeroInputProps, 'isClearable' | 'onClear'> =\n clearable\n ? {\n isClearable: true,\n onClear: () => {\n // if field had initial value we do not reset it\n // to that value, but clear it instead\n resetField(name, { defaultValue: null });\n // if onClear cb provided we call it\n if (onClear) {\n onClear();\n }\n },\n }\n : {};\n\n // classNames from slots\n const variants = inputVariants();\n const classNames = variantsToClassNames(variants, _className, 'base');\n\n // Common props for both Input and NumberInput\n const commonProps = {\n ref,\n // Only add aria-label if there's no meaningful placeholder (HeroUI uses placeholder as aria-label)\n 'aria-label':\n !placeholder || placeholder.trim() === '' ? ariaLabel : undefined,\n // disable autocomplete\n autoComplete: 'off',\n classNames: {\n base: classNames.base,\n clearButton: classNames.clearButton,\n // set padding to 0 for error message exit animation\n helperWrapper: 'p-0',\n input: classNames.input,\n inputWrapper: classNames.inputWrapper,\n },\n 'data-testid': testId,\n endContent,\n errorMessage,\n id: testId,\n isDisabled: disabled,\n isInvalid: invalid,\n isRequired: required,\n label,\n labelPlacement: 'outside' as const,\n name,\n onBlur,\n placeholder,\n radius: 'sm' as const,\n size,\n startContent,\n variant: 'bordered' as const,\n ...clearableProps,\n };\n\n // Render NumberInput for number type\n if (type === 'number') {\n // Parse the string value to number - use null for empty/cleared state to keep component controlled\n const numberValue =\n value !== '' && value != null && !Number.isNaN(Number(value))\n ? Number(value)\n : null;\n\n return (\n <HeroNumberInput\n {...commonProps}\n // Disable thousands separator to avoid parsing issues\n formatOptions={{\n useGrouping: false,\n }}\n // NumberInput onChange receives either an event or a number\n onChange={(e: React.ChangeEvent<HTMLInputElement> | number) => {\n if (typeof e === 'number') {\n // Convert number to synthetic event and pass through debounced onChange\n onChange({\n target: { value: String(e) },\n });\n } else {\n // Pass event through debounced onChange\n onChange(e);\n }\n }}\n // @ts-expect-error - HeroUI NumberInput type is not compatible with null,\n // but it needs to be for empty/cleared state to be controlled\n value={numberValue}\n />\n );\n }\n\n // Render regular Input for text/password\n return (\n <HeroInput {...commonProps} onChange={onChange} type={type} value={value} />\n );\n};\n\nexport default Input;\n","import Input from './Input';\n\nexport type { InputProps } from './Input';\n\nexport default Input;\n"],"mappings":";;;;;;;AAcA,MAAa,gBAAgB,GAAG,EAC9B,OAAO;;CAEL,MAA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A,WAAW,MAAoD;IAC7D,IAAI,OAAO,MAAM,UAEf,SAAS,EACP,QAAQ,EAAE,OAAO,OAAO,CAAC,EAAE,EAC7B,CAAC;SAGD,SAAS,CAAC;GAEd;GAGA,OAAO;EACR,CAAA;CAEL;CAGA,OACE,oBAACC,OAAD;EAAW,GAAI;EAAuB;EAAgB;EAAa;CAAQ,CAAA;AAE/E;;;ACnMA,IAAA,gBAAeC"}
|
|
@@ -2,7 +2,139 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
const require_helpers_index = require("../helpers/index.cjs");
|
|
6
|
+
const require_hooks_useUniformField_index = require("../hooks/useUniformField/index.cjs");
|
|
7
|
+
let _fuf_stack_pixel_utils = require("@fuf-stack/pixel-utils");
|
|
8
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
|
+
let _heroui_radio = require("@heroui/radio");
|
|
10
|
+
let _react_aria_visually_hidden = require("@react-aria/visually-hidden");
|
|
11
|
+
//#region src/RadioBoxes/RadioBox.tsx
|
|
12
|
+
const radioBoxVariants = (0, _fuf_stack_pixel_utils.tv)({
|
|
13
|
+
slots: {
|
|
14
|
+
base: "group inline-flex flex-auto cursor-pointer items-center justify-between gap-4 rounded-lg border-2 border-default p-4 hover:bg-content2 data-[selected=true]:border-focus",
|
|
15
|
+
control: "",
|
|
16
|
+
description: "text-foreground opacity-70 text-small",
|
|
17
|
+
icon: "",
|
|
18
|
+
label: "",
|
|
19
|
+
labelWrapper: "grow"
|
|
20
|
+
},
|
|
21
|
+
variants: {
|
|
22
|
+
isDisabled: { true: { base: "pointer-events-none opacity-disabled" } },
|
|
23
|
+
isInvalid: { true: { base: "!border-danger" } }
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
const RadioBox = ({ classNames: _classNames = void 0, icon = void 0, isInvalid = false, ...props }) => {
|
|
27
|
+
const { children, Component, description, getBaseProps, getControlProps, getInputProps, getLabelProps, getLabelWrapperProps, getWrapperProps, isDisabled } = (0, _heroui_radio.useRadio)(props);
|
|
28
|
+
const classNames = (0, _fuf_stack_pixel_utils.variantsToClassNames)(radioBoxVariants({
|
|
29
|
+
isDisabled,
|
|
30
|
+
isInvalid
|
|
31
|
+
}), _classNames, "base");
|
|
32
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Component, {
|
|
33
|
+
...getBaseProps(),
|
|
34
|
+
className: classNames.base,
|
|
35
|
+
children: [
|
|
36
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_react_aria_visually_hidden.VisuallyHidden, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", { ...getInputProps() }) }),
|
|
37
|
+
!icon ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
38
|
+
...getWrapperProps(),
|
|
39
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
40
|
+
...getControlProps(),
|
|
41
|
+
className: (0, _fuf_stack_pixel_utils.cn)(getControlProps().className, classNames.control)
|
|
42
|
+
})
|
|
43
|
+
}) : null,
|
|
44
|
+
icon ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
45
|
+
className: classNames.icon,
|
|
46
|
+
children: icon
|
|
47
|
+
}) : null,
|
|
48
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
49
|
+
...getLabelWrapperProps(),
|
|
50
|
+
className: (0, _fuf_stack_pixel_utils.cn)(getLabelWrapperProps().className, classNames.labelWrapper),
|
|
51
|
+
children: [children ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
52
|
+
...getLabelProps(),
|
|
53
|
+
className: (0, _fuf_stack_pixel_utils.cn)(getLabelProps().className, classNames.label),
|
|
54
|
+
children
|
|
55
|
+
}) : null, description ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
56
|
+
className: classNames.description,
|
|
57
|
+
children: description
|
|
58
|
+
}) : null]
|
|
59
|
+
}),
|
|
60
|
+
icon ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
61
|
+
...getWrapperProps(),
|
|
62
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
63
|
+
...getControlProps(),
|
|
64
|
+
className: (0, _fuf_stack_pixel_utils.cn)(getControlProps().className, classNames.control)
|
|
65
|
+
})
|
|
66
|
+
}) : null
|
|
67
|
+
]
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
//#endregion
|
|
71
|
+
//#region src/RadioBoxes/RadioBoxes.tsx
|
|
72
|
+
const radioBoxesVariants = (0, _fuf_stack_pixel_utils.tv)({ slots: {
|
|
73
|
+
base: "group gap-0",
|
|
74
|
+
boxBase: "",
|
|
75
|
+
boxControl: "",
|
|
76
|
+
boxDescription: "",
|
|
77
|
+
boxLabel: "",
|
|
78
|
+
boxLabelWrapper: "",
|
|
79
|
+
label: "mb-2 inline-flex text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:text-danger",
|
|
80
|
+
wrapper: ""
|
|
81
|
+
} });
|
|
82
|
+
/**
|
|
83
|
+
* RadioBoxes component based on [HeroUI RadioGroup](https://www.heroui.com//docs/components/radio-group)
|
|
84
|
+
*/
|
|
85
|
+
const RadioBoxes = ({ className = void 0, inline = false, name, options, ...uniformFieldProps }) => {
|
|
86
|
+
const { ariaLabel, errorMessage, invalid, disabled, label, field: { onBlur, onChange, ref, value }, required, testId } = require_hooks_useUniformField_index.useUniformField({
|
|
87
|
+
name,
|
|
88
|
+
...uniformFieldProps
|
|
89
|
+
});
|
|
90
|
+
const { convertToOriginalType } = require_helpers_index.createOptionValueConverter(options);
|
|
91
|
+
const classNames = (0, _fuf_stack_pixel_utils.variantsToClassNames)(radioBoxesVariants(), className, "base");
|
|
92
|
+
const boxClassNames = {
|
|
93
|
+
base: classNames.boxBase,
|
|
94
|
+
control: classNames.boxControl,
|
|
95
|
+
description: classNames.boxDescription,
|
|
96
|
+
label: classNames.boxLabel,
|
|
97
|
+
labelWrapper: classNames.boxLabelWrapper
|
|
98
|
+
};
|
|
99
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_heroui_radio.RadioGroup, {
|
|
100
|
+
ref,
|
|
101
|
+
"aria-label": ariaLabel,
|
|
102
|
+
classNames,
|
|
103
|
+
"data-invalid": invalid,
|
|
104
|
+
"data-required": required,
|
|
105
|
+
"data-testid": testId,
|
|
106
|
+
errorMessage,
|
|
107
|
+
isDisabled: disabled,
|
|
108
|
+
isInvalid: invalid,
|
|
109
|
+
isRequired: required,
|
|
110
|
+
label: label ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("legend", { children: label }) : null,
|
|
111
|
+
name,
|
|
112
|
+
onBlur,
|
|
113
|
+
onValueChange: (newValue) => {
|
|
114
|
+
onChange(convertToOriginalType(newValue));
|
|
115
|
+
},
|
|
116
|
+
orientation: inline ? "horizontal" : "vertical",
|
|
117
|
+
value: value != null ? String(value) : "",
|
|
118
|
+
children: options.map((option) => {
|
|
119
|
+
if ("value" in option) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(RadioBox, {
|
|
120
|
+
classNames: boxClassNames,
|
|
121
|
+
"data-testid": (0, _fuf_stack_pixel_utils.slugify)(`${testId}_option_${option.testId ?? option.value}`, { replaceDots: true }),
|
|
122
|
+
description: option.description,
|
|
123
|
+
icon: option.icon,
|
|
124
|
+
isDisabled: !!disabled || option.disabled,
|
|
125
|
+
isInvalid: invalid,
|
|
126
|
+
value: String(option.value),
|
|
127
|
+
children: option.label ?? option.value
|
|
128
|
+
}, String(option.value));
|
|
129
|
+
return null;
|
|
130
|
+
})
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
//#endregion
|
|
134
|
+
//#region src/RadioBoxes/index.ts
|
|
135
|
+
var RadioBoxes_default = RadioBoxes;
|
|
136
|
+
//#endregion
|
|
137
|
+
exports.default = RadioBoxes_default;
|
|
138
|
+
exports.radioBoxVariants = radioBoxVariants;
|
|
139
|
+
|
|
140
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["VisuallyHidden","useUniformField","createOptionValueConverter","HeroRadioGroup"],"sources":["../../src/RadioBoxes/RadioBox.tsx","../../src/RadioBoxes/RadioBoxes.tsx","../../src/RadioBoxes/index.ts"],"sourcesContent":["import type { TVClassName } from '@fuf-stack/pixel-utils';\nimport type { RadioProps as HeroRadioProps } from '@heroui/radio';\nimport type { ReactNode } from 'react';\n\nimport { useRadio } from '@heroui/radio';\nimport { VisuallyHidden } from '@react-aria/visually-hidden';\n\nimport { cn, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nexport const radioBoxVariants = tv({\n slots: {\n base: 'group inline-flex flex-auto cursor-pointer items-center justify-between gap-4 rounded-lg border-2 border-default p-4 hover:bg-content2 data-[selected=true]:border-focus',\n control: '',\n description: 'text-foreground opacity-70 text-small',\n icon: '',\n label: '',\n labelWrapper: 'grow',\n },\n variants: {\n isDisabled: {\n true: {\n base: 'pointer-events-none opacity-disabled',\n },\n },\n isInvalid: {\n true: {\n base: '!border-danger',\n },\n },\n },\n});\n\ntype ClassName = TVClassName<typeof radioBoxVariants>;\n\nexport interface RadioBoxProps extends Omit<HeroRadioProps, 'className'> {\n /** CSS class name */\n className?: ClassName;\n /** icon for the option */\n icon?: ReactNode;\n /** whether the radio is invalid */\n isInvalid?: boolean;\n}\n\nexport const RadioBox = ({\n classNames: _classNames = undefined,\n icon = undefined,\n isInvalid = false,\n ...props\n}: RadioBoxProps) => {\n const {\n children,\n Component,\n description,\n getBaseProps,\n getControlProps,\n getInputProps,\n getLabelProps,\n getLabelWrapperProps,\n getWrapperProps,\n isDisabled,\n } = useRadio(props as HeroRadioProps);\n\n // classNames from slots\n const variants = radioBoxVariants({\n isDisabled,\n isInvalid,\n });\n const classNames = variantsToClassNames(\n variants,\n // @ts-expect-error not sure here, but it works\n _classNames,\n 'base',\n );\n\n return (\n <Component {...getBaseProps()} className={classNames.base}>\n <VisuallyHidden>\n <input {...getInputProps()} />\n </VisuallyHidden>\n {!icon ? (\n <span {...getWrapperProps()}>\n <span\n {...getControlProps()}\n className={cn(getControlProps().className, classNames.control)}\n />\n </span>\n ) : null}\n {icon ? <div className={classNames.icon}>{icon}</div> : null}\n <div\n {...getLabelWrapperProps()}\n className={cn(\n getLabelWrapperProps().className,\n classNames.labelWrapper,\n )}\n >\n {children ? (\n <span\n {...getLabelProps()}\n className={cn(getLabelProps().className, classNames.label)}\n >\n {children}\n </span>\n ) : null}\n {description ? (\n <div className={classNames.description}>{description}</div>\n ) : null}\n </div>\n {icon ? (\n <span {...getWrapperProps()}>\n <span\n {...getControlProps()}\n className={cn(getControlProps().className, classNames.control)}\n />\n </span>\n ) : null}\n </Component>\n );\n};\n\nexport default RadioBox;\n","import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { ReactNode } from 'react';\n//\nimport type { RadioBoxProps } from './RadioBox';\n\nimport { RadioGroup as HeroRadioGroup } from '@heroui/radio';\n\nimport { slugify, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { createOptionValueConverter } from '../helpers';\nimport { useUniformField } from '../hooks/useUniformField';\nimport { RadioBox } from './RadioBox';\n\nexport const radioBoxesVariants = tv({\n slots: {\n base: 'group gap-0', // Needs group for group-data condition\n boxBase: '',\n boxControl: '',\n boxDescription: '',\n boxLabel: '',\n boxLabelWrapper: '',\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 'mb-2 inline-flex text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:text-danger',\n wrapper: '',\n },\n});\n\ntype VariantProps = TVProps<typeof radioBoxesVariants>;\ntype ClassName = TVClassName<typeof radioBoxesVariants>;\n\nexport interface RadioBoxOption {\n /** Description of the value. Works with variant radioBox. */\n description?: ReactNode;\n /** disables the option */\n disabled?: boolean;\n /** option label */\n label?: ReactNode;\n /** option icon */\n icon?: ReactNode;\n /** HTML data-testid attribute of the option */\n testId?: string;\n /** option value */\n value: string | number;\n}\n\nexport interface RadioBoxesProps 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 /** Determines if the Buttons are disabled or not. */\n disabled?: boolean;\n /** determines orientation of the Buttons. */\n inline?: boolean;\n /** Label displayed next to the RadioButton. */\n label?: ReactNode;\n /** Name the RadioButtons are registered at in HTML forms (react-hook-form). */\n name: string;\n /** Radio button configuration. */\n options: RadioBoxOption[];\n /** Id to grab element in internal tests. */\n testId?: string;\n}\n\n/**\n * RadioBoxes component based on [HeroUI RadioGroup](https://www.heroui.com//docs/components/radio-group)\n */\nconst RadioBoxes = ({\n className = undefined,\n inline = false,\n name,\n options,\n ...uniformFieldProps\n}: RadioBoxesProps) => {\n const {\n ariaLabel,\n errorMessage,\n invalid,\n disabled,\n label,\n field: { onBlur, onChange, ref, value },\n required,\n testId,\n } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n // Create converter to preserve number types for option values\n const { convertToOriginalType } = createOptionValueConverter(options);\n\n // classNames from slots\n const variants = radioBoxesVariants();\n const classNames = variantsToClassNames(variants, className, 'base');\n const boxClassNames: RadioBoxProps['classNames'] = {\n base: classNames.boxBase,\n control: classNames.boxControl,\n description: classNames.boxDescription,\n label: classNames.boxLabel,\n labelWrapper: classNames.boxLabelWrapper,\n };\n\n return (\n <HeroRadioGroup\n ref={ref}\n aria-label={ariaLabel}\n classNames={classNames}\n // see HeroUI styles for group-data condition (data-invalid),\n // e.g.: https://github.com/heroui-inc/heroui/blob/main/packages/components/select/src/use-select.ts\n data-invalid={invalid}\n data-required={required}\n data-testid={testId}\n errorMessage={errorMessage}\n isDisabled={disabled}\n isInvalid={invalid}\n isRequired={required}\n label={label ? <legend>{label}</legend> : null}\n name={name}\n onBlur={onBlur}\n onValueChange={(newValue) => {\n onChange(convertToOriginalType(newValue));\n }}\n orientation={inline ? 'horizontal' : 'vertical'}\n value={value != null ? String(value) : ''}\n >\n {options.map((option) => {\n if ('value' in option) {\n const optionTestId = slugify(\n `${testId}_option_${option.testId ?? option.value}`,\n { replaceDots: true },\n );\n return (\n <RadioBox\n key={String(option.value)}\n classNames={boxClassNames}\n data-testid={optionTestId}\n description={option.description}\n icon={option.icon}\n isDisabled={!!disabled || option.disabled}\n isInvalid={invalid}\n value={String(option.value)}\n >\n {option.label ?? option.value}\n </RadioBox>\n );\n }\n return null;\n })}\n </HeroRadioGroup>\n );\n};\n\nexport default RadioBoxes;\n","import RadioBoxes from './RadioBoxes';\n\nexport type { RadioBoxesProps, RadioBoxOption } from './RadioBoxes';\n\nexport { radioBoxVariants } from './RadioBox';\n\nexport default RadioBoxes;\n"],"mappings":";;;;;;;;;;;AASA,MAAa,oBAAA,GAAA,uBAAA,IAAsB;CACjC,OAAO;EACL,MAAM;EACN,SAAS;EACT,aAAa;EACb,MAAM;EACN,OAAO;EACP,cAAc;CAChB;CACA,UAAU;EACR,YAAY,EACV,MAAM,EACJ,MAAM,uCACR,EACF;EACA,WAAW,EACT,MAAM,EACJ,MAAM,iBACR,EACF;CACF;AACF,CAAC;AAaD,MAAa,YAAY,EACvB,YAAY,cAAc,KAAA,GAC1B,OAAO,KAAA,GACP,YAAY,OACZ,GAAG,YACgB;CACnB,MAAM,EACJ,UACA,WACA,aACA,cACA,iBACA,eACA,eACA,sBACA,iBACA,gBAAA,GAAA,cAAA,UACW,KAAuB;CAOpC,MAAM,cAAA,GAAA,uBAAA,sBAJW,iBAAiB;EAChC;EACA;CACF,CAES,GAEP,aACA,MACF;CAEA,OACE,iBAAA,GAAA,kBAAA,MAAC,WAAD;EAAW,GAAI,aAAa;EAAG,WAAW,WAAW;YAArD;GACE,iBAAA,GAAA,kBAAA,KAACA,4BAAAA,g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