@fuf-stack/uniform 1.17.0 → 1.18.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 +1 -1
- package/dist/Checkboxes/index.d.cts +1 -1
- package/dist/Checkboxes/index.d.ts +1 -1
- package/dist/Checkboxes/index.js +1 -1
- package/dist/{Checkboxes-BfUtbKe-.js → Checkboxes-BGrK_mwQ.js} +3 -3
- package/dist/{Checkboxes-BfUtbKe-.js.map → Checkboxes-BGrK_mwQ.js.map} +1 -1
- package/dist/{Checkboxes-3Rg0gyfO.cjs → Checkboxes-Dk7yyRVR.cjs} +4 -4
- package/dist/{Checkboxes-3Rg0gyfO.cjs.map → Checkboxes-Dk7yyRVR.cjs.map} +1 -1
- package/dist/FieldArray/index.cjs +1 -1
- package/dist/FieldArray/index.d.cts +1 -1
- package/dist/FieldArray/index.d.ts +1 -1
- package/dist/FieldArray/index.js +1 -1
- package/dist/{FieldArray-BgvSTDWi.cjs → FieldArray-BnZW6fwm.cjs} +7 -7
- package/dist/{FieldArray-BgvSTDWi.cjs.map → FieldArray-BnZW6fwm.cjs.map} +1 -1
- package/dist/{FieldArray-C8Ipn-tM.js → FieldArray-C53ox8yB.js} +6 -6
- package/dist/{FieldArray-C8Ipn-tM.js.map → FieldArray-C53ox8yB.js.map} +1 -1
- package/dist/FieldCard/index.cjs +1 -1
- package/dist/FieldCard/index.d.cts +1 -1
- package/dist/FieldCard/index.d.ts +1 -1
- package/dist/FieldCard/index.js +1 -1
- package/dist/{FieldCard-7XiCb6jZ.js → FieldCard-16yCF83m.js} +6 -5
- package/dist/FieldCard-16yCF83m.js.map +1 -0
- package/dist/{FieldCard-38ZBBWyE.cjs → FieldCard-BxK_IJOR.cjs} +7 -6
- package/dist/FieldCard-BxK_IJOR.cjs.map +1 -0
- package/dist/{FieldCopyTestIdButton-DxJYKqrz.cjs → FieldCopyTestIdButton-4uupFq1U.cjs} +2 -2
- package/dist/{FieldCopyTestIdButton-DxJYKqrz.cjs.map → FieldCopyTestIdButton-4uupFq1U.cjs.map} +1 -1
- package/dist/{FieldCopyTestIdButton-D9f1B-VS.js → FieldCopyTestIdButton-BoEdlzLs.js} +1 -1
- package/dist/{FieldCopyTestIdButton-D9f1B-VS.js.map → FieldCopyTestIdButton-BoEdlzLs.js.map} +1 -1
- package/dist/{FieldValidationError-A384-L3Y.cjs → FieldValidationError-Br6iopZj.cjs} +2 -2
- package/dist/{FieldValidationError-A384-L3Y.cjs.map → FieldValidationError-Br6iopZj.cjs.map} +1 -1
- package/dist/{FieldValidationError-BYwitb_B.js → FieldValidationError-XQaViV52.js} +1 -1
- package/dist/{FieldValidationError-BYwitb_B.js.map → FieldValidationError-XQaViV52.js.map} +1 -1
- package/dist/Form/index.cjs +1 -1
- package/dist/Form/index.d.cts +1 -1
- package/dist/Form/index.d.ts +2 -2
- package/dist/Form/index.js +1 -1
- package/dist/{Form-Ca3RxssB.cjs → Form--SsSvsxl.cjs} +3 -3
- package/dist/{Form-Ca3RxssB.cjs.map → Form--SsSvsxl.cjs.map} +1 -1
- package/dist/{Form-B7bv9fDO.js → Form-ccsEssie.js} +3 -3
- package/dist/{Form-B7bv9fDO.js.map → Form-ccsEssie.js.map} +1 -1
- package/dist/{FormContext-CeFKQmVH.cjs → FormContext-BSLO2-sO.cjs} +3 -3
- package/dist/FormContext-BSLO2-sO.cjs.map +1 -0
- package/dist/{FormContext-C2_WMi_v.d.ts → FormContext-CCe8drkp.d.ts} +1 -1
- package/dist/FormContext-CCe8drkp.d.ts.map +1 -0
- package/dist/{FormContext-Dl7KL_wl.d.cts → FormContext-RSA21aDt.d.cts} +1 -1
- package/dist/FormContext-RSA21aDt.d.cts.map +1 -0
- package/dist/{FormContext-DHYlCZ2u.js → FormContext-kE3YKhp_.js} +3 -3
- package/dist/FormContext-kE3YKhp_.js.map +1 -0
- package/dist/Grid/index.cjs +1 -1
- package/dist/Grid/index.d.cts +1 -1
- package/dist/Grid/index.d.ts +1 -1
- package/dist/Grid/index.js +1 -1
- package/dist/{Grid-CRURvciu.cjs → Grid-CE1fZKmV.cjs} +2 -2
- package/dist/{Grid-CRURvciu.cjs.map → Grid-CE1fZKmV.cjs.map} +1 -1
- package/dist/{Grid-LRjQlZms.js → Grid-CeaybCIF.js} +1 -1
- package/dist/{Grid-LRjQlZms.js.map → Grid-CeaybCIF.js.map} +1 -1
- package/dist/Input/index.cjs +1 -1
- package/dist/Input/index.d.cts +1 -1
- package/dist/Input/index.d.ts +1 -1
- package/dist/Input/index.js +1 -1
- package/dist/{Input-DlyrGFYf.cjs → Input-B3p_4ntD.cjs} +4 -4
- package/dist/{Input-DlyrGFYf.cjs.map → Input-B3p_4ntD.cjs.map} +1 -1
- package/dist/{Input-ChXItabV.js → Input-BCs_eyJ9.js} +3 -3
- package/dist/{Input-ChXItabV.js.map → Input-BCs_eyJ9.js.map} +1 -1
- package/dist/RadioBoxes/index.cjs +1 -1
- package/dist/RadioBoxes/index.d.cts +1 -1
- package/dist/RadioBoxes/index.d.ts +1 -1
- package/dist/RadioBoxes/index.js +1 -1
- package/dist/{RadioBoxes-D6ULFGfd.js → RadioBoxes-C3Cwrn2I.js} +3 -3
- package/dist/{RadioBoxes-D6ULFGfd.js.map → RadioBoxes-C3Cwrn2I.js.map} +1 -1
- package/dist/{RadioBoxes-ClDOhQkO.cjs → RadioBoxes-xRvNe5U8.cjs} +4 -4
- package/dist/{RadioBoxes-ClDOhQkO.cjs.map → RadioBoxes-xRvNe5U8.cjs.map} +1 -1
- package/dist/RadioTabs/index.cjs +1 -1
- package/dist/RadioTabs/index.d.cts +1 -1
- package/dist/RadioTabs/index.d.ts +1 -1
- package/dist/RadioTabs/index.js +1 -1
- package/dist/{RadioTabs-CgB0MmbK.cjs → RadioTabs-BaHvYcd-.cjs} +4 -4
- package/dist/{RadioTabs-CgB0MmbK.cjs.map → RadioTabs-BaHvYcd-.cjs.map} +1 -1
- package/dist/{RadioTabs-eSB6OXD7.js → RadioTabs-DfOGIsEf.js} +3 -3
- package/dist/{RadioTabs-eSB6OXD7.js.map → RadioTabs-DfOGIsEf.js.map} +1 -1
- package/dist/Radios/index.cjs +1 -1
- package/dist/Radios/index.d.cts +1 -1
- package/dist/Radios/index.d.ts +1 -1
- package/dist/Radios/index.js +1 -1
- package/dist/{Radios-DWsCLUVl.cjs → Radios-BfA3uL35.cjs} +4 -4
- package/dist/{Radios-DWsCLUVl.cjs.map → Radios-BfA3uL35.cjs.map} +1 -1
- package/dist/{Radios-BXuyREKO.js → Radios-xM-09vB5.js} +3 -3
- package/dist/{Radios-BXuyREKO.js.map → Radios-xM-09vB5.js.map} +1 -1
- package/dist/Select/index.cjs +1 -1
- package/dist/Select/index.d.cts +1 -1
- package/dist/Select/index.d.ts +1 -1
- package/dist/Select/index.js +1 -1
- package/dist/{Select-CTbXrAjL.cjs → Select-DH_YaruM.cjs} +5 -5
- package/dist/{Select-CTbXrAjL.cjs.map → Select-DH_YaruM.cjs.map} +1 -1
- package/dist/{Select-Dk_K_Q0F.js → Select-DlEUzYl6.js} +4 -4
- package/dist/{Select-Dk_K_Q0F.js.map → Select-DlEUzYl6.js.map} +1 -1
- package/dist/Slider/index.cjs +1 -1
- package/dist/Slider/index.d.cts +1 -1
- package/dist/Slider/index.d.ts +1 -1
- package/dist/Slider/index.js +1 -1
- package/dist/{Slider-ChGkOSJJ.cjs → Slider-C-dMrJZ6.cjs} +3 -3
- package/dist/{Slider-ChGkOSJJ.cjs.map → Slider-C-dMrJZ6.cjs.map} +1 -1
- package/dist/{Slider-DdF0ZBzn.js → Slider-CTFuVrp2.js} +2 -2
- package/dist/{Slider-DdF0ZBzn.js.map → Slider-CTFuVrp2.js.map} +1 -1
- package/dist/SubmitButton/index.cjs +1 -1
- package/dist/SubmitButton/index.d.cts +1 -1
- package/dist/SubmitButton/index.d.ts +1 -1
- package/dist/SubmitButton/index.js +1 -1
- package/dist/{SubmitButton-BrbHJcb4.js → SubmitButton-Bh1RN0F1.js} +2 -2
- package/dist/{SubmitButton-BrbHJcb4.js.map → SubmitButton-Bh1RN0F1.js.map} +1 -1
- package/dist/{SubmitButton-C6sgPR8K.cjs → SubmitButton-CJ6s1mZr.cjs} +3 -3
- package/dist/{SubmitButton-C6sgPR8K.cjs.map → SubmitButton-CJ6s1mZr.cjs.map} +1 -1
- package/dist/Switch/index.cjs +1 -1
- package/dist/Switch/index.d.cts +1 -1
- package/dist/Switch/index.d.ts +1 -1
- package/dist/Switch/index.js +1 -1
- package/dist/{Switch-DW9SOeIv.js → Switch-CXrz-M3V.js} +2 -2
- package/dist/{Switch-DW9SOeIv.js.map → Switch-CXrz-M3V.js.map} +1 -1
- package/dist/{Switch-Lt61rKxf.cjs → Switch-CeUMwheZ.cjs} +3 -3
- package/dist/{Switch-Lt61rKxf.cjs.map → Switch-CeUMwheZ.cjs.map} +1 -1
- package/dist/SwitchBox/index.cjs +1 -1
- package/dist/SwitchBox/index.d.cts +1 -1
- package/dist/SwitchBox/index.d.ts +1 -1
- package/dist/SwitchBox/index.js +1 -1
- package/dist/{SwitchBox-D-EI9Sl-.cjs → SwitchBox-4G_qcERZ.cjs} +3 -3
- package/dist/{SwitchBox-D-EI9Sl-.cjs.map → SwitchBox-4G_qcERZ.cjs.map} +1 -1
- package/dist/{SwitchBox-9KAu4WWd.js → SwitchBox-RfkVRDrE.js} +2 -2
- package/dist/{SwitchBox-9KAu4WWd.js.map → SwitchBox-RfkVRDrE.js.map} +1 -1
- package/dist/TextArea/index.cjs +1 -1
- package/dist/TextArea/index.d.cts +1 -1
- package/dist/TextArea/index.d.ts +1 -1
- package/dist/TextArea/index.js +1 -1
- package/dist/{TextArea-B0zYpNy-.js → TextArea-BLkVYmHZ.js} +3 -3
- package/dist/{TextArea-B0zYpNy-.js.map → TextArea-BLkVYmHZ.js.map} +1 -1
- package/dist/{TextArea-DRSFdn5v.cjs → TextArea-BYEuk4Ng.cjs} +4 -4
- package/dist/{TextArea-DRSFdn5v.cjs.map → TextArea-BYEuk4Ng.cjs.map} +1 -1
- package/dist/helpers/index.cjs +2 -1
- package/dist/helpers/index.d.cts +39 -1
- package/dist/helpers/index.d.cts.map +1 -1
- package/dist/helpers/index.d.ts +39 -1
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/index.js +2 -2
- package/dist/{helpers-D3A5d3M1.js → helpers-33jajRcN.js} +71 -2
- package/dist/{helpers-D3A5d3M1.js.map → helpers-33jajRcN.js.map} +1 -1
- package/dist/{helpers-CncbgvW_.cjs → helpers-Bd_QpqXg.cjs} +77 -2
- package/dist/{helpers-CncbgvW_.cjs.map → helpers-Bd_QpqXg.cjs.map} +1 -1
- package/dist/hooks/useClientValidation/index.cjs +1 -1
- package/dist/hooks/useClientValidation/index.d.cts +1 -1
- package/dist/hooks/useClientValidation/index.d.ts +1 -1
- package/dist/hooks/useClientValidation/index.js +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 +2 -2
- 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 +3 -3
- package/dist/hooks/useFormContext/index.js +1 -1
- package/dist/hooks/useInput/index.cjs +1 -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 -1
- package/dist/hooks/useInputValueDebounce/index.d.cts +1 -1
- package/dist/hooks/useInputValueDebounce/index.d.ts +1 -1
- 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 +1 -1
- package/dist/hooks/useUniformField/index.d.cts +1 -1
- package/dist/hooks/useUniformField/index.d.ts +5 -5
- package/dist/hooks/useUniformField/index.js +1 -1
- package/dist/hooks/useUniformFieldArray/index.cjs +1 -1
- package/dist/hooks/useUniformFieldArray/index.d.cts +1 -1
- package/dist/hooks/useUniformFieldArray/index.d.ts +6 -6
- package/dist/hooks/useUniformFieldArray/index.js +1 -1
- package/dist/hooks/useWatchUserChange/index.cjs +1 -1
- package/dist/hooks/useWatchUserChange/index.d.cts +1 -1
- package/dist/hooks/useWatchUserChange/index.d.ts +1 -1
- package/dist/hooks/useWatchUserChange/index.js +1 -1
- package/dist/{index-pE9osud2.d.ts → index-ABoI1QMc.d.ts} +1 -1
- package/dist/index-ABoI1QMc.d.ts.map +1 -0
- package/dist/{index-BV_YDI6g.d.ts → index-B0WNiTKF.d.cts} +39 -77
- package/dist/index-B0WNiTKF.d.cts.map +1 -0
- package/dist/{index-BW9EUWZE.d.cts → index-B3DXQvAA.d.cts} +3 -3
- package/dist/index-B3DXQvAA.d.cts.map +1 -0
- package/dist/{index-aHcGnXHf.d.ts → index-BI_rLLgx.d.ts} +4 -4
- package/dist/index-BI_rLLgx.d.ts.map +1 -0
- package/dist/{index-nVYabHcT.d.cts → index-BPc0O2Ds.d.ts} +36 -35
- package/dist/index-BPc0O2Ds.d.ts.map +1 -0
- package/dist/{index-DJbdReTK.d.ts → index-BUbrPNtL.d.ts} +3 -3
- package/dist/index-BUbrPNtL.d.ts.map +1 -0
- package/dist/{index-CUy2EDqc.d.cts → index-B_OYOLtc.d.ts} +40 -78
- package/dist/index-B_OYOLtc.d.ts.map +1 -0
- package/dist/{index-DebErIUS.d.ts → index-BdTKCS0O.d.ts} +48 -48
- package/dist/index-BdTKCS0O.d.ts.map +1 -0
- package/dist/{index-CB00FCyi.d.ts → index-Bi0RH8tW.d.ts} +31 -43
- package/dist/index-Bi0RH8tW.d.ts.map +1 -0
- package/dist/{index-BFLKkqA3.d.ts → index-Box1ZCLh.d.ts} +3 -3
- package/dist/index-Box1ZCLh.d.ts.map +1 -0
- package/dist/{index-CbAh0Kfo.d.cts → index-BuJ4i2G8.d.cts} +3 -3
- package/dist/index-BuJ4i2G8.d.cts.map +1 -0
- package/dist/{index-DjDR6FpI.d.ts → index-BxTjmOVI.d.ts} +36 -36
- package/dist/index-BxTjmOVI.d.ts.map +1 -0
- package/dist/{index-DTURD6sl.d.cts → index-BySLJ5JG.d.ts} +7 -7
- package/dist/index-BySLJ5JG.d.ts.map +1 -0
- package/dist/index-C7t64NIn.d.cts +278 -0
- package/dist/index-C7t64NIn.d.cts.map +1 -0
- package/dist/{index-C3CvgmJw.d.ts → index-CAMcAf2p.d.cts} +4 -4
- package/dist/index-CAMcAf2p.d.cts.map +1 -0
- package/dist/{index-796vjEop.d.ts → index-CDdjrJRs.d.ts} +34 -34
- package/dist/index-CDdjrJRs.d.ts.map +1 -0
- package/dist/index-CELx_Pr_.d.ts +85 -0
- package/dist/index-CELx_Pr_.d.ts.map +1 -0
- package/dist/{index-D3RMbKbP.d.cts → index-CGjAL8dg.d.cts} +36 -36
- package/dist/index-CGjAL8dg.d.cts.map +1 -0
- package/dist/{index-DsyY9X04.d.cts → index-CYMw1FYm.d.cts} +3 -3
- package/dist/index-CYMw1FYm.d.cts.map +1 -0
- package/dist/{index-Cj5CLBt2.d.cts → index-Cbz1wgYP.d.ts} +4 -4
- package/dist/index-Cbz1wgYP.d.ts.map +1 -0
- package/dist/index-ChOoZHFX.d.ts +278 -0
- package/dist/index-ChOoZHFX.d.ts.map +1 -0
- package/dist/{index-Bo79xzb4.d.cts → index-CjbJYNFd.d.cts} +4 -4
- package/dist/index-CjbJYNFd.d.cts.map +1 -0
- package/dist/{index-DxfiwbJb.d.cts → index-CluXcbJV.d.cts} +18 -34
- package/dist/index-CluXcbJV.d.cts.map +1 -0
- package/dist/index-CwtoC1DE.d.cts +85 -0
- package/dist/index-CwtoC1DE.d.cts.map +1 -0
- package/dist/{index-BgXr1v45.d.cts → index-DUbBP1s0.d.cts} +34 -34
- package/dist/index-DUbBP1s0.d.cts.map +1 -0
- package/dist/{index-Cj-PU3Ck.d.ts → index-DWK4jUn6.d.cts} +34 -35
- package/dist/index-DWK4jUn6.d.cts.map +1 -0
- package/dist/{index-B_1td56I.d.ts → index-DYSdHsro.d.cts} +5 -5
- package/dist/index-DYSdHsro.d.cts.map +1 -0
- package/dist/{index-DAeb_8Q4.d.cts → index-Dp-7JoRm.d.cts} +31 -43
- package/dist/index-Dp-7JoRm.d.cts.map +1 -0
- package/dist/{index-Dy0m4FQj.d.ts → index-DrKDlcRp.d.cts} +7 -7
- package/dist/index-DrKDlcRp.d.cts.map +1 -0
- package/dist/{index-BD9y--o2.d.cts → index-MThhiwEy.d.ts} +6 -6
- package/dist/index-MThhiwEy.d.ts.map +1 -0
- package/dist/{index-C4-1V8jn.d.ts → index-Nzma24Py.d.ts} +3 -3
- package/dist/index-Nzma24Py.d.ts.map +1 -0
- package/dist/{index-CrxSEKKb.d.cts → index-RJd0nXDb.d.cts} +48 -48
- package/dist/index-RJd0nXDb.d.cts.map +1 -0
- package/dist/{index-DEJghucW.d.cts → index-SrU5788P.d.cts} +3 -3
- package/dist/index-SrU5788P.d.cts.map +1 -0
- package/dist/{index-gWYaaO6O.d.ts → index-htE4x59X.d.ts} +18 -34
- package/dist/index-htE4x59X.d.ts.map +1 -0
- package/dist/index.cjs +28 -27
- package/dist/index.d.cts +28 -28
- package/dist/index.d.ts +31 -31
- package/dist/index.js +28 -28
- package/dist/partials/FieldCopyTestIdButton/index.cjs +1 -1
- package/dist/partials/FieldCopyTestIdButton/index.d.cts +1 -1
- package/dist/partials/FieldCopyTestIdButton/index.d.ts +1 -1
- package/dist/partials/FieldCopyTestIdButton/index.js +1 -1
- package/dist/partials/FieldValidationError/index.cjs +1 -1
- package/dist/partials/FieldValidationError/index.d.cts +1 -1
- package/dist/partials/FieldValidationError/index.d.ts +1 -1
- package/dist/partials/FieldValidationError/index.js +1 -1
- package/dist/{useClientValidation-C6Daq53C.js → useClientValidation-DksyV18M.js} +3 -3
- package/dist/{useClientValidation-C6Daq53C.js.map → useClientValidation-DksyV18M.js.map} +1 -1
- package/dist/{useClientValidation-DzomULfo.cjs → useClientValidation-Dnj_wuwf.cjs} +4 -4
- package/dist/{useClientValidation-DzomULfo.cjs.map → useClientValidation-Dnj_wuwf.cjs.map} +1 -1
- package/dist/{useClientValidation-Bg0q3Axc.d.ts → useClientValidation-Dw-dmynu.d.cts} +1 -2
- package/dist/useClientValidation-Dw-dmynu.d.cts.map +1 -0
- package/dist/{useClientValidation-BvPDQmf6.d.cts → useClientValidation-DxFgfsEI.d.ts} +1 -2
- package/dist/useClientValidation-DxFgfsEI.d.ts.map +1 -0
- package/dist/{useController-oCYPeezC.cjs → useController-B_SSp5Z5.cjs} +3 -3
- package/dist/{useController-oCYPeezC.cjs.map → useController-B_SSp5Z5.cjs.map} +1 -1
- package/dist/{useController-C6Pg9T_3.d.cts → useController-CvPWE2Sy.d.cts} +1 -1
- package/dist/useController-CvPWE2Sy.d.cts.map +1 -0
- package/dist/{useController-BJ2SBdky.d.ts → useController-DfiNbuEz.d.ts} +1 -1
- package/dist/useController-DfiNbuEz.d.ts.map +1 -0
- package/dist/{useController-QcOl0O0v.js → useController-NjuthTyL.js} +3 -3
- package/dist/{useController-QcOl0O0v.js.map → useController-NjuthTyL.js.map} +1 -1
- package/dist/{useFormContext-B2TS6xq0.d.ts → useFormContext-C6OOtqZ5.d.ts} +18 -18
- package/dist/useFormContext-C6OOtqZ5.d.ts.map +1 -0
- package/dist/{useFormContext-356X5XAY.js → useFormContext-CLymm_7t.js} +1 -1
- package/dist/{useFormContext-356X5XAY.js.map → useFormContext-CLymm_7t.js.map} +1 -1
- package/dist/{useFormContext-n3WYgGkW.d.cts → useFormContext-Dh97YG47.d.cts} +18 -18
- package/dist/useFormContext-Dh97YG47.d.cts.map +1 -0
- package/dist/{useFormContext-UFBqUfOr.js → useFormContext-Di67HIf7.js} +3 -3
- package/dist/{useFormContext-UFBqUfOr.js.map → useFormContext-Di67HIf7.js.map} +1 -1
- package/dist/{useFormContext-DJiJlfGJ.cjs → useFormContext-vdeeDsAs.cjs} +3 -3
- package/dist/{useFormContext-DJiJlfGJ.cjs.map → useFormContext-vdeeDsAs.cjs.map} +1 -1
- package/dist/{useInputValueDebounce-KIKsvSLm.cjs → useInputValueDebounce-CRaM7HEM.cjs} +3 -3
- package/dist/{useInputValueDebounce-KIKsvSLm.cjs.map → useInputValueDebounce-CRaM7HEM.cjs.map} +1 -1
- package/dist/{useInputValueDebounce-D9wArTKz.js → useInputValueDebounce-DJO5uzLb.js} +2 -2
- package/dist/{useInputValueDebounce-D9wArTKz.js.map → useInputValueDebounce-DJO5uzLb.js.map} +1 -1
- package/dist/{useInputValueDebounce-fhmVn1aO.d.ts → useInputValueDebounce-Dhlv1NUY.d.ts} +1 -1
- package/dist/useInputValueDebounce-Dhlv1NUY.d.ts.map +1 -0
- package/dist/{useInputValueDebounce-DI1C6oaU.d.cts → useInputValueDebounce-ZLyAmuXV.d.cts} +1 -1
- package/dist/useInputValueDebounce-ZLyAmuXV.d.cts.map +1 -0
- package/dist/{useInputValueTransform-DuhPVE4L.cjs → useInputValueTransform-BBRvvhDe.cjs} +2 -2
- package/dist/{useInputValueTransform-DuhPVE4L.cjs.map → useInputValueTransform-BBRvvhDe.cjs.map} +1 -1
- package/dist/{useInputValueTransform-CMNC21vX.js → useInputValueTransform-C-fmz3ke.js} +1 -1
- package/dist/{useInputValueTransform-CMNC21vX.js.map → useInputValueTransform-C-fmz3ke.js.map} +1 -1
- package/dist/{useInputValueTransform-BV8o0PMI.d.cts → useInputValueTransform-CNCBU7a9.d.cts} +1 -1
- package/dist/useInputValueTransform-CNCBU7a9.d.cts.map +1 -0
- package/dist/{useInputValueTransform-Cc0qEsnS.d.ts → useInputValueTransform-tsMNM7g_.d.ts} +1 -1
- package/dist/useInputValueTransform-tsMNM7g_.d.ts.map +1 -0
- package/dist/{useUniformField-Dd3AnpgE.cjs → useUniformField-6c4OCAfb.cjs} +9 -29
- package/dist/useUniformField-6c4OCAfb.cjs.map +1 -0
- package/dist/{useUniformField-C6oSAFa3.js → useUniformField-C-Xyu-8v.js} +9 -29
- package/dist/useUniformField-C-Xyu-8v.js.map +1 -0
- package/dist/{useUniformField-CXSaAVTt.d.ts → useUniformField-CqqIJtqo.d.ts} +5 -5
- package/dist/useUniformField-CqqIJtqo.d.ts.map +1 -0
- package/dist/{useUniformField-ETnay_UI.d.cts → useUniformField-DIb__gKK.d.cts} +5 -5
- package/dist/useUniformField-DIb__gKK.d.cts.map +1 -0
- package/dist/{useUniformFieldArray-COtgcAnp.d.ts → useUniformFieldArray-4MOU0xac.d.ts} +14 -14
- package/dist/useUniformFieldArray-4MOU0xac.d.ts.map +1 -0
- package/dist/{useUniformFieldArray-4pUdrWYT.d.cts → useUniformFieldArray-BChcZvc5.d.cts} +14 -14
- package/dist/useUniformFieldArray-BChcZvc5.d.cts.map +1 -0
- package/dist/{useUniformFieldArray-DNrmEXLg.js → useUniformFieldArray-BKvA0FQW.js} +4 -4
- package/dist/{useUniformFieldArray-DNrmEXLg.js.map → useUniformFieldArray-BKvA0FQW.js.map} +1 -1
- package/dist/{useUniformFieldArray-D93AUZI4.cjs → useUniformFieldArray-CRCbV1J2.cjs} +5 -5
- package/dist/{useUniformFieldArray-D93AUZI4.cjs.map → useUniformFieldArray-CRCbV1J2.cjs.map} +1 -1
- package/dist/{useWatchUserChange-jivI5KIB.cjs → useWatchUserChange-C1Kluht2.cjs} +3 -3
- package/dist/{useWatchUserChange-jivI5KIB.cjs.map → useWatchUserChange-C1Kluht2.cjs.map} +1 -1
- package/dist/{useWatchUserChange-DX6gUHvM.d.ts → useWatchUserChange-CYd_8zeN.d.ts} +1 -1
- package/dist/useWatchUserChange-CYd_8zeN.d.ts.map +1 -0
- package/dist/{useWatchUserChange-cI5-j6M4.d.cts → useWatchUserChange-DedTNvGV.d.cts} +1 -1
- package/dist/useWatchUserChange-DedTNvGV.d.cts.map +1 -0
- package/dist/{useWatchUserChange-DyhUYlrN.js → useWatchUserChange-Dj9Imxfi.js} +2 -2
- package/dist/{useWatchUserChange-DyhUYlrN.js.map → useWatchUserChange-Dj9Imxfi.js.map} +1 -1
- package/package.json +8 -8
- package/dist/FieldCard-38ZBBWyE.cjs.map +0 -1
- package/dist/FieldCard-7XiCb6jZ.js.map +0 -1
- package/dist/FormContext-C2_WMi_v.d.ts.map +0 -1
- package/dist/FormContext-CeFKQmVH.cjs.map +0 -1
- package/dist/FormContext-DHYlCZ2u.js.map +0 -1
- package/dist/FormContext-Dl7KL_wl.d.cts.map +0 -1
- package/dist/index-796vjEop.d.ts.map +0 -1
- package/dist/index-B62CWrcm.d.ts +0 -97
- package/dist/index-B62CWrcm.d.ts.map +0 -1
- package/dist/index-BD9y--o2.d.cts.map +0 -1
- package/dist/index-BFLKkqA3.d.ts.map +0 -1
- package/dist/index-BV_YDI6g.d.ts.map +0 -1
- package/dist/index-BW9EUWZE.d.cts.map +0 -1
- package/dist/index-B_1td56I.d.ts.map +0 -1
- package/dist/index-BgXr1v45.d.cts.map +0 -1
- package/dist/index-Bo79xzb4.d.cts.map +0 -1
- package/dist/index-C3CvgmJw.d.ts.map +0 -1
- package/dist/index-C4-1V8jn.d.ts.map +0 -1
- package/dist/index-CB00FCyi.d.ts.map +0 -1
- package/dist/index-COwP53Gx.d.ts +0 -278
- package/dist/index-COwP53Gx.d.ts.map +0 -1
- package/dist/index-CUy2EDqc.d.cts.map +0 -1
- package/dist/index-CbAh0Kfo.d.cts.map +0 -1
- package/dist/index-Cj-PU3Ck.d.ts.map +0 -1
- package/dist/index-Cj5CLBt2.d.cts.map +0 -1
- package/dist/index-CrxSEKKb.d.cts.map +0 -1
- package/dist/index-D3RMbKbP.d.cts.map +0 -1
- package/dist/index-DAeb_8Q4.d.cts.map +0 -1
- package/dist/index-DEJghucW.d.cts.map +0 -1
- package/dist/index-DJbdReTK.d.ts.map +0 -1
- package/dist/index-DTURD6sl.d.cts.map +0 -1
- package/dist/index-DebErIUS.d.ts.map +0 -1
- package/dist/index-DfGCI-K_.d.cts +0 -278
- package/dist/index-DfGCI-K_.d.cts.map +0 -1
- package/dist/index-DjDR6FpI.d.ts.map +0 -1
- package/dist/index-DsyY9X04.d.cts.map +0 -1
- package/dist/index-DxfiwbJb.d.cts.map +0 -1
- package/dist/index-Dy0m4FQj.d.ts.map +0 -1
- package/dist/index-Y8XsRdxS.d.cts +0 -97
- package/dist/index-Y8XsRdxS.d.cts.map +0 -1
- package/dist/index-aHcGnXHf.d.ts.map +0 -1
- package/dist/index-gWYaaO6O.d.ts.map +0 -1
- package/dist/index-nVYabHcT.d.cts.map +0 -1
- package/dist/index-pE9osud2.d.ts.map +0 -1
- package/dist/useClientValidation-Bg0q3Axc.d.ts.map +0 -1
- package/dist/useClientValidation-BvPDQmf6.d.cts.map +0 -1
- package/dist/useController-BJ2SBdky.d.ts.map +0 -1
- package/dist/useController-C6Pg9T_3.d.cts.map +0 -1
- package/dist/useFormContext-B2TS6xq0.d.ts.map +0 -1
- package/dist/useFormContext-n3WYgGkW.d.cts.map +0 -1
- package/dist/useInputValueDebounce-DI1C6oaU.d.cts.map +0 -1
- package/dist/useInputValueDebounce-fhmVn1aO.d.ts.map +0 -1
- package/dist/useInputValueTransform-BV8o0PMI.d.cts.map +0 -1
- package/dist/useInputValueTransform-Cc0qEsnS.d.ts.map +0 -1
- package/dist/useUniformField-C6oSAFa3.js.map +0 -1
- package/dist/useUniformField-CXSaAVTt.d.ts.map +0 -1
- package/dist/useUniformField-Dd3AnpgE.cjs.map +0 -1
- package/dist/useUniformField-ETnay_UI.d.cts.map +0 -1
- package/dist/useUniformFieldArray-4pUdrWYT.d.cts.map +0 -1
- package/dist/useUniformFieldArray-COtgcAnp.d.ts.map +0 -1
- package/dist/useWatchUserChange-DX6gUHvM.d.ts.map +0 -1
- package/dist/useWatchUserChange-cI5-j6M4.d.cts.map +0 -1
- /package/dist/{index-BLREDRDJ.d.cts → index-BMCcWGYS.d.ts} +0 -0
- /package/dist/{index-BRLjimYW.d.ts → index-C8k_zgEm.d.cts} +0 -0
- /package/dist/{index-BYrmFhKl.d.ts → index-D86jXpHS.d.cts} +0 -0
- /package/dist/{index-CFBmva_r.d.ts → index-DDRpa5CJ.d.cts} +0 -0
- /package/dist/{index-DpEKQcoR.d.cts → index-GGHuYh77.d.ts} +0 -0
- /package/dist/{index-lQ_hGQ08.d.cts → index-hIBrhvnj.d.ts} +0 -0
- /package/dist/{useInput--wjwIBc5.d.cts → useInput-BVZvtfNg.d.ts} +0 -0
- /package/dist/{useInput-DZ6KGBxw.js → useInput-BWzvIUpW.js} +0 -0
- /package/dist/{useInput-BCdeYOOg.d.ts → useInput-CKmKH9Ij.d.cts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioBoxes-ClDOhQkO.cjs","names":["VisuallyHidden","useUniformField","createOptionValueConverter","HeroRadioGroup","RadioBoxes"],"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 RadioBoxesOption {\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: RadioBoxesOption[];\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 orientation={inline ? 'horizontal' : 'vertical'}\n value={value != null ? String(value) : ''}\n onValueChange={(newValue) => {\n onChange(convertToOriginalType(newValue));\n }}\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 } from './RadioBoxes';\nexport { radioBoxVariants } from './RadioBox';\n\nexport { RadioBoxes };\n\nexport default RadioBoxes;\n"],"mappings":";;;;;;;;;AASA,MAAa,kDAAsB;CACjC,OAAO;EACL,MAAM;EACN,SAAS;EACT,aAAa;EACb,MAAM;EACN,OAAO;EACP,cAAc;EACf;CACD,UAAU;EACR,YAAY,EACV,MAAM,EACJ,MAAM,wCACP,EACF;EACD,WAAW,EACT,MAAM,EACJ,MAAM,kBACP,EACF;EACF;CACF,CAAC;AAaF,MAAa,YAAY,EACvB,YAAY,cAAc,QAC1B,OAAO,QAC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2B,QAAQ;CAIrE,MAAM,8DADW,oBAAoB,EACa,WAAW,OAAO;CACpE,MAAM,gBAA6C;EACjD,MAAM,WAAW;EACjB,SAAS,WAAW;EACpB,aAAa,WAAW;EACxB,OAAO,WAAW;EAClB,cAAc,WAAW;EAC1B;AAED,QACE,2CAACC;EACM;EACL,cAAY;EACA;EAGZ,gBAAc;EACd,iBAAe;EACf,eAAa;EACC;EACd,YAAY;EACZ,WAAW;EACX,YAAY;EACZ,OAAO,QAAQ,2CAAC,sBAAQ,QAAe,GAAG;EACpC;EACE;EACR,aAAa,SAAS,eAAe;EACrC,OAAO,SAAS,OAAO,OAAO,MAAM,GAAG;EACvC,gBAAgB,aAAa;AAC3B,YAAS,sBAAsB,SAAS,CAAC;;YAG1C,QAAQ,KAAK,WAAW;AACvB,OAAI,WAAW,QAAQ;IACrB,MAAM,mDACJ,GAAG,OAAO,UAAU,OAAO,UAAU,OAAO,SAC5C,EAAE,aAAa,MAAM,CACtB;AACD,WACE,2CAAC;KAEC,YAAY;KACZ,eAAa;KACb,aAAa,OAAO;KACpB,MAAM,OAAO;KACb,YAAY,CAAC,CAAC,YAAY,OAAO;KACjC,WAAW;KACX,OAAO,OAAO,OAAO,MAAM;eAE1B,OAAO,SAAS,OAAO;OATnB,OAAO,OAAO,MAAM,CAUhB;;AAGf,UAAO;IACP;GACa;;AAIrB,2BAAe;;;;ACnJf,yBAAeC"}
|
|
1
|
+
{"version":3,"file":"RadioBoxes-xRvNe5U8.cjs","names":["VisuallyHidden","useUniformField","createOptionValueConverter","HeroRadioGroup","RadioBoxes"],"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 RadioBoxesOption {\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: RadioBoxesOption[];\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 orientation={inline ? 'horizontal' : 'vertical'}\n value={value != null ? String(value) : ''}\n onValueChange={(newValue) => {\n onChange(convertToOriginalType(newValue));\n }}\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 } from './RadioBoxes';\nexport { radioBoxVariants } from './RadioBox';\n\nexport { RadioBoxes };\n\nexport default RadioBoxes;\n"],"mappings":";;;;;;;;;AASA,MAAa,kDAAsB;CACjC,OAAO;EACL,MAAM;EACN,SAAS;EACT,aAAa;EACb,MAAM;EACN,OAAO;EACP,cAAc;EACf;CACD,UAAU;EACR,YAAY,EACV,MAAM,EACJ,MAAM,wCACP,EACF;EACD,WAAW,EACT,MAAM,EACJ,MAAM,kBACP,EACF;EACF;CACF,CAAC;AAaF,MAAa,YAAY,EACvB,YAAY,cAAc,QAC1B,OAAO,QACP,YAAY,OACZ,GAAG,YACgB;CACnB,MAAM,EACJ,UACA,WACA,aACA,cACA,iBACA,eACA,eACA,sBACA,iBACA,2CACW,MAAwB;CAOrC,MAAM,8DAJW,iBAAiB;EAChC;EACA;EACD,CAAC,EAIA,aACA,OACD;AAED,QACE,4CAAC;EAAU,GAAI,cAAc;EAAE,WAAW,WAAW;;GACnD,2CAACA,wDACC,2CAAC,WAAM,GAAI,eAAe,GAAI,GACf;GAChB,CAAC,OACA,2CAAC;IAAK,GAAI,iBAAiB;cACzB,2CAAC;KACC,GAAI,iBAAiB;KACrB,0CAAc,iBAAiB,CAAC,WAAW,WAAW,QAAQ;MAC9D;KACG,GACL;GACH,OAAO,2CAAC;IAAI,WAAW,WAAW;cAAO;KAAW,GAAG;GACxD,4CAAC;IACC,GAAI,sBAAsB;IAC1B,0CACE,sBAAsB,CAAC,WACvB,WAAW,aACZ;eAEA,WACC,2CAAC;KACC,GAAI,eAAe;KACnB,0CAAc,eAAe,CAAC,WAAW,WAAW,MAAM;KAEzD;MACI,GACL,MACH,cACC,2CAAC;KAAI,WAAW,WAAW;eAAc;MAAkB,GACzD;KACA;GACL,OACC,2CAAC;IAAK,GAAI,iBAAiB;cACzB,2CAAC;KACC,GAAI,iBAAiB;KACrB,0CAAc,iBAAiB,CAAC,WAAW,WAAW,QAAQ;MAC9D;KACG,GACL;;GAC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AAe;;;;ACnJf,yBAAeC"}
|
package/dist/RadioTabs/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
-
const require_RadioTabs = require('../RadioTabs-
|
|
2
|
+
const require_RadioTabs = require('../RadioTabs-BaHvYcd-.cjs');
|
|
3
3
|
|
|
4
4
|
exports.RadioTabs = require_RadioTabs.RadioTabs_default$1;
|
|
5
5
|
exports.default = require_RadioTabs.RadioTabs_default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as RadioTabsProps, t as RadioTabs } from "../index-
|
|
1
|
+
import { n as RadioTabsProps, t as RadioTabs } from "../index-CAMcAf2p.cjs";
|
|
2
2
|
export { RadioTabs, RadioTabs as default, RadioTabsProps };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as RadioTabsProps, t as RadioTabs } from "../index-
|
|
1
|
+
import { n as RadioTabsProps, t as RadioTabs } from "../index-Cbz1wgYP.js";
|
|
2
2
|
export { RadioTabs, RadioTabs as default, RadioTabsProps };
|
package/dist/RadioTabs/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const require_FormContext = require('./FormContext-
|
|
2
|
-
const require_helpers = require('./helpers-
|
|
3
|
-
const require_useUniformField = require('./useUniformField-
|
|
1
|
+
const require_FormContext = require('./FormContext-BSLO2-sO.cjs');
|
|
2
|
+
const require_helpers = require('./helpers-Bd_QpqXg.cjs');
|
|
3
|
+
const require_useUniformField = require('./useUniformField-6c4OCAfb.cjs');
|
|
4
4
|
let _fuf_stack_pixel_utils = require("@fuf-stack/pixel-utils");
|
|
5
5
|
let react = require("react");
|
|
6
6
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -133,4 +133,4 @@ Object.defineProperty(exports, 'RadioTabs_default$1', {
|
|
|
133
133
|
return RadioTabs_default$1;
|
|
134
134
|
}
|
|
135
135
|
});
|
|
136
|
-
//# sourceMappingURL=RadioTabs-
|
|
136
|
+
//# sourceMappingURL=RadioTabs-BaHvYcd-.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioTabs-
|
|
1
|
+
{"version":3,"file":"RadioTabs-BaHvYcd-.cjs","names":["useUniformField","createOptionValueConverter","VisuallyHidden","HeroRadioGroup","Tabs","RadioTabs"],"sources":["../src/RadioTabs/RadioTabs.tsx","../src/RadioTabs/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { TabsProps } from '@fuf-stack/pixels';\nimport type { TabProps } from '@fuf-stack/pixels/Tabs';\nimport type { ReactElement, ReactNode } from 'react';\n\nimport { useRef } from 'react';\n\nimport { RadioGroup as HeroRadioGroup } from '@heroui/radio';\nimport { VisuallyHidden } from '@react-aria/visually-hidden';\n\nimport { slugify, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\nimport Tabs from '@fuf-stack/pixels/Tabs';\n\nimport { createOptionValueConverter } from '../helpers';\nimport { useUniformField } from '../hooks/useUniformField';\n\nexport const radioTabsVariants = tv({\n slots: {\n base: 'group gap-0', // Needs group for group-data condition\n cursor: '',\n label:\n 'mb-2 inline-flex text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:text-danger',\n tab: '',\n tabBase: '',\n tabContent: '',\n tabList: '',\n tabPanel: 'p-3',\n tabWrapper: '',\n wrapper: '',\n },\n variants: {\n hasContent: {\n true: {\n base: '',\n tabBase: 'p-1',\n tabWrapper: [\n // border style\n 'rounded-medium border border-divider',\n // full width\n 'w-full',\n ],\n },\n },\n fullWidth: {\n true: {\n tabWrapper: 'w-full',\n },\n },\n isInvalid: {\n true: {\n tabWrapper: 'rounded-medium border-2 !border-danger',\n },\n },\n },\n});\n\ntype VariantProps = TVProps<typeof radioTabsVariants>;\ntype ClassName = TVClassName<typeof radioTabsVariants>;\n\nexport interface RadioTabsOption {\n /** Optional content inside of the tab */\n content?: 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 | boolean;\n}\n\nexport interface RadioTabsProps extends Omit<VariantProps, 'hasContent'> {\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 /** Whether tabs should take up full container width */\n fullWidth?: 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: RadioTabsOption[];\n /** Id to grab element in internal tests. */\n testId?: string;\n /** How the RadioTabs should look like. */\n variant?: TabsProps['variant'];\n}\n\n/**\n * RadioTabs component based on [HeroUI RadioGroup](https://www.heroui.com//docs/components/radio-group)\n * and [HeroUI Tabs](https://www.heroui.com//docs/components/tabs)\n */\nconst RadioTabs = ({\n className = undefined,\n fullWidth = false,\n inline = false,\n name,\n options,\n variant = undefined,\n ...uniformFieldProps\n}: RadioTabsProps): ReactElement => {\n const {\n ariaLabel,\n disabled,\n errorMessage,\n field: { onBlur, onChange, ref, value },\n invalid,\n label,\n required,\n testId,\n } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n // Create a ref for the visual radio group to forward focus\n const visualRadioGroupRef = useRef<HTMLDivElement>(null);\n\n // Create converter to preserve number types for option values\n const { convertToOriginalType } = createOptionValueConverter(options);\n\n const tabOptions = options.map<TabProps>((option) => {\n return {\n content: option?.content,\n disabled: option?.disabled,\n // Tabs component uses string keys internally\n key: String(option.value),\n label: option?.label ?? option?.value,\n testId: slugify(`option_${option?.testId ?? option?.value}`, {\n replaceDots: true,\n }),\n };\n });\n\n const disabledAllKeys: string[] | undefined = tabOptions?.map((option) => {\n return option.key as string;\n });\n\n // check if any option has content\n // eslint-disable-next-line @typescript-eslint/no-misused-promises, @typescript-eslint/promise-function-async\n const hasContent = options.some((option) => {\n return option.content;\n });\n\n // classNames from slots\n const variants = radioTabsVariants({\n fullWidth,\n hasContent,\n isInvalid: invalid,\n });\n const classNames = variantsToClassNames(variants, className, 'base');\n\n return (\n <>\n {/* Visually hidden input for React Hook Form focus management */}\n <VisuallyHidden>\n <input\n ref={ref}\n aria-label={ariaLabel}\n name={name}\n onBlur={onBlur}\n value={value ?? ''}\n onChange={(e) => {\n onChange(convertToOriginalType(e.target.value));\n }}\n onFocus={() => {\n // Forward focus to the first tab when RHF focuses this input\n const firstTab = visualRadioGroupRef.current?.querySelector(\n '[role=\"tab\"]',\n ) as HTMLElement;\n firstTab?.focus();\n }}\n />\n </VisuallyHidden>\n\n <HeroRadioGroup\n ref={visualRadioGroupRef}\n aria-label={ariaLabel}\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}_radiotabs`}\n orientation={inline ? 'horizontal' : 'vertical'}\n classNames={{\n base: classNames.base,\n label: classNames.label,\n wrapper: classNames.wrapper,\n }}\n >\n <Tabs\n disabledKeys={disabled ? disabledAllKeys : undefined}\n // make sure component is controlled (convert to string for Tabs)\n selectedKey={value != null ? String(value) : ''}\n tabs={tabOptions}\n testId={testId}\n variant={variant}\n className={{\n base: classNames.tabBase,\n cursor: classNames.cursor,\n panel: classNames.tabPanel,\n tab: classNames.tab,\n tabContent: classNames.tabContent,\n tabList: classNames.tabList,\n tabWrapper: classNames.tabWrapper,\n }}\n onSelectionChange={(key) => {\n if (key != null) {\n onChange(convertToOriginalType(key));\n }\n }}\n />\n </HeroRadioGroup>\n </>\n );\n};\n\nexport default RadioTabs;\n","import RadioTabs from './RadioTabs';\n\nexport type { RadioTabsProps } from './RadioT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,YAAS,sBAAsB,EAAE,OAAO,MAAM,CAAC;;EAEjD,eAAe;AAKb,IAHiB,oBAAoB,SAAS,cAC5C,iBACD,GACS,OAAO;;GAEnB,GACa,EAEjB,2CAACC;EACC,KAAK;EACL,cAAY;EAGZ,gBAAc;EACd,iBAAe;EACf,eAAa;EACC;EACd,YAAY;EACZ,WAAW;EACX,YAAY;EACZ,OAAO,QAAQ,2CAAC,sBAAQ,QAAe,GAAG;EAC1C,MAAM,GAAG,KAAK;EACd,aAAa,SAAS,eAAe;EACrC,YAAY;GACV,MAAM,WAAW;GACjB,OAAO,WAAW;GAClB,SAAS,WAAW;GACrB;YAED,2CAACC;GACC,cAAc,WAAW,kBAAkB;GAE3C,aAAa,SAAS,OAAO,OAAO,MAAM,GAAG;GAC7C,MAAM;GACE;GACC;GACT,WAAW;IACT,MAAM,WAAW;IACjB,QAAQ,WAAW;IACnB,OAAO,WAAW;IAClB,KAAK,WAAW;IAChB,YAAY,WAAW;IACvB,SAAS,WAAW;IACpB,YAAY,WAAW;IACxB;GACD,oBAAoB,QAAQ;AAC1B,QAAI,OAAO,KACT,UAAS,sBAAsB,IAAI,CAAC;;IAGxC;GACa,IAChB;;AAIP,0BAAe;;;;AClOf,wBAAeC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as useUniformField } from "./useUniformField-
|
|
1
|
+
import { l as createOptionValueConverter } from "./helpers-33jajRcN.js";
|
|
2
|
+
import { t as useUniformField } from "./useUniformField-C-Xyu-8v.js";
|
|
3
3
|
import { slugify, tv, variantsToClassNames } from "@fuf-stack/pixel-utils";
|
|
4
4
|
import { useRef } from "react";
|
|
5
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -120,4 +120,4 @@ var RadioTabs_default = RadioTabs_default$1;
|
|
|
120
120
|
|
|
121
121
|
//#endregion
|
|
122
122
|
export { RadioTabs_default$1 as n, RadioTabs_default as t };
|
|
123
|
-
//# sourceMappingURL=RadioTabs-
|
|
123
|
+
//# sourceMappingURL=RadioTabs-DfOGIsEf.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RadioTabs-
|
|
1
|
+
{"version":3,"file":"RadioTabs-DfOGIsEf.js","names":["HeroRadioGroup","RadioTabs"],"sources":["../src/RadioTabs/RadioTabs.tsx","../src/RadioTabs/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { TabsProps } from '@fuf-stack/pixels';\nimport type { TabProps } from '@fuf-stack/pixels/Tabs';\nimport type { ReactElement, ReactNode } from 'react';\n\nimport { useRef } from 'react';\n\nimport { RadioGroup as HeroRadioGroup } from '@heroui/radio';\nimport { VisuallyHidden } from '@react-aria/visually-hidden';\n\nimport { slugify, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\nimport Tabs from '@fuf-stack/pixels/Tabs';\n\nimport { createOptionValueConverter } from '../helpers';\nimport { useUniformField } from '../hooks/useUniformField';\n\nexport const radioTabsVariants = tv({\n slots: {\n base: 'group gap-0', // Needs group for group-data condition\n cursor: '',\n label:\n 'mb-2 inline-flex text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:text-danger',\n tab: '',\n tabBase: '',\n tabContent: '',\n tabList: '',\n tabPanel: 'p-3',\n tabWrapper: '',\n wrapper: '',\n },\n variants: {\n hasContent: {\n true: {\n base: '',\n tabBase: 'p-1',\n tabWrapper: [\n // border style\n 'rounded-medium border border-divider',\n // full width\n 'w-full',\n ],\n },\n },\n fullWidth: {\n true: {\n tabWrapper: 'w-full',\n },\n },\n isInvalid: {\n true: {\n tabWrapper: 'rounded-medium border-2 !border-danger',\n },\n },\n },\n});\n\ntype VariantProps = TVProps<typeof radioTabsVariants>;\ntype ClassName = TVClassName<typeof radioTabsVariants>;\n\nexport interface RadioTabsOption {\n /** Optional content inside of the tab */\n content?: 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 | boolean;\n}\n\nexport interface RadioTabsProps extends Omit<VariantProps, 'hasContent'> {\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 /** Whether tabs should take up full container width */\n fullWidth?: 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: RadioTabsOption[];\n /** Id to grab element in internal tests. */\n testId?: string;\n /** How the RadioTabs should look like. */\n variant?: TabsProps['variant'];\n}\n\n/**\n * RadioTabs component based on [HeroUI RadioGroup](https://www.heroui.com//docs/components/radio-group)\n * and [HeroUI Tabs](https://www.heroui.com//docs/components/tabs)\n */\nconst RadioTabs = ({\n className = undefined,\n fullWidth = false,\n inline = false,\n name,\n options,\n variant = undefined,\n ...uniformFieldProps\n}: RadioTabsProps): ReactElement => {\n const {\n ariaLabel,\n disabled,\n errorMessage,\n field: { onBlur, onChange, ref, value },\n invalid,\n label,\n required,\n testId,\n } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n // Create a ref for the visual radio group to forward focus\n const visualRadioGroupRef = useRef<HTMLDivElement>(null);\n\n // Create converter to preserve number types for option values\n const { convertToOriginalType } = createOptionValueConverter(options);\n\n const tabOptions = options.map<TabProps>((option) => {\n return {\n content: option?.content,\n disabled: option?.disabled,\n // Tabs component uses string keys internally\n key: String(option.value),\n label: option?.label ?? option?.value,\n testId: slugify(`option_${option?.testId ?? option?.value}`, {\n replaceDots: true,\n }),\n };\n });\n\n const disabledAllKeys: string[] | undefined = tabOptions?.map((option) => {\n return option.key as string;\n });\n\n // check if any option has content\n // eslint-disable-next-line @typescript-eslint/no-misused-promises, @typescript-eslint/promise-function-async\n const hasContent = options.some((option) => {\n return option.content;\n });\n\n // classNames from slots\n const variants = radioTabsVariants({\n fullWidth,\n hasContent,\n isInvalid: invalid,\n });\n const classNames = variantsToClassNames(variants, className, 'base');\n\n return (\n <>\n {/* Visually hidden input for React Hook Form focus management */}\n <VisuallyHidden>\n <input\n ref={ref}\n aria-label={ariaLabel}\n name={name}\n onBlur={onBlur}\n value={value ?? ''}\n onChange={(e) => {\n onChange(convertToOriginalType(e.target.value));\n }}\n onFocus={() => {\n // Forward focus to the first tab when RHF focuses this input\n const firstTab = visualRadioGroupRef.current?.querySelector(\n '[role=\"tab\"]',\n ) as HTMLElement;\n firstTab?.focus();\n }}\n />\n </VisuallyHidden>\n\n <HeroRadioGroup\n ref={visualRadioGroupRef}\n aria-label={ariaLabel}\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}_radiotabs`}\n orientation={inline ? 'horizontal' : 'vertical'}\n classNames={{\n base: classNames.base,\n label: classNames.label,\n wrapper: classNames.wrapper,\n }}\n >\n <Tabs\n disabledKeys={disabled ? disabledAllKeys : undefined}\n // make sure component is controlled (convert to string for Tabs)\n selectedKey={value != null ? String(value) : ''}\n tabs={tabOptions}\n testId={testId}\n variant={variant}\n className={{\n base: classNames.tabBase,\n cursor: classNames.cursor,\n panel: classNames.tabPanel,\n tab: classNames.tab,\n tabContent: classNames.tabContent,\n tabList: classNames.tabList,\n tabWrapper: classNames.tabWrapper,\n }}\n onSelectionChange={(key) => {\n if (key != null) {\n onChange(convertToOriginalType(key));\n }\n }}\n />\n </HeroRadioGroup>\n </>\n );\n};\n\nexport default RadioTabs;\n","import RadioTabs from './RadioTabs';\n\nexport type { RadioTabsProps } from './RadioTabs';\n\nexport { RadioTabs };\n\nexport default RadioTabs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EAAE,OAAO,MAAM,CAAC;;EAEjD,eAAe;AAKb,IAHiB,oBAAoB,SAAS,cAC5C,iBACD,GACS,OAAO;;GAEnB,GACa,EAEjB,oBAACA;EACC,KAAK;EACL,cAAY;EAGZ,gBAAc;EACd,iBAAe;EACf,eAAa;EACC;EACd,YAAY;EACZ,WAAW;EACX,YAAY;EACZ,OAAO,QAAQ,oBAAC,sBAAQ,QAAe,GAAG;EAC1C,MAAM,GAAG,KAAK;EACd,aAAa,SAAS,eAAe;EACrC,YAAY;GACV,MAAM,WAAW;GACjB,OAAO,WAAW;GAClB,SAAS,WAAW;GACrB;YAED,oBAAC;GACC,cAAc,WAAW,kBAAkB;GAE3C,aAAa,SAAS,OAAO,OAAO,MAAM,GAAG;GAC7C,MAAM;GACE;GACC;GACT,WAAW;IACT,MAAM,WAAW;IACjB,QAAQ,WAAW;IACnB,OAAO,WAAW;IAClB,KAAK,WAAW;IAChB,YAAY,WAAW;IACvB,SAAS,WAAW;IACpB,YAAY,WAAW;IACxB;GACD,oBAAoB,QAAQ;AAC1B,QAAI,OAAO,KACT,UAAS,sBAAsB,IAAI,CAAC;;IAGxC;GACa,IAChB;;AAIP,0BAAe;;;;AClOf,wBAAeC"}
|
package/dist/Radios/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
-
const require_Radios = require('../Radios-
|
|
2
|
+
const require_Radios = require('../Radios-BfA3uL35.cjs');
|
|
3
3
|
|
|
4
4
|
exports.Radios = require_Radios.Radios_default$1;
|
|
5
5
|
exports.default = require_Radios.Radios_default;
|
package/dist/Radios/index.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as RadiosProps, t as Radios } from "../index-
|
|
1
|
+
import { n as RadiosProps, t as Radios } from "../index-DUbBP1s0.cjs";
|
|
2
2
|
export { Radios, Radios as default, RadiosProps };
|
package/dist/Radios/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as RadiosProps, t as Radios } from "../index-
|
|
1
|
+
import { n as RadiosProps, t as Radios } from "../index-CDdjrJRs.js";
|
|
2
2
|
export { Radios, Radios as default, RadiosProps };
|
package/dist/Radios/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
const require_FormContext = require('./FormContext-
|
|
2
|
-
const require_helpers = require('./helpers-
|
|
3
|
-
const require_useUniformField = require('./useUniformField-
|
|
1
|
+
const require_FormContext = require('./FormContext-BSLO2-sO.cjs');
|
|
2
|
+
const require_helpers = require('./helpers-Bd_QpqXg.cjs');
|
|
3
|
+
const require_useUniformField = require('./useUniformField-6c4OCAfb.cjs');
|
|
4
4
|
let _fuf_stack_pixel_utils = require("@fuf-stack/pixel-utils");
|
|
5
5
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
6
|
let _heroui_radio = require("@heroui/radio");
|
|
@@ -88,4 +88,4 @@ Object.defineProperty(exports, 'Radios_default$1', {
|
|
|
88
88
|
return Radios_default$1;
|
|
89
89
|
}
|
|
90
90
|
});
|
|
91
|
-
//# sourceMappingURL=Radios-
|
|
91
|
+
//# sourceMappingURL=Radios-BfA3uL35.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radios-
|
|
1
|
+
{"version":3,"file":"Radios-BfA3uL35.cjs","names":["useUniformField","createOptionValueConverter","HeroRadioGroup","HeroRadio","Radios"],"sources":["../src/Radios/Radios.tsx","../src/Radios/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { ReactElement, ReactNode } from 'react';\n\nimport {\n Radio as HeroRadio,\n RadioGroup as HeroRadioGroup,\n} from '@heroui/radio';\n\nimport { slugify, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { createOptionValueConverter } from '../helpers';\nimport { useUniformField } from '../hooks/useUniformField';\n\nexport const radiosVariants = tv({\n slots: {\n // Needs group for group-data condition\n base: 'group gap-0',\n itemBase: '',\n itemControl: 'bg-focus group-data-[invalid=true]:bg-danger',\n itemDescription: '',\n itemLabel: 'text-sm',\n itemLabelWrapper: '',\n itemWrapper:\n 'group-data-[invalid=true]:border-danger! [&:not(group-data-[invalid=\"true\"]):not(group-data-[selected=\"false\"])]:border-focus',\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 radiosVariants>;\ntype ClassName = TVClassName<typeof radiosVariants>;\n\nexport interface RadioOption {\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 RadiosProps 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: RadioOption[];\n /** Id to grab element in internal tests. */\n testId?: string;\n}\n\n/**\n * Radios component based on [HeroUI RadioGroup](https://www.heroui.com//docs/components/radio-group)\n */\nconst Radios = ({\n className = undefined,\n inline = false,\n name,\n options,\n ...uniformFieldProps\n}: RadiosProps): ReactElement => {\n const {\n ariaLabel,\n disabled,\n errorMessage,\n field: { onBlur, onChange, ref, value },\n invalid,\n label,\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 = radiosVariants();\n const classNames = variantsToClassNames(variants, className, 'base');\n\n const itemClassNames = {\n base: classNames.itemBase,\n control: classNames.itemControl,\n description: classNames.itemDescription,\n label: classNames.itemLabel,\n labelWrapper: classNames.itemLabelWrapper,\n wrapper: classNames.itemWrapper,\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 orientation={inline ? 'horizontal' : 'vertical'}\n value={value != null ? String(value) : ''}\n onValueChange={(newValue) => {\n onChange(convertToOriginalType(newValue));\n }}\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 <HeroRadio\n key={String(option.value)}\n classNames={itemClassNames}\n data-testid={optionTestId}\n isDisabled={!!disabled || option.disabled}\n value={String(option.value)}\n >\n {option.label ?? option.value}\n </HeroRadio>\n );\n }\n return null;\n })}\n </HeroRadioGroup>\n );\n};\n\nexport default Radios;\n","import Radios from './Radios';\n\nexport type { RadiosProps } from './Radios';\n\nexport { Radios };\n\nexport default Radios;\n"],"mappings":";;;;;;;;AAaA,MAAa,gDAAoB,EAC/B,OAAO;CAEL,MAAM;CACN,UAAU;CACV,aAAa;CACb,iBAAiB;CACjB,WAAW;CACX,kBAAkB;CAClB,aACE;CAEF,OACE;CACF,SAAS;CACV,EACF,CAAC;;;;AAwCF,MAAM,UAAU,EACd,YAAY,QACZ,SAAS,OACT,MACA,SACA,GAAG,wBAC4B;CAC/B,MAAM,EACJ,WACA,UACA,cACA,OAAO,EAAE,QAAQ,UAAU,KAAK,SAChC,SACA,OACA,UACA,WACEA,wCAAgB;EAClB;EACA,GAAG;EACJ,CAAC;CAGF,MAAM,EAAE,0BAA0BC,2CAA2B,QAAQ;CAIrE,MAAM,8DADW,gBAAgB,EACiB,WAAW,OAAO;CAEpE,MAAM,iBAAiB;EACrB,MAAM,WAAW;EACjB,SAAS,WAAW;EACpB,aAAa,WAAW;EACxB,OAAO,WAAW;EAClB,cAAc,WAAW;EACzB,SAAS,WAAW;EACrB;AAED,QACE,2CAACC;EACM;EACL,cAAY;EACA;EAGZ,gBAAc;EACd,iBAAe;EACf,eAAa;EACC;EACd,YAAY;EACZ,WAAW;EACX,YAAY;EACZ,OAAO,QAAQ,2CAAC,sBAAQ,QAAe,GAAG;EACpC;EACE;EACR,aAAa,SAAS,eAAe;EACrC,OAAO,SAAS,OAAO,OAAO,MAAM,GAAG;EACvC,gBAAgB,aAAa;AAC3B,YAAS,sBAAsB,SAAS,CAAC;;YAG1C,QAAQ,KAAK,WAAW;AACvB,OAAI,WAAW,QAAQ;IACrB,MAAM,mDACJ,GAAG,OAAO,UAAU,OAAO,UAAU,OAAO,SAC5C,EAAE,aAAa,MAAM,CACtB;AACD,WACE,2CAACC;KAEC,YAAY;KACZ,eAAa;KACb,YAAY,CAAC,CAAC,YAAY,OAAO;KACjC,OAAO,OAAO,OAAO,MAAM;eAE1B,OAAO,SAAS,OAAO;OANnB,OAAO,OAAO,MAAM,CAOf;;AAGhB,UAAO;IACP;GACa;;AAIrB,uBAAe;;;;ACnJf,qBAAeC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t as useUniformField } from "./useUniformField-
|
|
1
|
+
import { l as createOptionValueConverter } from "./helpers-33jajRcN.js";
|
|
2
|
+
import { t as useUniformField } from "./useUniformField-C-Xyu-8v.js";
|
|
3
3
|
import { slugify, tv, variantsToClassNames } from "@fuf-stack/pixel-utils";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
import { Radio, RadioGroup } from "@heroui/radio";
|
|
@@ -76,4 +76,4 @@ var Radios_default = Radios_default$1;
|
|
|
76
76
|
|
|
77
77
|
//#endregion
|
|
78
78
|
export { Radios_default$1 as n, Radios_default as t };
|
|
79
|
-
//# sourceMappingURL=Radios-
|
|
79
|
+
//# sourceMappingURL=Radios-xM-09vB5.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Radios-
|
|
1
|
+
{"version":3,"file":"Radios-xM-09vB5.js","names":["HeroRadioGroup","HeroRadio","Radios"],"sources":["../src/Radios/Radios.tsx","../src/Radios/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { ReactElement, ReactNode } from 'react';\n\nimport {\n Radio as HeroRadio,\n RadioGroup as HeroRadioGroup,\n} from '@heroui/radio';\n\nimport { slugify, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { createOptionValueConverter } from '../helpers';\nimport { useUniformField } from '../hooks/useUniformField';\n\nexport const radiosVariants = tv({\n slots: {\n // Needs group for group-data condition\n base: 'group gap-0',\n itemBase: '',\n itemControl: 'bg-focus group-data-[invalid=true]:bg-danger',\n itemDescription: '',\n itemLabel: 'text-sm',\n itemLabelWrapper: '',\n itemWrapper:\n 'group-data-[invalid=true]:border-danger! [&:not(group-data-[invalid=\"true\"]):not(group-data-[selected=\"false\"])]:border-focus',\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 radiosVariants>;\ntype ClassName = TVClassName<typeof radiosVariants>;\n\nexport interface RadioOption {\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 RadiosProps 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: RadioOption[];\n /** Id to grab element in internal tests. */\n testId?: string;\n}\n\n/**\n * Radios component based on [HeroUI RadioGroup](https://www.heroui.com//docs/components/radio-group)\n */\nconst Radios = ({\n className = undefined,\n inline = false,\n name,\n options,\n ...uniformFieldProps\n}: RadiosProps): ReactElement => {\n const {\n ariaLabel,\n disabled,\n errorMessage,\n field: { onBlur, onChange, ref, value },\n invalid,\n label,\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 = radiosVariants();\n const classNames = variantsToClassNames(variants, className, 'base');\n\n const itemClassNames = {\n base: classNames.itemBase,\n control: classNames.itemControl,\n description: classNames.itemDescription,\n label: classNames.itemLabel,\n labelWrapper: classNames.itemLabelWrapper,\n wrapper: classNames.itemWrapper,\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 orientation={inline ? 'horizontal' : 'vertical'}\n value={value != null ? String(value) : ''}\n onValueChange={(newValue) => {\n onChange(convertToOriginalType(newValue));\n }}\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 <HeroRadio\n key={String(option.value)}\n classNames={itemClassNames}\n data-testid={optionTestId}\n isDisabled={!!disabled || option.disabled}\n value={String(option.value)}\n >\n {option.label ?? option.value}\n </HeroRadio>\n );\n }\n return null;\n })}\n </HeroRadioGroup>\n );\n};\n\nexport default Radios;\n","import Radios from './Radios';\n\nexport type { RadiosProps } from './Radios';\n\nexport { Radios };\n\nexport default Radios;\n"],"mappings":";;;;;;;AAaA,MAAa,iBAAiB,GAAG,EAC/B,OAAO;CAEL,MAAM;CACN,UAAU;CACV,aAAa;CACb,iBAAiB;CACjB,WAAW;CACX,kBAAkB;CAClB,aACE;CAEF,OACE;CACF,SAAS;CACV,EACF,CAAC;;;;AAwCF,MAAM,UAAU,EACd,YAAY,QACZ,SAAS,OACT,MACA,SACA,GAAG,wBAC4B;CAC/B,MAAM,EACJ,WACA,UACA,cACA,OAAO,EAAE,QAAQ,UAAU,KAAK,SAChC,SACA,OACA,UACA,WACE,gBAAgB;EAClB;EACA,GAAG;EACJ,CAAC;CAGF,MAAM,EAAE,0BAA0B,2BAA2B,QAAQ;CAIrE,MAAM,aAAa,qBADF,gBAAgB,EACiB,WAAW,OAAO;CAEpE,MAAM,iBAAiB;EACrB,MAAM,WAAW;EACjB,SAAS,WAAW;EACpB,aAAa,WAAW;EACxB,OAAO,WAAW;EAClB,cAAc,WAAW;EACzB,SAAS,WAAW;EACrB;AAED,QACE,oBAACA;EACM;EACL,cAAY;EACA;EAGZ,gBAAc;EACd,iBAAe;EACf,eAAa;EACC;EACd,YAAY;EACZ,WAAW;EACX,YAAY;EACZ,OAAO,QAAQ,oBAAC,sBAAQ,QAAe,GAAG;EACpC;EACE;EACR,aAAa,SAAS,eAAe;EACrC,OAAO,SAAS,OAAO,OAAO,MAAM,GAAG;EACvC,gBAAgB,aAAa;AAC3B,YAAS,sBAAsB,SAAS,CAAC;;YAG1C,QAAQ,KAAK,WAAW;AACvB,OAAI,WAAW,QAAQ;IACrB,MAAM,eAAe,QACnB,GAAG,OAAO,UAAU,OAAO,UAAU,OAAO,SAC5C,EAAE,aAAa,MAAM,CACtB;AACD,WACE,oBAACC;KAEC,YAAY;KACZ,eAAa;KACb,YAAY,CAAC,CAAC,YAAY,OAAO;KACjC,OAAO,OAAO,OAAO,MAAM;eAE1B,OAAO,SAAS,OAAO;OANnB,OAAO,OAAO,MAAM,CAOf;;AAGhB,UAAO;IACP;GACa;;AAIrB,uBAAe;;;;ACnJf,qBAAeC"}
|
package/dist/Select/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
-
const require_Select = require('../Select-
|
|
2
|
+
const require_Select = require('../Select-DH_YaruM.cjs');
|
|
3
3
|
|
|
4
4
|
exports.Select = require_Select.Select_default$1;
|
|
5
5
|
exports.default = require_Select.Select_default;
|
package/dist/Select/index.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as SelectProps, t as Select } from "../index-
|
|
1
|
+
import { n as SelectProps, t as Select } from "../index-C7t64NIn.cjs";
|
|
2
2
|
export { Select, Select as default, SelectProps };
|
package/dist/Select/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as SelectProps, t as Select } from "../index-
|
|
1
|
+
import { n as SelectProps, t as Select } from "../index-ChOoZHFX.js";
|
|
2
2
|
export { Select, Select as default, SelectProps };
|
package/dist/Select/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const require_FormContext = require('./FormContext-
|
|
2
|
-
const require_helpers = require('./helpers-
|
|
3
|
-
const require_useFormContext = require('./useFormContext-
|
|
4
|
-
const require_useUniformField = require('./useUniformField-
|
|
1
|
+
const require_FormContext = require('./FormContext-BSLO2-sO.cjs');
|
|
2
|
+
const require_helpers = require('./helpers-Bd_QpqXg.cjs');
|
|
3
|
+
const require_useFormContext = require('./useFormContext-vdeeDsAs.cjs');
|
|
4
|
+
const require_useUniformField = require('./useUniformField-6c4OCAfb.cjs');
|
|
5
5
|
let _fuf_stack_pixel_utils = require("@fuf-stack/pixel-utils");
|
|
6
6
|
let react = require("react");
|
|
7
7
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -279,4 +279,4 @@ Object.defineProperty(exports, 'Select_default$1', {
|
|
|
279
279
|
return Select_default$1;
|
|
280
280
|
}
|
|
281
281
|
});
|
|
282
|
-
//# sourceMappingURL=Select-
|
|
282
|
+
//# sourceMappingURL=Select-DH_YaruM.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select-CTbXrAjL.cjs","names":["components","useUniformField","useFormContext","createOptionValueConverter","isValueEmpty","ReactSelect","Select"],"sources":["../src/Select/Select.tsx","../src/Select/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { ReactNode } from 'react';\nimport type { MultiValue, Props, SingleValue } from 'react-select';\n\nimport { useState } from 'react';\nimport ReactSelect, { components } from 'react-select';\n\nimport { useSelect } from '@heroui/select';\n\nimport { cn, slugify, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { createOptionValueConverter, isValueEmpty } from '../helpers';\nimport { useFormContext } from '../hooks/useFormContext';\nimport { useUniformField } from '../hooks/useUniformField';\n\nexport const selectVariants = tv({\n slots: {\n base: 'group leading-normal',\n clearIndicator:\n 'rounded-md p-1 text-foreground-500 hover:cursor-pointer hover:bg-default-200 hover:text-foreground-800',\n control:\n 'duration-150! rounded-lg border-2 border-default-200 bg-content1 transition-background hover:border-default-400 group-data-[invalid=true]:border-danger group-data-[invalid=true]:hover:border-danger motion-reduce:transition-none',\n control_focused: 'border-focus',\n crossIcon: '',\n downChevron: '',\n dropdownIndicator:\n 'rounded-md p-1 text-foreground-500 hover:cursor-pointer hover:bg-default-200 hover:text-black',\n group: '',\n groupHeading: 'mb-1 ml-3 mt-2 text-sm text-foreground-500',\n indicatorsContainer: 'gap-1 p-1',\n indicatorSeparator: 'bg-default-300',\n input: 'py-0.5 pl-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 'pointer-events-auto relative bottom-1.5 ml-1 subpixel-antialiased text-small 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 loadingIndicator: '',\n loadingMessage: 'rounded-sm p-2 text-foreground-500',\n menu: 'mt-2 rounded-xl border border-default-200 bg-content1 p-1 shadow-lg',\n menuList: '',\n // ensure menu has same z-index as modal so it is visible when rendered in modal\n // see: https://github.com/heroui-inc/heroui/blob/main/packages/core/theme/src/components/modal.ts (see z-50)\n menuPortal: 'z-50!',\n multiValue: 'items-center gap-1.5 rounded bg-default-100 py-0.5 pl-2 pr-1',\n multiValueContainer: '',\n multiValueLabel: 'py-0.5 leading-6',\n multiValueRemove:\n 'rounded text-default-500 hover:cursor-pointer hover:border-default-300 hover:text-default-800',\n noOptionsMessage: 'rounded-sm p-2 text-foreground-500',\n option_focused: 'bg-default-100 active:bg-default-200',\n option_selected: 'bg-default-300',\n option: 'rounded px-3 py-2 hover:cursor-pointer',\n placeholder: 'ml-1 py-0.5 pl-1 text-sm text-foreground-500',\n selectContainer: '',\n singleValue: 'ml-1! leading-7!',\n valueContainer: 'gap-1 p-1',\n },\n});\n\ninterface SelectOption {\n /**\n * True when option was auto-generated because the value wasn't found in options.\n * Use in renderOptionLabel to render a component that fetches the real label.\n */\n isFallback?: boolean;\n /** option label */\n label?: ReactNode;\n /** option value */\n value: string | number;\n}\n\ntype VariantProps = TVProps<typeof selectVariants>;\ntype ClassName = TVClassName<typeof selectVariants>;\n\nexport interface SelectProps 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; // string;\n /** Determine if the */\n clearable?: boolean;\n /** Set the select to disabled state. */\n disabled?: boolean;\n /** Filter Select Options */\n filterOption?:\n | undefined\n | ((option?: SelectOption, inputValue?: string) => boolean);\n /** Format the label of the option */\n renderOptionLabel?: undefined | Props['formatOptionLabel'];\n /** The value of the search input */\n inputValue?: string;\n /** Label that should be associated with the select. */\n label?: ReactNode;\n /** Set the select to a loading state. */\n loading?: boolean;\n /** switch between single and multi select mode. */\n multiSelect?: boolean;\n /** The name for the Select component, used by react-hook-form */\n name: string;\n /** Placeholder that is displayed when nothing is selected */\n placeholder?: string;\n /** The options for the Select component */\n options: SelectOption[];\n /** Handle change events on the input */\n onInputChange?: Props['onInputChange'];\n /**\n * Fallback option(s) for async selects when value isn't in current options.\n * Use when the selected value may not be in the options list (e.g., after\n * search results change). Used only if value not found in options.\n * For single select: pass the option object or undefined\n * For multi-select: pass an array of option objects\n */\n selectedOptionFallback?: SelectOption | SelectOption[];\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\nconst InputComponent: typeof components.Input = (props) => {\n // @ts-expect-error data-testid is not a default prop\n // eslint-disable-next-line react/destructuring-assignment\n const testId = `${props.selectProps['data-testid']}`;\n\n return <components.Input data-testid={testId} {...props} />;\n};\n\nconst ControlComponent: typeof components.Control = (props) => {\n // @ts-expect-error data-testid is not a default prop\n // eslint-disable-next-line react/destructuring-assignment\n const testId = `${props.selectProps['data-testid']}_select`;\n return (\n <div data-testid={testId}>\n {}\n <components.Control {...props} />\n </div>\n );\n};\n\nconst OptionComponent: typeof components.Option = (props) => {\n // @ts-expect-error data-testid is not a default prop\n // eslint-disable-next-line react/destructuring-assignment\n const testId = `${props.selectProps['data-testid']}_select_option_${slugify(String(props?.data?.testId ?? props?.data?.value), { replaceDots: true })}`;\n return (\n <div data-testid={testId}>\n {}\n <components.Option {...props} />\n </div>\n );\n};\n\nconst DropdownIndicatorComponent: typeof components.DropdownIndicator = (\n props,\n) => {\n // @ts-expect-error data-testid is not a default prop\n\n const testId = props?.selectProps['data-testid'] as string;\n return (\n <div data-testid={`${testId}_select_dropdown`}>\n {}\n <components.DropdownIndicator {...props} />\n </div>\n );\n};\n\n/** Select component based on [HeroUI Select](https://www.heroui.com//docs/components/select) and [React-Select](https://react-select.com/home) */\nconst Select = ({\n className = undefined,\n clearable = true,\n filterOption = undefined,\n renderOptionLabel = undefined,\n inputValue = undefined,\n loading = false,\n multiSelect = false,\n name,\n onInputChange = undefined,\n options,\n placeholder = undefined,\n selectedOptionFallback = undefined,\n ...uniformFieldProps\n}: SelectProps) => {\n const {\n ariaLabel,\n disabled,\n errorMessage,\n field: { onBlur, onChange, ref, value },\n getErrorMessageProps,\n getHelperWrapperProps,\n getLabelProps,\n invalid,\n label,\n required,\n testId,\n } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n // Get getFieldState to check isTouched in onChange callback\n const { getFieldState } = useFormContext();\n\n // Track if the select is focused\n const [isFocused, setIsFocused] = useState(false);\n\n // Create converter to preserve number types for option values\n const { convertToOriginalType } = createOptionValueConverter(options);\n\n // classNames from slots\n const variants = selectVariants();\n const classNames = variantsToClassNames(variants, className, 'base');\n\n // React-select classNames configuration\n const reactSelectClassNames = {\n clearIndicator: () => {\n return classNames.clearIndicator;\n },\n control: () => {\n return cn(classNames.control, {\n [classNames.control_focused]: isFocused && !invalid,\n });\n },\n dropdownIndicator: () => {\n return classNames.dropdownIndicator;\n },\n groupHeading: () => {\n return classNames.groupHeading;\n },\n indicatorSeparator: () => {\n return classNames.indicatorSeparator;\n },\n indicatorsContainer: () => {\n return classNames.indicatorsContainer;\n },\n input: () => {\n return classNames.input;\n },\n loadingIndicator: () => {\n return classNames.loadingIndicator;\n },\n loadingMessage: () => {\n return classNames.loadingMessage;\n },\n menu: () => {\n return classNames.menu;\n },\n menuList: () => {\n return classNames.menuList;\n },\n menuPortal: () => {\n return classNames.menuPortal;\n },\n multiValue: () => {\n return classNames.multiValue;\n },\n multiValueLabel: () => {\n return cn(classNames.multiValueLabel, `${getValueProps().className}`);\n },\n multiValueRemove: () => {\n return classNames.multiValueRemove;\n },\n noOptionsMessage: () => {\n return classNames.noOptionsMessage;\n },\n option: ({\n isFocused: optionIsFocused,\n isSelected: optionIsSelected,\n }: {\n isFocused: boolean;\n isSelected: boolean;\n }) => {\n return cn(classNames.option, {\n [classNames.option_focused]: optionIsFocused,\n [classNames.option_selected]: optionIsSelected,\n });\n },\n placeholder: () => {\n return classNames.placeholder;\n },\n singleValue: () => {\n return cn(classNames.singleValue, `${getValueProps().className}`);\n },\n valueContainer: () => {\n return classNames.valueContainer;\n },\n };\n\n const { getBaseProps, getTriggerProps, getValueProps } = useSelect({\n children: [],\n classNames,\n errorMessage,\n isDisabled: disabled,\n isInvalid: invalid,\n isLoading: loading,\n isRequired: required,\n label,\n labelPlacement: 'outside',\n });\n\n // Compute selected option(s) for react-select\n //\n // Priority for finding options:\n // 1. Look in current options list\n // 2. Use selectedOptionFallback prop (for async selects with pre-fetched data)\n // 3. Create fallback with value as label\n //\n // Handles edge cases:\n // - Compares as strings to support both string and number values\n // - Returns null for empty single-select (required by react-select to clear)\n // - Creates fallback options when value exists but isn't in options list\n // (common with async selects where options change after selection)\n const reactSelectValue = (() => {\n // Helper to find option by value\n const findOption = (v: string | number): SelectOption => {\n // First, look in options list\n const inOptions = options.find((option) => {\n return String(option.value) === String(v);\n });\n if (inOptions) {\n return inOptions;\n }\n\n // Second, look in selectedOptionFallback prop (for async selects)\n if (selectedOptionFallback) {\n if (Array.isArray(selectedOptionFallback)) {\n const inSelected = selectedOptionFallback.find((option) => {\n return String(option.value) === String(v);\n });\n if (inSelected) {\n return inSelected;\n }\n } else if (String(selectedOptionFallback.value) === String(v)) {\n return selectedOptionFallback;\n }\n }\n\n // Fallback: create option with value as label, marked as fallback\n return { isFallback: true, label: String(v), value: v };\n };\n\n if (multiSelect) {\n if (!Array.isArray(value) || isValueEmpty(value)) {\n return [];\n }\n return value.map((v) => {\n return findOption(v);\n });\n }\n\n // Single select - use isValueEmpty to handle marker strings (__NULL__, etc.)\n if (isValueEmpty(value)) {\n return null;\n }\n return findOption(value);\n })();\n\n // Handle selection change\n const handleChange = (\n option: MultiValue<SelectOption> | SingleValue<SelectOption>,\n ) => {\n if (multiSelect) {\n onChange(\n (option as SelectOption[])?.map((_option) => {\n return convertToOriginalType(_option.value);\n }),\n );\n } else {\n const newValue = (option as SelectOption)?.value;\n // Pass null explicitly when clearing (not undefined)\n onChange(newValue != null ? convertToOriginalType(newValue) : null);\n }\n // Mark field as touched immediately when a selection is made if not already touched\n // This ensures validation errors show right away (isTouched becomes true)\n // For Select components, selecting an option is a complete user action\n // (unlike text inputs where typing is ongoing), so we mark as touched immediately\n const { isTouched: currentIsTouched } = getFieldState(name, testId);\n if (!currentIsTouched) {\n onBlur();\n }\n };\n\n // Handle blur event\n const handleBlur = () => {\n setIsFocused(false);\n onBlur();\n };\n\n // Handle focus event\n const handleFocus = () => {\n setIsFocused(true);\n };\n\n return (\n <div\n {...getBaseProps()}\n className={cn(classNames.base)}\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-required={required}\n data-testid={`${testId}_wrapper`}\n >\n {label ? (\n <label\n className={classNames.label}\n data-slot=\"label\"\n htmlFor={`react-select-${name}-input`}\n id={getLabelProps().id}\n >\n {label}\n </label>\n ) : null}\n <ReactSelect\n ref={ref}\n menuShouldBlockScroll\n unstyled\n aria-errormessage=\"\"\n aria-invalid={invalid}\n // set aria-labelledby to the label id so that the select is accessible\n aria-label={ariaLabel}\n classNames={reactSelectClassNames}\n // Does not affect the testId of the select, but is needed to pass it to sub-components\n data-testid={testId}\n filterOption={filterOption}\n formatOptionLabel={renderOptionLabel}\n inputValue={inputValue}\n instanceId={name}\n isClearable={clearable}\n isDisabled={disabled}\n isLoading={loading}\n isMulti={multiSelect}\n // set menuPosition to fixed so that menu can be rendered\n // inside Card / Modal components, menuShouldBlockScroll\n // prevents container scroll when menu is open\n menuPosition=\"fixed\"\n name={name}\n onBlur={handleBlur}\n onChange={handleChange}\n onFocus={handleFocus}\n onInputChange={onInputChange}\n options={options}\n placeholder={placeholder}\n value={reactSelectValue}\n // set aria-labelledby to the label id so that the select is accessible\n aria-labelledby={\n label\n ? getTriggerProps()['aria-labelledby']?.split(' ')[1]\n : undefined\n }\n components={{\n Control: ControlComponent,\n DropdownIndicator: DropdownIndicatorComponent,\n Input: InputComponent,\n Option: OptionComponent,\n }}\n />\n {invalid ? (\n <div {...getHelperWrapperProps()}>\n <div {...getErrorMessageProps()}>{errorMessage}</div>\n </div>\n ) : null}\n </div>\n );\n};\n\nexport default Select;\n","import Select from './Select';\n\nexport type { SelectProps } from './Select';\n\nexport { Select };\n\nexport default Select;\n"],"mappings":";;;;;;;;;;;;AAeA,MAAa,gDAAoB,EAC/B,OAAO;CACL,MAAM;CACN,gBACE;CACF,SACE;CACF,iBAAiB;CACjB,WAAW;CACX,aAAa;CACb,mBACE;CACF,OAAO;CACP,cAAc;CACd,qBAAqB;CACrB,oBAAoB;CACpB,OAAO;CAGP,OACE;CACF,kBAAkB;CAClB,gBAAgB;CAChB,MAAM;CACN,UAAU;CAGV,YAAY;CACZ,YAAY;CACZ,qBAAqB;CACrB,iBAAiB;CACjB,kBACE;CACF,kBAAkB;CAClB,gBAAgB;CAChB,iBAAiB;CACjB,QAAQ;CACR,aAAa;CACb,iBAAiB;CACjB,aAAa;CACb,gBAAgB;CACjB,EACF,CAAC;AA4DF,MAAM,kBAA2C,UAAU;CAGzD,MAAM,SAAS,GAAG,MAAM,YAAY;AAEpC,QAAO,2CAACA,wBAAW;EAAM,eAAa;EAAQ,GAAI;GAAS;;AAG7D,MAAM,oBAA+C,UAAU;CAG7D,MAAM,SAAS,GAAG,MAAM,YAAY,eAAe;AACnD,QACE,2CAAC;EAAI,eAAa;YAEhB,2CAACA,wBAAW,WAAQ,GAAI,QAAS;GAC7B;;AAIV,MAAM,mBAA6C,UAAU;CAG3D,MAAM,SAAS,GAAG,MAAM,YAAY,eAAe,qDAAyB,OAAO,OAAO,MAAM,UAAU,OAAO,MAAM,MAAM,EAAE,EAAE,aAAa,MAAM,CAAC;AACrJ,QACE,2CAAC;E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I,YACF,UACG,QAA2B,KAAK,YAAY;AAC3C,UAAO,sBAAsB,QAAQ,MAAM;IAC3C,CACH;OACI;GACL,MAAM,WAAY,QAAyB;AAE3C,YAAS,YAAY,OAAO,sBAAsB,SAAS,GAAG,KAAK;;EAMrE,MAAM,EAAE,WAAW,qBAAqB,cAAc,MAAM,OAAO;AACnE,MAAI,CAAC,iBACH,SAAQ;;CAKZ,MAAM,mBAAmB;AACvB,eAAa,MAAM;AACnB,UAAQ;;CAIV,MAAM,oBAAoB;AACxB,eAAa,KAAK;;AAGpB,QACE,4CAAC;EACC,GAAI,cAAc;EAClB,0CAAc,WAAW,KAAK;EAG9B,iBAAe;EACf,eAAa,GAAG,OAAO;;GAEtB,QACC,2CAAC;IACC,WAAW,WAAW;IACtB,aAAU;IACV,SAAS,gBAAgB,KAAK;IAC9B,IAAI,eAAe,CAAC;cAEnB;KACK,GACN;GACJ,2CAACC;IACM;IACL;IACA;IACA,qBAAkB;IAClB,gBAAc;IAEd,cAAY;IACZ,YAAY;IAEZ,eAAa;IACC;IACd,mBAAmB;IACP;IACZ,YAAY;IACZ,aAAa;IACb,YAAY;IACZ,WAAW;IACX,SAAS;IAIT,cAAa;IACP;IACN,QAAQ;IACR,UAAU;IACV,SAAS;IACM;IACN;IACI;IACb,OAAO;IAEP,mBACE,QACI,iBAAiB,CAAC,oBAAoB,MAAM,IAAI,CAAC,KACjD;IAEN,YAAY;KACV,SAAS;KACT,mBAAmB;KACnB,OAAO;KACP,QAAQ;KACT;KACD;GACD,UACC,2CAAC;IAAI,GAAI,uBAAuB;cAC9B,2CAAC;KAAI,GAAI,sBAAsB;eAAG;MAAmB;KACjD,GACJ;;GACA;;AAIV,uBAAe;;;;ACvcf,qBAAeC"}
|
|
1
|
+
{"version":3,"file":"Select-DH_YaruM.cjs","names":["components","useUniformField","useFormContext","createOptionValueConverter","isValueEmpty","ReactSelect","Select"],"sources":["../src/Select/Select.tsx","../src/Select/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { ReactNode } from 'react';\nimport type { MultiValue, Props, SingleValue } from 'react-select';\n\nimport { useState } from 'react';\nimport ReactSelect, { components } from 'react-select';\n\nimport { useSelect } from '@heroui/select';\n\nimport { cn, slugify, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { createOptionValueConverter, isValueEmpty } from '../helpers';\nimport { useFormContext } from '../hooks/useFormContext';\nimport { useUniformField } from '../hooks/useUniformField';\n\nexport const selectVariants = tv({\n slots: {\n base: 'group leading-normal',\n clearIndicator:\n 'rounded-md p-1 text-foreground-500 hover:cursor-pointer hover:bg-default-200 hover:text-foreground-800',\n control:\n 'duration-150! rounded-lg border-2 border-default-200 bg-content1 transition-background hover:border-default-400 group-data-[invalid=true]:border-danger group-data-[invalid=true]:hover:border-danger motion-reduce:transition-none',\n control_focused: 'border-focus',\n crossIcon: '',\n downChevron: '',\n dropdownIndicator:\n 'rounded-md p-1 text-foreground-500 hover:cursor-pointer hover:bg-default-200 hover:text-black',\n group: '',\n groupHeading: 'mb-1 ml-3 mt-2 text-sm text-foreground-500',\n indicatorsContainer: 'gap-1 p-1',\n indicatorSeparator: 'bg-default-300',\n input: 'py-0.5 pl-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 'pointer-events-auto relative bottom-1.5 ml-1 subpixel-antialiased text-small 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 loadingIndicator: '',\n loadingMessage: 'rounded-sm p-2 text-foreground-500',\n menu: 'mt-2 rounded-xl border border-default-200 bg-content1 p-1 shadow-lg',\n menuList: '',\n // ensure menu has same z-index as modal so it is visible when rendered in modal\n // see: https://github.com/heroui-inc/heroui/blob/main/packages/core/theme/src/components/modal.ts (see z-50)\n menuPortal: 'z-50!',\n multiValue: 'items-center gap-1.5 rounded bg-default-100 py-0.5 pl-2 pr-1',\n multiValueContainer: '',\n multiValueLabel: 'py-0.5 leading-6',\n multiValueRemove:\n 'rounded text-default-500 hover:cursor-pointer hover:border-default-300 hover:text-default-800',\n noOptionsMessage: 'rounded-sm p-2 text-foreground-500',\n option_focused: 'bg-default-100 active:bg-default-200',\n option_selected: 'bg-default-300',\n option: 'rounded px-3 py-2 hover:cursor-pointer',\n placeholder: 'ml-1 py-0.5 pl-1 text-sm text-foreground-500',\n selectContainer: '',\n singleValue: 'ml-1! leading-7!',\n valueContainer: 'gap-1 p-1',\n },\n});\n\ninterface SelectOption {\n /**\n * True when option was auto-generated because the value wasn't found in options.\n * Use in renderOptionLabel to render a component that fetches the real label.\n */\n isFallback?: boolean;\n /** option label */\n label?: ReactNode;\n /** option value */\n value: string | number;\n}\n\ntype VariantProps = TVProps<typeof selectVariants>;\ntype ClassName = TVClassName<typeof selectVariants>;\n\nexport interface SelectProps 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; // string;\n /** Determine if the */\n clearable?: boolean;\n /** Set the select to disabled state. */\n disabled?: boolean;\n /** Filter Select Options */\n filterOption?:\n | undefined\n | ((option?: SelectOption, inputValue?: string) => boolean);\n /** Format the label of the option */\n renderOptionLabel?: undefined | Props['formatOptionLabel'];\n /** The value of the search input */\n inputValue?: string;\n /** Label that should be associated with the select. */\n label?: ReactNode;\n /** Set the select to a loading state. */\n loading?: boolean;\n /** switch between single and multi select mode. */\n multiSelect?: boolean;\n /** The name for the Select component, used by react-hook-form */\n name: string;\n /** Placeholder that is displayed when nothing is selected */\n placeholder?: string;\n /** The options for the Select component */\n options: SelectOption[];\n /** Handle change events on the input */\n onInputChange?: Props['onInputChange'];\n /**\n * Fallback option(s) for async selects when value isn't in current options.\n * Use when the selected value may not be in the options list (e.g., after\n * search results change). Used only if value not found in options.\n * For single select: pass the option object or undefined\n * For multi-select: pass an array of option objects\n */\n selectedOptionFallback?: SelectOption | SelectOption[];\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\nconst InputComponent: typeof components.Input = (props) => {\n // @ts-expect-error data-testid is not a default prop\n // eslint-disable-next-line react/destructuring-assignment\n const testId = `${props.selectProps['data-testid']}`;\n\n return <components.Input data-testid={testId} {...props} />;\n};\n\nconst ControlComponent: typeof components.Control = (props) => {\n // @ts-expect-error data-testid is not a default prop\n // eslint-disable-next-line react/destructuring-assignment\n const testId = `${props.selectProps['data-testid']}_select`;\n return (\n <div data-testid={testId}>\n {}\n <components.Control {...props} />\n </div>\n );\n};\n\nconst OptionComponent: typeof components.Option = (props) => {\n // @ts-expect-error data-testid is not a default prop\n // eslint-disable-next-line react/destructuring-assignment\n const testId = `${props.selectProps['data-testid']}_select_option_${slugify(String(props?.data?.testId ?? props?.data?.value), { replaceDots: true })}`;\n return (\n <div data-testid={testId}>\n {}\n <components.Option {...props} />\n </div>\n );\n};\n\nconst DropdownIndicatorComponent: typeof components.DropdownIndicator = (\n props,\n) => {\n // @ts-expect-error data-testid is not a default prop\n\n const testId = props?.selectProps['data-testid'] as string;\n return (\n <div data-testid={`${testId}_select_dropdown`}>\n {}\n <components.DropdownIndicator {...props} />\n </div>\n );\n};\n\n/** Select component based on [HeroUI Select](https://www.heroui.com//docs/components/select) and [React-Select](https://react-select.com/home) */\nconst Select = ({\n className = undefined,\n clearable = true,\n filterOption = undefined,\n renderOptionLabel = undefined,\n inputValue = undefined,\n loading = false,\n multiSelect = false,\n name,\n onInputChange = undefined,\n options,\n placeholder = undefined,\n selectedOptionFallback = undefined,\n ...uniformFieldProps\n}: SelectProps) => {\n const {\n ariaLabel,\n disabled,\n errorMessage,\n field: { onBlur, onChange, ref, value },\n getErrorMessageProps,\n getHelperWrapperProps,\n getLabelProps,\n invalid,\n label,\n required,\n testId,\n } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n // Get getFieldState to check isTouched in onChange callback\n const { getFieldState } = useFormContext();\n\n // Track if the select is focused\n const [isFocused, setIsFocused] = useState(false);\n\n // Create converter to preserve number types for option values\n const { convertToOriginalType } = createOptionValueConverter(options);\n\n // classNames from slots\n const variants = selectVariants();\n const classNames = variantsToClassNames(variants, className, 'base');\n\n // React-select classNames configuration\n const reactSelectClassNames = {\n clearIndicator: () => {\n return classNames.clearIndicator;\n },\n control: () => {\n return cn(classNames.control, {\n [classNames.control_focused]: isFocused && !invalid,\n });\n },\n dropdownIndicator: () => {\n return classNames.dropdownIndicator;\n },\n groupHeading: () => {\n return classNames.groupHeading;\n },\n indicatorSeparator: () => {\n return classNames.indicatorSeparator;\n },\n indicatorsContainer: () => {\n return classNames.indicatorsContainer;\n },\n input: () => {\n return classNames.input;\n },\n loadingIndicator: () => {\n return classNames.loadingIndicator;\n },\n loadingMessage: () => {\n return classNames.loadingMessage;\n },\n menu: () => {\n return classNames.menu;\n },\n menuList: () => {\n return classNames.menuList;\n },\n menuPortal: () => {\n return classNames.menuPortal;\n },\n multiValue: () => {\n return classNames.multiValue;\n },\n multiValueLabel: () => {\n return cn(classNames.multiValueLabel, `${getValueProps().className}`);\n },\n multiValueRemove: () => {\n return classNames.multiValueRemove;\n },\n noOptionsMessage: () => {\n return classNames.noOptionsMessage;\n },\n option: ({\n isFocused: optionIsFocused,\n isSelected: optionIsSelected,\n }: {\n isFocused: boolean;\n isSelected: boolean;\n }) => {\n return cn(classNames.option, {\n [classNames.option_focused]: optionIsFocused,\n [classNames.option_selected]: optionIsSelected,\n });\n },\n placeholder: () => {\n return classNames.placeholder;\n },\n singleValue: () => {\n return cn(classNames.singleValue, `${getValueProps().className}`);\n },\n valueContainer: () => {\n return classNames.valueContainer;\n },\n };\n\n const { getBaseProps, getTriggerProps, getValueProps } = useSelect({\n children: [],\n classNames,\n errorMessage,\n isDisabled: disabled,\n isInvalid: invalid,\n isLoading: loading,\n isRequired: required,\n label,\n labelPlacement: 'outside',\n });\n\n // Compute selected option(s) for react-select\n //\n // Priority for finding options:\n // 1. Look in current options list\n // 2. Use selectedOptionFallback prop (for async selects with pre-fetched data)\n // 3. Create fallback with value as label\n //\n // Handles edge cases:\n // - Compares as strings to support both string and number values\n // - Returns null for empty single-select (required by react-select to clear)\n // - Creates fallback options when value exists but isn't in options list\n // (common with async selects where options change after selection)\n const reactSelectValue = (() => {\n // Helper to find option by value\n const findOption = (v: string | number): SelectOption => {\n // First, look in options list\n const inOptions = options.find((option) => {\n return String(option.value) === String(v);\n });\n if (inOptions) {\n return inOptions;\n }\n\n // Second, look in selectedOptionFallback prop (for async selects)\n if (selectedOptionFallback) {\n if (Array.isArray(selectedOptionFallback)) {\n const inSelected = selectedOptionFallback.find((option) => {\n return String(option.value) === String(v);\n });\n if (inSelected) {\n return inSelected;\n }\n } else if (String(selectedOptionFallback.value) === String(v)) {\n return selectedOptionFallback;\n }\n }\n\n // Fallback: create option with value as label, marked as fallback\n return { isFallback: true, label: String(v), value: v };\n };\n\n if (multiSelect) {\n if (!Array.isArray(value) || isValueEmpty(value)) {\n return [];\n }\n return value.map((v) => {\n return findOption(v);\n });\n }\n\n // Single select - use isValueEmpty to handle marker strings (__NULL__, etc.)\n if (isValueEmpty(value)) {\n return null;\n }\n return findOption(value);\n })();\n\n // Handle selection change\n const handleChange = (\n option: MultiValue<SelectOption> | SingleValue<SelectOption>,\n ) => {\n if (multiSelect) {\n onChange(\n (option as SelectOption[])?.map((_option) => {\n return convertToOriginalType(_option.value);\n }),\n );\n } else {\n const newValue = (option as SelectOption)?.value;\n // Pass null explicitly when clearing (not undefined)\n onChange(newValue != null ? convertToOriginalType(newValue) : null);\n }\n // Mark field as touched immediately when a selection is made if not already touched\n // This ensures validation errors show right away (isTouched becomes true)\n // For Select components, selecting an option is a complete user action\n // (unlike text inputs where typing is ongoing), so we mark as touched immediately\n const { isTouched: currentIsTouched } = getFieldState(name, testId);\n if (!currentIsTouched) {\n onBlur();\n }\n };\n\n // Handle blur event\n const handleBlur = () => {\n setIsFocused(false);\n onBlur();\n };\n\n // Handle focus event\n const handleFocus = () => {\n setIsFocused(true);\n };\n\n return (\n <div\n {...getBaseProps()}\n className={cn(classNames.base)}\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-required={required}\n data-testid={`${testId}_wrapper`}\n >\n {label ? (\n <label\n className={classNames.label}\n data-slot=\"label\"\n htmlFor={`react-select-${name}-input`}\n id={getLabelProps().id}\n >\n {label}\n </label>\n ) : null}\n <ReactSelect\n ref={ref}\n menuShouldBlockScroll\n unstyled\n aria-errormessage=\"\"\n aria-invalid={invalid}\n // set aria-labelledby to the label id so that the select is accessible\n aria-label={ariaLabel}\n classNames={reactSelectClassNames}\n // Does not affect the testId of the select, but is needed to pass it to sub-components\n data-testid={testId}\n filterOption={filterOption}\n formatOptionLabel={renderOptionLabel}\n inputValue={inputValue}\n instanceId={name}\n isClearable={clearable}\n isDisabled={disabled}\n isLoading={loading}\n isMulti={multiSelect}\n // set menuPosition to fixed so that menu can be rendered\n // inside Card / Modal components, menuShouldBlockScroll\n // prevents container scroll when menu is open\n menuPosition=\"fixed\"\n name={name}\n onBlur={handleBlur}\n onChange={handleChange}\n onFocus={handleFocus}\n onInputChange={onInputChange}\n options={options}\n placeholder={placeholder}\n value={reactSelectValue}\n // set aria-labelledby to the label id so that the select is accessible\n aria-labelledby={\n label\n ? getTriggerProps()['aria-labelledby']?.split(' ')[1]\n : undefined\n }\n components={{\n Control: ControlComponent,\n DropdownIndicator: DropdownIndicatorComponent,\n Input: InputComponent,\n Option: OptionComponent,\n }}\n />\n {invalid ? (\n <div {...getHelperWrapperProps()}>\n <div {...getErrorMessageProps()}>{errorMessage}</div>\n </div>\n ) : null}\n </div>\n );\n};\n\nexport default Select;\n","import Select from './Select';\n\nexport type { SelectProps } from './Select';\n\nexport { Select };\n\nexport default Select;\n"],"mappings":";;;;;;;;;;;;AAeA,MAAa,gDAAoB,EAC/B,OAAO;CACL,MAAM;CACN,gBACE;CACF,SACE;CACF,iBAAi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EtB,QACC,2CAAC;IACC,WAAW,WAAW;IACtB,aAAU;IACV,SAAS,gBAAgB,KAAK;IAC9B,IAAI,eAAe,CAAC;cAEnB;KACK,GACN;GACJ,2CAACC;IACM;IACL;IACA;IACA,qBAAkB;IAClB,gBAAc;IAEd,cAAY;IACZ,YAAY;IAEZ,eAAa;IACC;IACd,mBAAmB;IACP;IACZ,YAAY;IACZ,aAAa;IACb,YAAY;IACZ,WAAW;IACX,SAAS;IAIT,cAAa;IACP;IACN,QAAQ;IACR,UAAU;IACV,SAAS;IACM;IACN;IACI;IACb,OAAO;IAEP,mBACE,QACI,iBAAiB,CAAC,oBAAoB,MAAM,IAAI,CAAC,KACjD;IAEN,YAAY;KACV,SAAS;KACT,mBAAmB;KACnB,OAAO;KACP,QAAQ;KACT;KACD;GACD,UACC,2CAAC;IAAI,GAAI,uBAAuB;cAC9B,2CAAC;KAAI,GAAI,sBAAsB;eAAG;MAAmB;KACjD,GACJ;;GACA;;AAIV,uBAAe;;;;ACvcf,qBAAeC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as useFormContext } from "./useFormContext-
|
|
3
|
-
import { t as useUniformField } from "./useUniformField-
|
|
1
|
+
import { l as createOptionValueConverter, r as isValueEmpty } from "./helpers-33jajRcN.js";
|
|
2
|
+
import { n as useFormContext } from "./useFormContext-Di67HIf7.js";
|
|
3
|
+
import { t as useUniformField } from "./useUniformField-C-Xyu-8v.js";
|
|
4
4
|
import { cn, slugify, tv, variantsToClassNames } from "@fuf-stack/pixel-utils";
|
|
5
5
|
import { useState } from "react";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -266,4 +266,4 @@ var Select_default = Select_default$1;
|
|
|
266
266
|
|
|
267
267
|
//#endregion
|
|
268
268
|
export { Select_default$1 as n, Select_default as t };
|
|
269
|
-
//# sourceMappingURL=Select-
|
|
269
|
+
//# sourceMappingURL=Select-DlEUzYl6.js.map
|