@fuf-stack/uniform 1.22.5 → 1.22.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Checkboxes/index.cjs +113 -4
- package/dist/Checkboxes/index.cjs.map +1 -0
- package/dist/Checkboxes/index.d.cts +534 -2
- package/dist/Checkboxes/index.d.cts.map +1 -0
- package/dist/Checkboxes/index.d.ts +534 -2
- package/dist/Checkboxes/index.d.ts.map +1 -0
- package/dist/Checkboxes/index.js +112 -2
- package/dist/Checkboxes/index.js.map +1 -0
- package/dist/DatePicker/index.cjs +194 -4
- package/dist/DatePicker/index.cjs.map +1 -0
- package/dist/DatePicker/index.d.cts +1413 -2
- package/dist/{index-D7AUghFx.d.ts.map → DatePicker/index.d.cts.map} +1 -1
- package/dist/DatePicker/index.d.ts +1413 -2
- package/dist/{index-CD0Wpla3.d.cts.map → DatePicker/index.d.ts.map} +1 -1
- package/dist/DatePicker/index.js +193 -2
- package/dist/DatePicker/index.js.map +1 -0
- package/dist/FieldArray/index.cjs +495 -4
- package/dist/FieldArray/index.cjs.map +1 -0
- package/dist/FieldArray/index.d.cts +539 -2
- package/dist/{index-B4XExHDi.d.cts.map → FieldArray/index.d.cts.map} +1 -1
- package/dist/FieldArray/index.d.ts +539 -2
- package/dist/{index-yYjVSHlN.d.ts.map → FieldArray/index.d.ts.map} +1 -1
- package/dist/FieldArray/index.js +494 -2
- package/dist/FieldArray/index.js.map +1 -0
- package/dist/FieldCard/index.cjs +226 -4
- package/dist/FieldCard/index.cjs.map +1 -0
- package/dist/FieldCard/index.d.cts +314 -2
- package/dist/FieldCard/index.d.cts.map +1 -0
- package/dist/FieldCard/index.d.ts +314 -2
- package/dist/FieldCard/index.d.ts.map +1 -0
- package/dist/FieldCard/index.js +225 -2
- package/dist/FieldCard/index.js.map +1 -0
- package/dist/{FieldCopyTestIdButton-Dpmo0uBV.js → FieldCopyTestIdButton-CRJBix9D.js} +2 -2
- package/dist/{FieldCopyTestIdButton-Dpmo0uBV.js.map → FieldCopyTestIdButton-CRJBix9D.js.map} +1 -1
- package/dist/{FieldCopyTestIdButton-ptoB1F75.cjs → FieldCopyTestIdButton-D3D_LmJh.cjs} +1 -8
- package/dist/{FieldCopyTestIdButton-ptoB1F75.cjs.map → FieldCopyTestIdButton-D3D_LmJh.cjs.map} +1 -1
- package/dist/{FieldValidationError-ktTyyyip.js → FieldValidationError-ByRoIxaM.js} +5 -5
- package/dist/{FieldValidationError-ktTyyyip.js.map → FieldValidationError-ByRoIxaM.js.map} +1 -1
- package/dist/{FieldValidationError-BQcvvU9i.cjs → FieldValidationError-CfYKzl7P.cjs} +5 -6
- package/dist/{FieldValidationError-BQcvvU9i.cjs.map → FieldValidationError-CfYKzl7P.cjs.map} +1 -1
- package/dist/Form/index.cjs +122 -3
- package/dist/Form/index.cjs.map +1 -0
- package/dist/Form/index.d.cts +43 -2
- package/dist/Form/index.d.cts.map +1 -0
- package/dist/Form/index.d.ts +43 -2
- package/dist/Form/index.d.ts.map +1 -0
- package/dist/Form/index.js +122 -2
- package/dist/Form/index.js.map +1 -0
- package/dist/{FormContext-3kamRn2C.d.cts → FormContext-BLWS7bhO.d.cts} +1 -1
- package/dist/{FormContext-3kamRn2C.d.cts.map → FormContext-BLWS7bhO.d.cts.map} +1 -1
- package/dist/{FormContext-BQeKOV-0.js → FormContext-DjJOJKxj.js} +1 -1
- package/dist/{FormContext-BQeKOV-0.js.map → FormContext-DjJOJKxj.js.map} +1 -1
- package/dist/{FormContext-DsmS_mkO.cjs → FormContext-EGH0cVnH.cjs} +1 -1
- package/dist/{FormContext-DsmS_mkO.cjs.map → FormContext-EGH0cVnH.cjs.map} +1 -1
- package/dist/{FormContext-i66vM5f1.d.ts → FormContext-LgzrDWu1.d.ts} +1 -1
- package/dist/{FormContext-i66vM5f1.d.ts.map → FormContext-LgzrDWu1.d.ts.map} +1 -1
- package/dist/Grid/index.cjs +1 -2
- package/dist/Grid/index.d.cts +22 -2
- package/dist/Grid/index.d.cts.map +1 -0
- package/dist/Grid/index.d.ts +22 -2
- package/dist/Grid/index.d.ts.map +1 -0
- package/dist/Grid/index.js +2 -2
- package/dist/{Grid-D-VcRGi9.cjs → Grid-BbqCRkuY.cjs} +1 -8
- package/dist/{Grid-D-VcRGi9.cjs.map → Grid-BbqCRkuY.cjs.map} +1 -1
- package/dist/{Grid-BQpLOB0G.js → Grid-CTs-Rb9G.js} +2 -2
- package/dist/{Grid-BQpLOB0G.js.map → Grid-CTs-Rb9G.js.map} +1 -1
- package/dist/Input/index.cjs +96 -3
- package/dist/Input/index.cjs.map +1 -0
- package/dist/Input/index.d.cts +677 -2
- package/dist/Input/index.d.cts.map +1 -0
- package/dist/Input/index.d.ts +677 -2
- package/dist/Input/index.d.ts.map +1 -0
- package/dist/Input/index.js +96 -2
- package/dist/Input/index.js.map +1 -0
- package/dist/RadioBoxes/index.cjs +136 -4
- package/dist/RadioBoxes/index.cjs.map +1 -0
- package/dist/RadioBoxes/index.d.cts +1477 -2
- package/dist/RadioBoxes/index.d.cts.map +1 -0
- package/dist/RadioBoxes/index.d.ts +1477 -2
- package/dist/RadioBoxes/index.d.ts.map +1 -0
- package/dist/RadioBoxes/index.js +135 -2
- package/dist/RadioBoxes/index.js.map +1 -0
- package/dist/RadioTabs/index.cjs +123 -4
- package/dist/RadioTabs/index.cjs.map +1 -0
- package/dist/RadioTabs/index.d.cts +585 -2
- package/dist/RadioTabs/index.d.cts.map +1 -0
- package/dist/RadioTabs/index.d.ts +585 -2
- package/dist/RadioTabs/index.d.ts.map +1 -0
- package/dist/RadioTabs/index.js +120 -2
- package/dist/RadioTabs/index.js.map +1 -0
- package/dist/Radios/index.cjs +74 -4
- package/dist/Radios/index.cjs.map +1 -0
- package/dist/Radios/index.d.cts +1263 -2
- package/dist/{index-DCwffq1f.d.ts.map → Radios/index.d.cts.map} +1 -1
- package/dist/Radios/index.d.ts +1263 -2
- package/dist/{index-CqXEYILn.d.cts.map → Radios/index.d.ts.map} +1 -1
- package/dist/Radios/index.js +73 -2
- package/dist/Radios/index.js.map +1 -0
- package/dist/Select/index.cjs +286 -4
- package/dist/Select/index.cjs.map +1 -0
- package/dist/Select/index.d.cts +3917 -2
- package/dist/{index-D1cB3mbB.d.ts.map → Select/index.d.cts.map} +1 -1
- package/dist/Select/index.d.ts +3917 -2
- package/dist/{index-veBM95Gw.d.cts.map → Select/index.d.ts.map} +1 -1
- package/dist/Select/index.js +283 -2
- package/dist/Select/index.js.map +1 -0
- package/dist/Slider/index.cjs +109 -4
- package/dist/Slider/index.cjs.map +1 -0
- package/dist/Slider/index.d.cts +1760 -2
- package/dist/{index-BUZEnZDm.d.ts.map → Slider/index.d.cts.map} +1 -1
- package/dist/Slider/index.d.ts +1760 -2
- package/dist/{index-Bie3CWyW.d.cts.map → Slider/index.d.ts.map} +1 -1
- package/dist/Slider/index.js +108 -2
- package/dist/Slider/index.js.map +1 -0
- package/dist/SubmitButton/index.cjs +31 -3
- package/dist/SubmitButton/index.cjs.map +1 -0
- package/dist/SubmitButton/index.d.cts +38 -2
- package/dist/SubmitButton/index.d.cts.map +1 -0
- package/dist/SubmitButton/index.d.ts +38 -2
- package/dist/SubmitButton/index.d.ts.map +1 -0
- package/dist/SubmitButton/index.js +31 -2
- package/dist/SubmitButton/index.js.map +1 -0
- package/dist/Switch/index.cjs +82 -4
- package/dist/Switch/index.cjs.map +1 -0
- package/dist/Switch/index.d.cts +1257 -2
- package/dist/{index-DqMpHpu7.d.ts.map → Switch/index.d.cts.map} +1 -1
- package/dist/Switch/index.d.ts +1257 -2
- package/dist/{index-19JGtN7H.d.cts.map → Switch/index.d.ts.map} +1 -1
- package/dist/Switch/index.js +81 -2
- package/dist/Switch/index.js.map +1 -0
- package/dist/SwitchBox/index.cjs +154 -4
- package/dist/SwitchBox/index.cjs.map +1 -0
- package/dist/SwitchBox/index.d.cts +473 -2
- package/dist/SwitchBox/index.d.cts.map +1 -0
- package/dist/SwitchBox/index.d.ts +473 -2
- package/dist/SwitchBox/index.d.ts.map +1 -0
- package/dist/SwitchBox/index.js +153 -2
- package/dist/SwitchBox/index.js.map +1 -0
- package/dist/TextArea/index.cjs +66 -3
- package/dist/TextArea/index.cjs.map +1 -0
- package/dist/TextArea/index.d.cts +659 -2
- package/dist/TextArea/index.d.cts.map +1 -0
- package/dist/TextArea/index.d.ts +659 -2
- package/dist/TextArea/index.d.ts.map +1 -0
- package/dist/TextArea/index.js +66 -2
- package/dist/TextArea/index.js.map +1 -0
- package/dist/Time/index.cjs +217 -4
- package/dist/Time/index.cjs.map +1 -0
- package/dist/Time/index.d.cts +1028 -2
- package/dist/Time/index.d.cts.map +1 -0
- package/dist/Time/index.d.ts +1028 -2
- package/dist/Time/index.d.ts.map +1 -0
- package/dist/Time/index.js +216 -2
- package/dist/Time/index.js.map +1 -0
- package/dist/helpers/index.cjs +0 -1
- package/dist/helpers/index.cjs.map +1 -1
- package/dist/helpers/index.js.map +1 -1
- package/dist/hooks/useClientValidation/index.cjs +177 -3
- package/dist/hooks/useClientValidation/index.cjs.map +1 -1
- package/dist/hooks/useClientValidation/index.d.cts +148 -2
- package/dist/hooks/useClientValidation/index.d.cts.map +1 -0
- package/dist/hooks/useClientValidation/index.d.ts +148 -2
- package/dist/hooks/useClientValidation/index.d.ts.map +1 -0
- package/dist/hooks/useClientValidation/index.js +175 -1
- package/dist/hooks/useClientValidation/index.js.map +1 -1
- package/dist/hooks/useController/index.cjs +1 -1
- package/dist/hooks/useController/index.d.cts +1 -1
- package/dist/hooks/useController/index.d.ts +1 -1
- package/dist/hooks/useController/index.js +1 -1
- package/dist/hooks/useFormContext/index.cjs +1 -1
- package/dist/hooks/useFormContext/index.d.cts +1 -1
- package/dist/hooks/useFormContext/index.d.ts +1 -1
- package/dist/hooks/useFormContext/index.js +1 -1
- package/dist/hooks/useInput/index.cjs +0 -1
- package/dist/hooks/useInput/index.d.cts +1 -1
- package/dist/hooks/useInput/index.d.ts +1 -1
- package/dist/hooks/useInput/index.js +1 -1
- package/dist/hooks/useInputValueDebounce/index.cjs +1 -2
- package/dist/hooks/useInputValueDebounce/index.cjs.map +1 -1
- package/dist/hooks/useInputValueDebounce/index.d.cts +66 -2
- package/dist/hooks/useInputValueDebounce/index.d.cts.map +1 -0
- package/dist/hooks/useInputValueDebounce/index.d.ts +66 -2
- package/dist/hooks/useInputValueDebounce/index.d.ts.map +1 -0
- package/dist/hooks/useInputValueDebounce/index.js +1 -1
- package/dist/hooks/useInputValueTransform/index.cjs +1 -1
- package/dist/hooks/useInputValueTransform/index.d.cts +1 -1
- package/dist/hooks/useInputValueTransform/index.d.ts +1 -1
- package/dist/hooks/useInputValueTransform/index.js +1 -1
- package/dist/hooks/useUniformField/index.cjs +8 -8
- package/dist/hooks/useUniformField/index.cjs.map +1 -1
- package/dist/hooks/useUniformField/index.d.cts +98 -2
- package/dist/hooks/useUniformField/index.d.cts.map +1 -0
- package/dist/hooks/useUniformField/index.d.ts +98 -2
- package/dist/hooks/useUniformField/index.d.ts.map +1 -0
- package/dist/hooks/useUniformField/index.js +8 -8
- package/dist/hooks/useUniformField/index.js.map +1 -1
- package/dist/hooks/useUniformFieldArray/index.cjs +1 -2
- package/dist/hooks/useUniformFieldArray/index.cjs.map +1 -1
- package/dist/hooks/useUniformFieldArray/index.d.cts +79 -2
- package/dist/hooks/useUniformFieldArray/index.d.cts.map +1 -0
- package/dist/hooks/useUniformFieldArray/index.d.ts +79 -2
- package/dist/hooks/useUniformFieldArray/index.d.ts.map +1 -0
- package/dist/hooks/useUniformFieldArray/index.js +1 -1
- package/dist/hooks/useWatchFormReset/index.cjs +1 -2
- package/dist/hooks/useWatchFormReset/index.cjs.map +1 -1
- package/dist/hooks/useWatchFormReset/index.d.cts +38 -2
- package/dist/hooks/useWatchFormReset/index.d.cts.map +1 -0
- package/dist/hooks/useWatchFormReset/index.d.ts +38 -2
- package/dist/hooks/useWatchFormReset/index.d.ts.map +1 -0
- package/dist/hooks/useWatchFormReset/index.js +1 -1
- package/dist/hooks/useWatchUserChange/index.cjs +82 -2
- package/dist/hooks/useWatchUserChange/index.cjs.map +1 -1
- package/dist/hooks/useWatchUserChange/index.d.cts +80 -2
- package/dist/hooks/useWatchUserChange/index.d.cts.map +1 -0
- package/dist/hooks/useWatchUserChange/index.d.ts +80 -2
- package/dist/hooks/useWatchUserChange/index.d.ts.map +1 -0
- package/dist/hooks/useWatchUserChange/index.js +81 -1
- package/dist/hooks/useWatchUserChange/index.js.map +1 -1
- package/dist/partials/FieldCopyTestIdButton/index.cjs +1 -2
- package/dist/partials/FieldCopyTestIdButton/index.d.cts +14 -2
- package/dist/partials/FieldCopyTestIdButton/index.d.cts.map +1 -0
- package/dist/partials/FieldCopyTestIdButton/index.d.ts +14 -2
- package/dist/partials/FieldCopyTestIdButton/index.d.ts.map +1 -0
- package/dist/partials/FieldCopyTestIdButton/index.js +2 -2
- package/dist/partials/FieldValidationError/index.cjs +1 -2
- package/dist/partials/FieldValidationError/index.d.cts +22 -2
- package/dist/partials/FieldValidationError/index.d.cts.map +1 -0
- package/dist/partials/FieldValidationError/index.d.ts +22 -2
- package/dist/partials/FieldValidationError/index.d.ts.map +1 -0
- package/dist/partials/FieldValidationError/index.js +2 -2
- package/dist/{useController-CzP0aVFC.d.ts → useController-CvQqCvFJ.d.ts} +1 -1
- package/dist/{useController-CzP0aVFC.d.ts.map → useController-CvQqCvFJ.d.ts.map} +1 -1
- package/dist/{useController--lRPWBuD.cjs → useController-Dbe7ADG6.cjs} +2 -2
- package/dist/{useController--lRPWBuD.cjs.map → useController-Dbe7ADG6.cjs.map} +1 -1
- package/dist/{useController-B287flU_.js → useController-DxFS0u7c.js} +2 -2
- package/dist/{useController-B287flU_.js.map → useController-DxFS0u7c.js.map} +1 -1
- package/dist/{useController-BT3Fd0IO.d.cts → useController-fblEApv_.d.cts} +1 -1
- package/dist/{useController-BT3Fd0IO.d.cts.map → useController-fblEApv_.d.cts.map} +1 -1
- package/dist/{useFormContext-Bj1gXLt_.d.ts → useFormContext-B1-deU4Z.d.ts} +2 -2
- package/dist/{useFormContext-Bj1gXLt_.d.ts.map → useFormContext-B1-deU4Z.d.ts.map} +1 -1
- package/dist/{useFormContext-CT8H8xIe.js → useFormContext-BJqa1FoT.js} +2 -2
- package/dist/{useFormContext-CT8H8xIe.js.map → useFormContext-BJqa1FoT.js.map} +1 -1
- package/dist/{useFormContext-M94eQfHm.d.cts → useFormContext-D5vrT2sg.d.cts} +2 -2
- package/dist/{useFormContext-M94eQfHm.d.cts.map → useFormContext-D5vrT2sg.d.cts.map} +1 -1
- package/dist/{useFormContext-CrXwNYiB.cjs → useFormContext-kUHonwgu.cjs} +2 -2
- package/dist/{useFormContext-CrXwNYiB.cjs.map → useFormContext-kUHonwgu.cjs.map} +1 -1
- package/dist/{useInputValueTransform-CNCBU7a9.d.cts → useInputValueTransform-DCXXb2Lp.d.cts} +1 -1
- package/dist/{useInputValueTransform-CNCBU7a9.d.cts.map → useInputValueTransform-DCXXb2Lp.d.cts.map} +1 -1
- package/dist/{useInputValueTransform-dLfFIYW4.d.ts → useInputValueTransform-DCXXb2Lp.d.ts} +1 -1
- package/dist/{useInputValueTransform-dLfFIYW4.d.ts.map → useInputValueTransform-DCXXb2Lp.d.ts.map} +1 -1
- package/dist/{useInputValueTransform-CXdmtc0Q.js → useInputValueTransform-DJ5zkqSy.js} +1 -1
- package/dist/{useInputValueTransform-CXdmtc0Q.js.map → useInputValueTransform-DJ5zkqSy.js.map} +1 -1
- package/dist/{useInputValueTransform-Bm65K8LX.cjs → useInputValueTransform-P62UUZBl.cjs} +1 -2
- package/dist/{useInputValueTransform-Bm65K8LX.cjs.map → useInputValueTransform-P62UUZBl.cjs.map} +1 -1
- package/package.json +5 -12
- package/dist/Checkboxes-DrJqx6O2.cjs +0 -130
- package/dist/Checkboxes-DrJqx6O2.cjs.map +0 -1
- package/dist/Checkboxes-X6FRwI50.js +0 -112
- package/dist/Checkboxes-X6FRwI50.js.map +0 -1
- package/dist/DatePicker-CGIWizz9.js +0 -193
- package/dist/DatePicker-CGIWizz9.js.map +0 -1
- package/dist/DatePicker-CYUuwwsm.cjs +0 -211
- package/dist/DatePicker-CYUuwwsm.cjs.map +0 -1
- package/dist/FieldArray-Dkw6JBnT.js +0 -494
- package/dist/FieldArray-Dkw6JBnT.js.map +0 -1
- package/dist/FieldArray-V66fsvtd.cjs +0 -512
- package/dist/FieldArray-V66fsvtd.cjs.map +0 -1
- package/dist/FieldCard-CAHnM8C0.cjs +0 -243
- package/dist/FieldCard-CAHnM8C0.cjs.map +0 -1
- package/dist/FieldCard-Cg31ce9J.js +0 -225
- package/dist/FieldCard-Cg31ce9J.js.map +0 -1
- package/dist/Form-CYlsIABv.cjs +0 -125
- package/dist/Form-CYlsIABv.cjs.map +0 -1
- package/dist/Form-D3yfDu4L.js +0 -114
- package/dist/Form-D3yfDu4L.js.map +0 -1
- package/dist/Input-B5RxbkNS.js +0 -96
- package/dist/Input-B5RxbkNS.js.map +0 -1
- package/dist/Input-DvVViuWH.cjs +0 -108
- package/dist/Input-DvVViuWH.cjs.map +0 -1
- package/dist/RadioBoxes-BmLrbYXt.cjs +0 -153
- package/dist/RadioBoxes-BmLrbYXt.cjs.map +0 -1
- package/dist/RadioBoxes-DWxJBTKR.js +0 -135
- package/dist/RadioBoxes-DWxJBTKR.js.map +0 -1
- package/dist/RadioTabs-14XTbTJU.cjs +0 -139
- package/dist/RadioTabs-14XTbTJU.cjs.map +0 -1
- package/dist/RadioTabs-DAY6MYJI.js +0 -120
- package/dist/RadioTabs-DAY6MYJI.js.map +0 -1
- package/dist/Radios-C938-msm.js +0 -73
- package/dist/Radios-C938-msm.js.map +0 -1
- package/dist/Radios-D_B9Y8s2.cjs +0 -91
- package/dist/Radios-D_B9Y8s2.cjs.map +0 -1
- package/dist/Select-BL6k_e-D.js +0 -283
- package/dist/Select-BL6k_e-D.js.map +0 -1
- package/dist/Select-D66A-hYm.cjs +0 -302
- package/dist/Select-D66A-hYm.cjs.map +0 -1
- package/dist/Slider-ChC2PZNb.cjs +0 -126
- package/dist/Slider-ChC2PZNb.cjs.map +0 -1
- package/dist/Slider-DmEwhC1T.js +0 -108
- package/dist/Slider-DmEwhC1T.js.map +0 -1
- package/dist/SubmitButton-D-wn1PJV.cjs +0 -43
- package/dist/SubmitButton-D-wn1PJV.cjs.map +0 -1
- package/dist/SubmitButton-D6aU7IgC.js +0 -31
- package/dist/SubmitButton-D6aU7IgC.js.map +0 -1
- package/dist/Switch-Ch6_VInV.cjs +0 -99
- package/dist/Switch-Ch6_VInV.cjs.map +0 -1
- package/dist/Switch-DvKRPFcC.js +0 -81
- package/dist/Switch-DvKRPFcC.js.map +0 -1
- package/dist/SwitchBox-BU1XieaZ.js +0 -153
- package/dist/SwitchBox-BU1XieaZ.js.map +0 -1
- package/dist/SwitchBox-Dl-F5y2m.cjs +0 -171
- package/dist/SwitchBox-Dl-F5y2m.cjs.map +0 -1
- package/dist/TextArea-CMXm-kTK.cjs +0 -78
- package/dist/TextArea-CMXm-kTK.cjs.map +0 -1
- package/dist/TextArea-DAg_K-QP.js +0 -66
- package/dist/TextArea-DAg_K-QP.js.map +0 -1
- package/dist/Time-B_SXrKWK.js +0 -216
- package/dist/Time-B_SXrKWK.js.map +0 -1
- package/dist/Time-CYoWaQsz.cjs +0 -234
- package/dist/Time-CYoWaQsz.cjs.map +0 -1
- package/dist/index-19JGtN7H.d.cts +0 -1257
- package/dist/index-54OZEaUU.d.ts +0 -43
- package/dist/index-54OZEaUU.d.ts.map +0 -1
- package/dist/index-B4XExHDi.d.cts +0 -539
- package/dist/index-BUZEnZDm.d.ts +0 -1760
- package/dist/index-Bbaubtxp.d.cts +0 -677
- package/dist/index-Bbaubtxp.d.cts.map +0 -1
- package/dist/index-BdgFJ-dj.d.ts +0 -1028
- package/dist/index-BdgFJ-dj.d.ts.map +0 -1
- package/dist/index-BiZNkLK3.d.cts +0 -1477
- package/dist/index-BiZNkLK3.d.cts.map +0 -1
- package/dist/index-Bie3CWyW.d.cts +0 -1760
- package/dist/index-BqxDWhNr.d.cts +0 -22
- package/dist/index-BqxDWhNr.d.cts.map +0 -1
- package/dist/index-BsTqcI1C.d.cts +0 -659
- package/dist/index-BsTqcI1C.d.cts.map +0 -1
- package/dist/index-C3-TV4Up.d.cts +0 -43
- package/dist/index-C3-TV4Up.d.cts.map +0 -1
- package/dist/index-C6Y8KybK.d.ts +0 -677
- package/dist/index-C6Y8KybK.d.ts.map +0 -1
- package/dist/index-CD0Wpla3.d.cts +0 -1413
- package/dist/index-CEJxjf5R.d.ts +0 -22
- package/dist/index-CEJxjf5R.d.ts.map +0 -1
- package/dist/index-CHQKk_fN2.d.ts +0 -14
- package/dist/index-CHQKk_fN2.d.ts.map +0 -1
- package/dist/index-CUByIf_d.d.ts +0 -314
- package/dist/index-CUByIf_d.d.ts.map +0 -1
- package/dist/index-CV7wqRev.d.ts +0 -38
- package/dist/index-CV7wqRev.d.ts.map +0 -1
- package/dist/index-CXvUaeCL.d.cts +0 -14
- package/dist/index-CXvUaeCL.d.cts.map +0 -1
- package/dist/index-Cf2B9woY.d.cts +0 -473
- package/dist/index-Cf2B9woY.d.cts.map +0 -1
- package/dist/index-CqXEYILn.d.cts +0 -1263
- package/dist/index-D1cB3mbB.d.ts +0 -3917
- package/dist/index-D7AUghFx.d.ts +0 -1413
- package/dist/index-DCwffq1f.d.ts +0 -1263
- package/dist/index-DFbuWomg.d.ts +0 -534
- package/dist/index-DFbuWomg.d.ts.map +0 -1
- package/dist/index-DXOBPBft.d.ts +0 -659
- package/dist/index-DXOBPBft.d.ts.map +0 -1
- package/dist/index-DY-d4cFe.d.cts +0 -1028
- package/dist/index-DY-d4cFe.d.cts.map +0 -1
- package/dist/index-DpXSZCZe.d.cts +0 -38
- package/dist/index-DpXSZCZe.d.cts.map +0 -1
- package/dist/index-DqMpHpu7.d.ts +0 -1257
- package/dist/index-DwnqyNnX.d.cts +0 -534
- package/dist/index-DwnqyNnX.d.cts.map +0 -1
- package/dist/index-OdNTqjhQ.d.ts +0 -585
- package/dist/index-OdNTqjhQ.d.ts.map +0 -1
- package/dist/index-P30z4VRT.d.cts +0 -22
- package/dist/index-P30z4VRT.d.cts.map +0 -1
- package/dist/index-PWRw2bPH.d.ts +0 -22
- package/dist/index-PWRw2bPH.d.ts.map +0 -1
- package/dist/index-QPDvw5Z5.d.cts +0 -585
- package/dist/index-QPDvw5Z5.d.cts.map +0 -1
- package/dist/index-amMd-sQN.d.ts +0 -473
- package/dist/index-amMd-sQN.d.ts.map +0 -1
- package/dist/index-clztdahp.d.ts +0 -1477
- package/dist/index-clztdahp.d.ts.map +0 -1
- package/dist/index-jK092-MJ.d.cts +0 -314
- package/dist/index-jK092-MJ.d.cts.map +0 -1
- package/dist/index-veBM95Gw.d.cts +0 -3917
- package/dist/index-yYjVSHlN.d.ts +0 -539
- package/dist/index.cjs +0 -94
- package/dist/index.cjs.map +0 -1
- package/dist/index.d.cts +0 -31
- package/dist/index.d.ts +0 -31
- package/dist/index.js +0 -36
- package/dist/index.js.map +0 -1
- package/dist/useClientValidation-BRfhqRom.cjs +0 -190
- package/dist/useClientValidation-BRfhqRom.cjs.map +0 -1
- package/dist/useClientValidation-C2dLJnDI.d.cts +0 -148
- package/dist/useClientValidation-C2dLJnDI.d.cts.map +0 -1
- package/dist/useClientValidation-DpLdzIAb.js +0 -178
- package/dist/useClientValidation-DpLdzIAb.js.map +0 -1
- package/dist/useClientValidation-qRq2_spX.d.ts +0 -148
- package/dist/useClientValidation-qRq2_spX.d.ts.map +0 -1
- package/dist/useInputValueDebounce-CfQDiomI.d.cts +0 -66
- package/dist/useInputValueDebounce-CfQDiomI.d.cts.map +0 -1
- package/dist/useInputValueDebounce-DZgzL7GQ.d.ts +0 -66
- package/dist/useInputValueDebounce-DZgzL7GQ.d.ts.map +0 -1
- package/dist/useUniformField-BE-e3C4Y.d.cts +0 -98
- package/dist/useUniformField-BE-e3C4Y.d.cts.map +0 -1
- package/dist/useUniformField-DUW-svZD.d.ts +0 -98
- package/dist/useUniformField-DUW-svZD.d.ts.map +0 -1
- package/dist/useUniformFieldArray-CdWv1SEk.d.ts +0 -79
- package/dist/useUniformFieldArray-CdWv1SEk.d.ts.map +0 -1
- package/dist/useUniformFieldArray-kkOHxNFF.d.cts +0 -79
- package/dist/useUniformFieldArray-kkOHxNFF.d.cts.map +0 -1
- package/dist/useWatchFormReset-BSd6jMxU.d.cts +0 -38
- package/dist/useWatchFormReset-BSd6jMxU.d.cts.map +0 -1
- package/dist/useWatchFormReset-C7YJ-I3N.d.ts +0 -38
- package/dist/useWatchFormReset-C7YJ-I3N.d.ts.map +0 -1
- package/dist/useWatchUserChange-C1xWHtFG.cjs +0 -90
- package/dist/useWatchUserChange-C1xWHtFG.cjs.map +0 -1
- package/dist/useWatchUserChange-CpyZz2i7.d.ts +0 -80
- package/dist/useWatchUserChange-CpyZz2i7.d.ts.map +0 -1
- package/dist/useWatchUserChange-DSAboNCs.d.cts +0 -80
- package/dist/useWatchUserChange-DSAboNCs.d.cts.map +0 -1
- package/dist/useWatchUserChange-DSQGsl1R.js +0 -84
- package/dist/useWatchUserChange-DSQGsl1R.js.map +0 -1
- /package/dist/{index-BLwMeReG.d.ts → index-BKZ67WMa.d.cts} +0 -0
- /package/dist/{index-C2gUMYkE.d.cts → index-BKZ67WMa.d.ts} +0 -0
- /package/dist/{index-CJgP-E0M.d.cts → index-BVVgDSdq.d.cts} +0 -0
- /package/dist/{index-Cg9utiy0.d.ts → index-BVVgDSdq.d.ts} +0 -0
- /package/dist/{index-CspKFJM1.d.cts → index-DmtQKWjk.d.cts} +0 -0
- /package/dist/{index-h64gcVNJ.d.ts → index-DmtQKWjk.d.ts} +0 -0
- /package/dist/{useInput-CVm3tP78.js → useInput-C0aJaAGe.js} +0 -0
- /package/dist/{useInput-BdH8oftG.d.ts → useInput-ClpHDPdr.d.cts} +0 -0
- /package/dist/{useInput-DZOmMKcp.d.cts → useInput-ClpHDPdr.d.ts} +0 -0
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
require("./FormContext-DsmS_mkO.cjs");
|
|
2
|
-
const require_useFormContext = require("./useFormContext-CrXwNYiB.cjs");
|
|
3
|
-
let _fuf_stack_pixel_utils = require("@fuf-stack/pixel-utils");
|
|
4
|
-
let _fuf_stack_pixels = require("@fuf-stack/pixels");
|
|
5
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
|
-
//#region src/SubmitButton/SubmitButton.tsx
|
|
7
|
-
/**
|
|
8
|
-
* From SubmitButton
|
|
9
|
-
*/
|
|
10
|
-
const SubmitButton = ({ ariaLabel = "Submit form", children = "Submit", className = void 0, color = "success", icon = void 0, loading = false, size = "md", testId = "form_submit_button" }) => {
|
|
11
|
-
const { formState: { isSubmitting }, triggerSubmit } = require_useFormContext.useFormContext();
|
|
12
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_fuf_stack_pixels.Button, {
|
|
13
|
-
ariaLabel,
|
|
14
|
-
className: (0, _fuf_stack_pixel_utils.cn)(className),
|
|
15
|
-
color,
|
|
16
|
-
disabled: isSubmitting,
|
|
17
|
-
icon,
|
|
18
|
-
loading: loading || isSubmitting,
|
|
19
|
-
onClick: triggerSubmit,
|
|
20
|
-
size,
|
|
21
|
-
testId: (0, _fuf_stack_pixel_utils.slugify)(testId, { replaceDots: true }),
|
|
22
|
-
type: "submit",
|
|
23
|
-
children
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
//#endregion
|
|
27
|
-
//#region src/SubmitButton/index.ts
|
|
28
|
-
var SubmitButton_default = SubmitButton;
|
|
29
|
-
//#endregion
|
|
30
|
-
Object.defineProperty(exports, "SubmitButton", {
|
|
31
|
-
enumerable: true,
|
|
32
|
-
get: function() {
|
|
33
|
-
return SubmitButton;
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
Object.defineProperty(exports, "SubmitButton_default", {
|
|
37
|
-
enumerable: true,
|
|
38
|
-
get: function() {
|
|
39
|
-
return SubmitButton_default;
|
|
40
|
-
}
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
//# sourceMappingURL=SubmitButton-D-wn1PJV.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SubmitButton-D-wn1PJV.cjs","names":["useFormContext","Button"],"sources":["../src/SubmitButton/SubmitButton.tsx","../src/SubmitButton/index.ts"],"sourcesContent":["import type { ButtonProps } from '@fuf-stack/pixels';\nimport type { ReactNode } from 'react';\n\nimport { cn, slugify } from '@fuf-stack/pixel-utils';\nimport { Button } from '@fuf-stack/pixels';\n\nimport { useFormContext } from '../hooks/useFormContext';\n\nexport interface SubmitButtonProps {\n /** sets HTML aria-label attribute */\n ariaLabel?: string;\n /** child components */\n children?: ReactNode;\n /** CSS class name */\n className?: string;\n /** color of the submit button */\n color?: ButtonProps['color'];\n /** icon of the submit button */\n icon?: ButtonProps['icon'];\n /** If set loading animation is shown */\n loading?: boolean;\n /** size of the submit button */\n size?: ButtonProps['size'];\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\n/**\n * From SubmitButton\n */\nconst SubmitButton = ({\n ariaLabel = 'Submit form',\n children = 'Submit',\n className = undefined,\n color = 'success',\n icon = undefined,\n loading = false,\n size = 'md',\n testId = 'form_submit_button',\n}: SubmitButtonProps) => {\n const {\n formState: { isSubmitting },\n triggerSubmit,\n } = useFormContext();\n\n return (\n <Button\n ariaLabel={ariaLabel}\n className={cn(className)}\n color={color}\n disabled={isSubmitting}\n icon={icon}\n loading={loading || isSubmitting}\n // @ts-expect-error we use form context triggerSubmit\n // here so that submit button also works in special\n // scenarios (e.g. when used in modal)\n onClick={triggerSubmit}\n size={size}\n testId={slugify(testId, { replaceDots: true })}\n type=\"submit\"\n >\n {children}\n </Button>\n );\n};\n\nexport default SubmitButton;\n","import SubmitButton from './SubmitButton';\n\nexport type { SubmitButtonProps } from './SubmitButton';\n\nexport { SubmitButton };\n\nexport default SubmitButton;\n"],"mappings":";;;;;;;;;AA8BA,MAAM,gBAAgB,EACpB,YAAY,eACZ,WAAW,UACX,YAAY,KAAA,GACZ,QAAQ,WACR,OAAO,KAAA,GACP,UAAU,OACV,OAAO,MACP,SAAS,2BACc;CACvB,MAAM,EACJ,WAAW,EAAE,gBACb,kBACEA,uBAAAA,eAAe;CAEnB,OACE,iBAAA,GAAA,kBAAA,KAACC,kBAAAA,QAAD;EACa;EACX,YAAA,GAAA,uBAAA,IAAc,SAAS;EAChB;EACP,UAAU;EACJ;EACN,SAAS,WAAW;EAIpB,SAAS;EACH;EACN,SAAA,GAAA,uBAAA,SAAgB,QAAQ,EAAE,aAAa,KAAK,CAAC;EAC7C,MAAK;EAEJ;CACK,CAAA;AAEZ;;;AC1DA,IAAA,uBAAe"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import { n as useFormContext } from "./useFormContext-CT8H8xIe.js";
|
|
2
|
-
import { cn, slugify } from "@fuf-stack/pixel-utils";
|
|
3
|
-
import { Button } from "@fuf-stack/pixels";
|
|
4
|
-
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
//#region src/SubmitButton/SubmitButton.tsx
|
|
6
|
-
/**
|
|
7
|
-
* From SubmitButton
|
|
8
|
-
*/
|
|
9
|
-
const SubmitButton = ({ ariaLabel = "Submit form", children = "Submit", className = void 0, color = "success", icon = void 0, loading = false, size = "md", testId = "form_submit_button" }) => {
|
|
10
|
-
const { formState: { isSubmitting }, triggerSubmit } = useFormContext();
|
|
11
|
-
return /* @__PURE__ */ jsx(Button, {
|
|
12
|
-
ariaLabel,
|
|
13
|
-
className: cn(className),
|
|
14
|
-
color,
|
|
15
|
-
disabled: isSubmitting,
|
|
16
|
-
icon,
|
|
17
|
-
loading: loading || isSubmitting,
|
|
18
|
-
onClick: triggerSubmit,
|
|
19
|
-
size,
|
|
20
|
-
testId: slugify(testId, { replaceDots: true }),
|
|
21
|
-
type: "submit",
|
|
22
|
-
children
|
|
23
|
-
});
|
|
24
|
-
};
|
|
25
|
-
//#endregion
|
|
26
|
-
//#region src/SubmitButton/index.ts
|
|
27
|
-
var SubmitButton_default = SubmitButton;
|
|
28
|
-
//#endregion
|
|
29
|
-
export { SubmitButton as n, SubmitButton_default as t };
|
|
30
|
-
|
|
31
|
-
//# sourceMappingURL=SubmitButton-D6aU7IgC.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SubmitButton-D6aU7IgC.js","names":[],"sources":["../src/SubmitButton/SubmitButton.tsx","../src/SubmitButton/index.ts"],"sourcesContent":["import type { ButtonProps } from '@fuf-stack/pixels';\nimport type { ReactNode } from 'react';\n\nimport { cn, slugify } from '@fuf-stack/pixel-utils';\nimport { Button } from '@fuf-stack/pixels';\n\nimport { useFormContext } from '../hooks/useFormContext';\n\nexport interface SubmitButtonProps {\n /** sets HTML aria-label attribute */\n ariaLabel?: string;\n /** child components */\n children?: ReactNode;\n /** CSS class name */\n className?: string;\n /** color of the submit button */\n color?: ButtonProps['color'];\n /** icon of the submit button */\n icon?: ButtonProps['icon'];\n /** If set loading animation is shown */\n loading?: boolean;\n /** size of the submit button */\n size?: ButtonProps['size'];\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\n/**\n * From SubmitButton\n */\nconst SubmitButton = ({\n ariaLabel = 'Submit form',\n children = 'Submit',\n className = undefined,\n color = 'success',\n icon = undefined,\n loading = false,\n size = 'md',\n testId = 'form_submit_button',\n}: SubmitButtonProps) => {\n const {\n formState: { isSubmitting },\n triggerSubmit,\n } = useFormContext();\n\n return (\n <Button\n ariaLabel={ariaLabel}\n className={cn(className)}\n color={color}\n disabled={isSubmitting}\n icon={icon}\n loading={loading || isSubmitting}\n // @ts-expect-error we use form context triggerSubmit\n // here so that submit button also works in special\n // scenarios (e.g. when used in modal)\n onClick={triggerSubmit}\n size={size}\n testId={slugify(testId, { replaceDots: true })}\n type=\"submit\"\n >\n {children}\n </Button>\n );\n};\n\nexport default SubmitButton;\n","import SubmitButton from './SubmitButton';\n\nexport type { SubmitButtonProps } from './SubmitButton';\n\nexport { SubmitButton };\n\nexport default SubmitButton;\n"],"mappings":";;;;;;;;AA8BA,MAAM,gBAAgB,EACpB,YAAY,eACZ,WAAW,UACX,YAAY,KAAA,GACZ,QAAQ,WACR,OAAO,KAAA,GACP,UAAU,OACV,OAAO,MACP,SAAS,2BACc;CACvB,MAAM,EACJ,WAAW,EAAE,gBACb,kBACE,eAAe;CAEnB,OACE,oBAAC,QAAD;EACa;EACX,WAAW,GAAG,SAAS;EAChB;EACP,UAAU;EACJ;EACN,SAAS,WAAW;EAIpB,SAAS;EACH;EACN,QAAQ,QAAQ,QAAQ,EAAE,aAAa,KAAK,CAAC;EAC7C,MAAK;EAEJ;CACK,CAAA;AAEZ;;;AC1DA,IAAA,uBAAe"}
|
package/dist/Switch-Ch6_VInV.cjs
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
require("./FormContext-DsmS_mkO.cjs");
|
|
2
|
-
const require_hooks_useUniformField_index = require("./hooks/useUniformField/index.cjs");
|
|
3
|
-
let _fuf_stack_pixel_utils = require("@fuf-stack/pixel-utils");
|
|
4
|
-
let react = require("react");
|
|
5
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
|
-
let _react_aria_visually_hidden = require("@react-aria/visually-hidden");
|
|
7
|
-
let _heroui_switch = require("@heroui/switch");
|
|
8
|
-
//#region src/Switch/Switch.tsx
|
|
9
|
-
const switchVariants = (0, _fuf_stack_pixel_utils.tv)({ slots: {
|
|
10
|
-
base: "",
|
|
11
|
-
endContent: "",
|
|
12
|
-
errorMessage: "ml-1 mt-1",
|
|
13
|
-
label: "text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:!text-danger group-data-[required=true]:after:ml-0.5 group-data-[required=true]:after:text-danger group-data-[required=true]:after:content-[\"*\"]",
|
|
14
|
-
outerWrapper: "place-content-center",
|
|
15
|
-
startContent: "",
|
|
16
|
-
thumb: "",
|
|
17
|
-
thumbIcon: "",
|
|
18
|
-
wrapper: ""
|
|
19
|
-
} });
|
|
20
|
-
/**
|
|
21
|
-
* Switch component based on [HeroUI Switch](https://www.heroui.com//docs/components/switch)
|
|
22
|
-
*/
|
|
23
|
-
const Switch = ({ className = void 0, endContent = void 0, name, size = void 0, startContent = void 0, thumbIcon = void 0, ...uniformFieldProps }) => {
|
|
24
|
-
const { ariaLabel, defaultValue, disabled, errorMessage, field, getErrorMessageProps, getHelperWrapperProps, invalid, label, onBlur, onChange, ref, required, testId } = require_hooks_useUniformField_index.useUniformField({
|
|
25
|
-
name,
|
|
26
|
-
...uniformFieldProps
|
|
27
|
-
});
|
|
28
|
-
const visualSwitchRef = (0, react.useRef)(null);
|
|
29
|
-
const classNames = (0, _fuf_stack_pixel_utils.variantsToClassNames)(switchVariants(), className, "outerWrapper");
|
|
30
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
31
|
-
className: classNames.outerWrapper,
|
|
32
|
-
children: [
|
|
33
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_react_aria_visually_hidden.VisuallyHidden, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
34
|
-
ref,
|
|
35
|
-
"aria-label": ariaLabel,
|
|
36
|
-
checked: !!field.value,
|
|
37
|
-
name,
|
|
38
|
-
onBlur,
|
|
39
|
-
type: "checkbox",
|
|
40
|
-
onChange: (e) => {
|
|
41
|
-
onChange(e.target.checked);
|
|
42
|
-
},
|
|
43
|
-
onFocus: () => {
|
|
44
|
-
visualSwitchRef.current?.focus();
|
|
45
|
-
}
|
|
46
|
-
}) }),
|
|
47
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_heroui_switch.Switch, {
|
|
48
|
-
ref: visualSwitchRef,
|
|
49
|
-
"aria-label": ariaLabel,
|
|
50
|
-
classNames,
|
|
51
|
-
"data-invalid": invalid,
|
|
52
|
-
"data-required": required,
|
|
53
|
-
"data-testid": testId,
|
|
54
|
-
defaultSelected: !!defaultValue,
|
|
55
|
-
endContent,
|
|
56
|
-
isDisabled: disabled,
|
|
57
|
-
isSelected: !!field.value,
|
|
58
|
-
name: `${name}_switch`,
|
|
59
|
-
onValueChange: onChange,
|
|
60
|
-
size,
|
|
61
|
-
startContent,
|
|
62
|
-
thumbIcon,
|
|
63
|
-
children: label
|
|
64
|
-
}),
|
|
65
|
-
invalid ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
66
|
-
...getHelperWrapperProps(),
|
|
67
|
-
className: (0, _fuf_stack_pixel_utils.cn)(getHelperWrapperProps()?.className, "ml-0 block"),
|
|
68
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
69
|
-
...getErrorMessageProps(),
|
|
70
|
-
children: errorMessage
|
|
71
|
-
})
|
|
72
|
-
}) : null
|
|
73
|
-
]
|
|
74
|
-
});
|
|
75
|
-
};
|
|
76
|
-
//#endregion
|
|
77
|
-
//#region src/Switch/index.ts
|
|
78
|
-
var Switch_default = Switch;
|
|
79
|
-
//#endregion
|
|
80
|
-
Object.defineProperty(exports, "Switch", {
|
|
81
|
-
enumerable: true,
|
|
82
|
-
get: function() {
|
|
83
|
-
return Switch;
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
Object.defineProperty(exports, "Switch_default", {
|
|
87
|
-
enumerable: true,
|
|
88
|
-
get: function() {
|
|
89
|
-
return Switch_default;
|
|
90
|
-
}
|
|
91
|
-
});
|
|
92
|
-
Object.defineProperty(exports, "switchVariants", {
|
|
93
|
-
enumerable: true,
|
|
94
|
-
get: function() {
|
|
95
|
-
return switchVariants;
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
//# sourceMappingURL=Switch-Ch6_VInV.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Switch-Ch6_VInV.cjs","names":["useUniformField","VisuallyHidden","HeroSwitch"],"sources":["../src/Switch/Switch.tsx","../src/Switch/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { SwitchProps as HeroSwitchProps } from '@heroui/switch';\nimport type { ReactNode } from 'react';\n\nimport { useRef } from 'react';\n\nimport { Switch as HeroSwitch } from '@heroui/switch';\nimport { VisuallyHidden } from '@react-aria/visually-hidden';\n\nimport { cn, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../hooks/useUniformField';\n\nexport const switchVariants = tv({\n slots: {\n base: '',\n endContent: '',\n errorMessage: 'ml-1 mt-1',\n // see HeroUI styles for group-data condition,\n // e.g.: https://github.com/heroui-inc/heroui/blob/main/packages/core/theme/src/components/select.ts\n label:\n 'text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:!text-danger group-data-[required=true]:after:ml-0.5 group-data-[required=true]:after:text-danger group-data-[required=true]:after:content-[\"*\"]',\n outerWrapper: 'place-content-center',\n startContent: '',\n thumb: '',\n thumbIcon: '',\n wrapper: '',\n },\n});\n\ntype VariantProps = TVProps<typeof switchVariants>;\ntype ClassName = TVClassName<typeof switchVariants>;\n\nexport interface SwitchProps extends VariantProps {\n /** Custom aria-label for accessibility. If not provided, falls back to field name when no visible label exists */\n ariaLabel?: string;\n /** CSS class name */\n className?: ClassName;\n /** whether the select should be disabled */\n disabled?: boolean;\n /** Icon to be displayed at the end of the switch (when enabled) */\n endContent?: ReactNode;\n /** component displayed next to the switch */\n label?: ReactNode;\n /** name the field is registered under */\n name: string;\n /* Size of the switch */\n size?: 'sm' | 'md' | 'lg';\n /** Icon to be displayed at the start of the switch (when disabled) */\n startContent?: ReactNode;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** Icon to be displayed inside the thumb */\n thumbIcon?: HeroSwitchProps['thumbIcon'];\n}\n\n/**\n * Switch component based on [HeroUI Switch](https://www.heroui.com//docs/components/switch)\n */\nconst Switch = ({\n className = undefined,\n endContent = undefined,\n name,\n size = undefined,\n startContent = undefined,\n thumbIcon = undefined,\n ...uniformFieldProps\n}: SwitchProps) => {\n const {\n ariaLabel,\n defaultValue,\n disabled,\n errorMessage,\n field,\n getErrorMessageProps,\n getHelperWrapperProps,\n invalid,\n label,\n onBlur,\n onChange,\n ref,\n required,\n testId,\n } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n // Ref for the visual switch to forward focus\n const visualSwitchRef = useRef<HTMLInputElement>(null);\n\n // classNames from slots\n const variants = switchVariants();\n const classNames = variantsToClassNames(variants, className, 'outerWrapper');\n\n return (\n <div className={classNames.outerWrapper}>\n {/* Visually hidden input for form accessibility and focus management */}\n <VisuallyHidden>\n <input\n ref={ref}\n aria-label={ariaLabel}\n checked={!!field.value}\n name={name}\n onBlur={onBlur}\n type=\"checkbox\"\n onChange={(e) => {\n onChange(e.target.checked);\n }}\n onFocus={() => {\n // When RHF focuses this hidden input (e.g., on validation error),\n // forward focus to the visual switch to show focus ring\n visualSwitchRef.current?.focus();\n }}\n />\n </VisuallyHidden>\n {/* Visual HeroSwitch component */}\n <HeroSwitch\n ref={visualSwitchRef}\n aria-label={ariaLabel}\n classNames={classNames}\n data-invalid={invalid}\n data-required={required}\n data-testid={testId}\n defaultSelected={!!defaultValue}\n endContent={endContent}\n isDisabled={disabled}\n isSelected={!!field.value}\n name={`${name}_switch`}\n onValueChange={onChange}\n size={size}\n startContent={startContent}\n thumbIcon={thumbIcon}\n >\n {label}\n </HeroSwitch>\n {invalid ? (\n <div\n {...getHelperWrapperProps()}\n className={cn(\n getHelperWrapperProps()?.className,\n // force helper to be visible (for some reason it's hidden by default) and remove margin\n 'ml-0 block',\n )}\n >\n <div {...getErrorMessageProps()}>{errorMessage}</div>\n </div>\n ) : null}\n </div>\n );\n};\n\nexport default Switch;\n","import Switch from './Switch';\n\nexport type { SwitchProps } from './Switch';\n\nexport { switchVariants } from './Switch';\n\nexport { Switch };\n\nexport default Switch;\n"],"mappings":";;;;;;;;AAaA,MAAa,kBAAA,GAAA,uBAAA,IAAoB,EAC/B,OAAO;CACL,MAAM;CACN,YAAY;CACZ,cAAc;CAGd,OACE;CACF,cAAc;CACd,cAAc;CACd,OAAO;CACP,WAAW;CACX,SAAS;AACX,EACF,CAAC;;;;AA+BD,MAAM,UAAU,EACd,YAAY,KAAA,GACZ,aAAa,KAAA,GACb,MACA,OAAO,KAAA,GACP,eAAe,KAAA,GACf,YAAY,KAAA,GACZ,GAAG,wBACc;CACjB,MAAM,EACJ,WACA,cACA,UACA,cACA,OACA,sBACA,uBACA,SACA,OACA,QACA,UACA,KACA,UACA,WACEA,oCAAAA,gBAAgB;EAClB;EACA,GAAG;CACL,CAAC;CAGD,MAAM,mBAAA,GAAA,MAAA,QAA2C,IAAI;CAIrD,MAAM,cAAA,GAAA,uBAAA,sBADW,eAC8B,GAAG,WAAW,cAAc;CAE3E,OACE,iBAAA,GAAA,kBAAA,MAAC,OAAD;EAAK,WAAW,WAAW;YAA3B;GAEE,iBAAA,GAAA,kBAAA,KAACC,4BAAAA,gBAAD,EAAA,UACE,iBAAA,GAAA,kBAAA,KAAC,SAAD;IACO;IACL,cAAY;IACZ,SAAS,CAAC,CAAC,MAAM;IACX;IACE;IACR,MAAK;IACL,WAAW,MAAM;KACf,SAAS,EAAE,OAAO,OAAO;IAC3B;IACA,eAAe;KAGb,gBAAgB,SAAS,MAAM;IACjC;GACD,CAAA,EACa,CAAA;GAEhB,iBAAA,GAAA,kBAAA,KAACC,eAAAA,QAAD;IACE,KAAK;IACL,cAAY;IACA;IACZ,gBAAc;IACd,iBAAe;IACf,eAAa;IACb,iBAAiB,CAAC,CAAC;IACP;IACZ,YAAY;IACZ,YAAY,CAAC,CAAC,MAAM;IACpB,MAAM,GAAG,KAAK;IACd,eAAe;IACT;IACQ;IACH;cAEV;GACS,CAAA;GACX,UACC,iBAAA,GAAA,kBAAA,KAAC,OAAD;IACE,GAAI,sBAAsB;IAC1B,YAAA,GAAA,uBAAA,IACE,sBAAsB,GAAG,WAEzB,YACF;cAEA,iBAAA,GAAA,kBAAA,KAAC,OAAD;KAAK,GAAI,qBAAqB;eAAI;IAAkB,CAAA;GACjD,CAAA,IACH;EACD;;AAET;;;AC9IA,IAAA,iBAAe"}
|
package/dist/Switch-DvKRPFcC.js
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { useUniformField } from "./hooks/useUniformField/index.js";
|
|
2
|
-
import { cn, tv, variantsToClassNames } from "@fuf-stack/pixel-utils";
|
|
3
|
-
import { useRef } from "react";
|
|
4
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
-
import { VisuallyHidden } from "@react-aria/visually-hidden";
|
|
6
|
-
import { Switch } from "@heroui/switch";
|
|
7
|
-
//#region src/Switch/Switch.tsx
|
|
8
|
-
const switchVariants = tv({ slots: {
|
|
9
|
-
base: "",
|
|
10
|
-
endContent: "",
|
|
11
|
-
errorMessage: "ml-1 mt-1",
|
|
12
|
-
label: "text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:!text-danger group-data-[required=true]:after:ml-0.5 group-data-[required=true]:after:text-danger group-data-[required=true]:after:content-[\"*\"]",
|
|
13
|
-
outerWrapper: "place-content-center",
|
|
14
|
-
startContent: "",
|
|
15
|
-
thumb: "",
|
|
16
|
-
thumbIcon: "",
|
|
17
|
-
wrapper: ""
|
|
18
|
-
} });
|
|
19
|
-
/**
|
|
20
|
-
* Switch component based on [HeroUI Switch](https://www.heroui.com//docs/components/switch)
|
|
21
|
-
*/
|
|
22
|
-
const Switch$1 = ({ className = void 0, endContent = void 0, name, size = void 0, startContent = void 0, thumbIcon = void 0, ...uniformFieldProps }) => {
|
|
23
|
-
const { ariaLabel, defaultValue, disabled, errorMessage, field, getErrorMessageProps, getHelperWrapperProps, invalid, label, onBlur, onChange, ref, required, testId } = useUniformField({
|
|
24
|
-
name,
|
|
25
|
-
...uniformFieldProps
|
|
26
|
-
});
|
|
27
|
-
const visualSwitchRef = useRef(null);
|
|
28
|
-
const classNames = variantsToClassNames(switchVariants(), className, "outerWrapper");
|
|
29
|
-
return /* @__PURE__ */ jsxs("div", {
|
|
30
|
-
className: classNames.outerWrapper,
|
|
31
|
-
children: [
|
|
32
|
-
/* @__PURE__ */ jsx(VisuallyHidden, { children: /* @__PURE__ */ jsx("input", {
|
|
33
|
-
ref,
|
|
34
|
-
"aria-label": ariaLabel,
|
|
35
|
-
checked: !!field.value,
|
|
36
|
-
name,
|
|
37
|
-
onBlur,
|
|
38
|
-
type: "checkbox",
|
|
39
|
-
onChange: (e) => {
|
|
40
|
-
onChange(e.target.checked);
|
|
41
|
-
},
|
|
42
|
-
onFocus: () => {
|
|
43
|
-
visualSwitchRef.current?.focus();
|
|
44
|
-
}
|
|
45
|
-
}) }),
|
|
46
|
-
/* @__PURE__ */ jsx(Switch, {
|
|
47
|
-
ref: visualSwitchRef,
|
|
48
|
-
"aria-label": ariaLabel,
|
|
49
|
-
classNames,
|
|
50
|
-
"data-invalid": invalid,
|
|
51
|
-
"data-required": required,
|
|
52
|
-
"data-testid": testId,
|
|
53
|
-
defaultSelected: !!defaultValue,
|
|
54
|
-
endContent,
|
|
55
|
-
isDisabled: disabled,
|
|
56
|
-
isSelected: !!field.value,
|
|
57
|
-
name: `${name}_switch`,
|
|
58
|
-
onValueChange: onChange,
|
|
59
|
-
size,
|
|
60
|
-
startContent,
|
|
61
|
-
thumbIcon,
|
|
62
|
-
children: label
|
|
63
|
-
}),
|
|
64
|
-
invalid ? /* @__PURE__ */ jsx("div", {
|
|
65
|
-
...getHelperWrapperProps(),
|
|
66
|
-
className: cn(getHelperWrapperProps()?.className, "ml-0 block"),
|
|
67
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
68
|
-
...getErrorMessageProps(),
|
|
69
|
-
children: errorMessage
|
|
70
|
-
})
|
|
71
|
-
}) : null
|
|
72
|
-
]
|
|
73
|
-
});
|
|
74
|
-
};
|
|
75
|
-
//#endregion
|
|
76
|
-
//#region src/Switch/index.ts
|
|
77
|
-
var Switch_default = Switch$1;
|
|
78
|
-
//#endregion
|
|
79
|
-
export { Switch$1 as n, switchVariants as r, Switch_default as t };
|
|
80
|
-
|
|
81
|
-
//# sourceMappingURL=Switch-DvKRPFcC.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Switch-DvKRPFcC.js","names":["Switch","HeroSwitch","Switch"],"sources":["../src/Switch/Switch.tsx","../src/Switch/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { SwitchProps as HeroSwitchProps } from '@heroui/switch';\nimport type { ReactNode } from 'react';\n\nimport { useRef } from 'react';\n\nimport { Switch as HeroSwitch } from '@heroui/switch';\nimport { VisuallyHidden } from '@react-aria/visually-hidden';\n\nimport { cn, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../hooks/useUniformField';\n\nexport const switchVariants = tv({\n slots: {\n base: '',\n endContent: '',\n errorMessage: 'ml-1 mt-1',\n // see HeroUI styles for group-data condition,\n // e.g.: https://github.com/heroui-inc/heroui/blob/main/packages/core/theme/src/components/select.ts\n label:\n 'text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:!text-danger group-data-[required=true]:after:ml-0.5 group-data-[required=true]:after:text-danger group-data-[required=true]:after:content-[\"*\"]',\n outerWrapper: 'place-content-center',\n startContent: '',\n thumb: '',\n thumbIcon: '',\n wrapper: '',\n },\n});\n\ntype VariantProps = TVProps<typeof switchVariants>;\ntype ClassName = TVClassName<typeof switchVariants>;\n\nexport interface SwitchProps extends VariantProps {\n /** Custom aria-label for accessibility. If not provided, falls back to field name when no visible label exists */\n ariaLabel?: string;\n /** CSS class name */\n className?: ClassName;\n /** whether the select should be disabled */\n disabled?: boolean;\n /** Icon to be displayed at the end of the switch (when enabled) */\n endContent?: ReactNode;\n /** component displayed next to the switch */\n label?: ReactNode;\n /** name the field is registered under */\n name: string;\n /* Size of the switch */\n size?: 'sm' | 'md' | 'lg';\n /** Icon to be displayed at the start of the switch (when disabled) */\n startContent?: ReactNode;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** Icon to be displayed inside the thumb */\n thumbIcon?: HeroSwitchProps['thumbIcon'];\n}\n\n/**\n * Switch component based on [HeroUI Switch](https://www.heroui.com//docs/components/switch)\n */\nconst Switch = ({\n className = undefined,\n endContent = undefined,\n name,\n size = undefined,\n startContent = undefined,\n thumbIcon = undefined,\n ...uniformFieldProps\n}: SwitchProps) => {\n const {\n ariaLabel,\n defaultValue,\n disabled,\n errorMessage,\n field,\n getErrorMessageProps,\n getHelperWrapperProps,\n invalid,\n label,\n onBlur,\n onChange,\n ref,\n required,\n testId,\n } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n // Ref for the visual switch to forward focus\n const visualSwitchRef = useRef<HTMLInputElement>(null);\n\n // classNames from slots\n const variants = switchVariants();\n const classNames = variantsToClassNames(variants, className, 'outerWrapper');\n\n return (\n <div className={classNames.outerWrapper}>\n {/* Visually hidden input for form accessibility and focus management */}\n <VisuallyHidden>\n <input\n ref={ref}\n aria-label={ariaLabel}\n checked={!!field.value}\n name={name}\n onBlur={onBlur}\n type=\"checkbox\"\n onChange={(e) => {\n onChange(e.target.checked);\n }}\n onFocus={() => {\n // When RHF focuses this hidden input (e.g., on validation error),\n // forward focus to the visual switch to show focus ring\n visualSwitchRef.current?.focus();\n }}\n />\n </VisuallyHidden>\n {/* Visual HeroSwitch component */}\n <HeroSwitch\n ref={visualSwitchRef}\n aria-label={ariaLabel}\n classNames={classNames}\n data-invalid={invalid}\n data-required={required}\n data-testid={testId}\n defaultSelected={!!defaultValue}\n endContent={endContent}\n isDisabled={disabled}\n isSelected={!!field.value}\n name={`${name}_switch`}\n onValueChange={onChange}\n size={size}\n startContent={startContent}\n thumbIcon={thumbIcon}\n >\n {label}\n </HeroSwitch>\n {invalid ? (\n <div\n {...getHelperWrapperProps()}\n className={cn(\n getHelperWrapperProps()?.className,\n // force helper to be visible (for some reason it's hidden by default) and remove margin\n 'ml-0 block',\n )}\n >\n <div {...getErrorMessageProps()}>{errorMessage}</div>\n </div>\n ) : null}\n </div>\n );\n};\n\nexport default Switch;\n","import Switch from './Switch';\n\nexport type { SwitchProps } from './Switch';\n\nexport { switchVariants } from './Switch';\n\nexport { Switch };\n\nexport default Switch;\n"],"mappings":";;;;;;;AAaA,MAAa,iBAAiB,GAAG,EAC/B,OAAO;CACL,MAAM;CACN,YAAY;CACZ,cAAc;CAGd,OACE;CACF,cAAc;CACd,cAAc;CACd,OAAO;CACP,WAAW;CACX,SAAS;AACX,EACF,CAAC;;;;AA+BD,MAAMA,YAAU,EACd,YAAY,KAAA,GACZ,aAAa,KAAA,GACb,MACA,OAAO,KAAA,GACP,eAAe,KAAA,GACf,YAAY,KAAA,GACZ,GAAG,wBACc;CACjB,MAAM,EACJ,WACA,cACA,UACA,cACA,OACA,sBACA,uBACA,SACA,OACA,QACA,UACA,KACA,UACA,WACE,gBAAgB;EAClB;EACA,GAAG;CACL,CAAC;CAGD,MAAM,kBAAkB,OAAyB,IAAI;CAIrD,MAAM,aAAa,qBADF,eAC8B,GAAG,WAAW,cAAc;CAE3E,OACE,qBAAC,OAAD;EAAK,WAAW,WAAW;YAA3B;GAEE,oBAAC,gBAAD,EAAA,UACE,oBAAC,SAAD;IACO;IACL,cAAY;IACZ,SAAS,CAAC,CAAC,MAAM;IACX;IACE;IACR,MAAK;IACL,WAAW,MAAM;KACf,SAAS,EAAE,OAAO,OAAO;IAC3B;IACA,eAAe;KAGb,gBAAgB,SAAS,MAAM;IACjC;GACD,CAAA,EACa,CAAA;GAEhB,oBAACC,QAAD;IACE,KAAK;IACL,cAAY;IACA;IACZ,gBAAc;IACd,iBAAe;IACf,eAAa;IACb,iBAAiB,CAAC,CAAC;IACP;IACZ,YAAY;IACZ,YAAY,CAAC,CAAC,MAAM;IACpB,MAAM,GAAG,KAAK;IACd,eAAe;IACT;IACQ;IACH;cAEV;GACS,CAAA;GACX,UACC,oBAAC,OAAD;IACE,GAAI,sBAAsB;IAC1B,WAAW,GACT,sBAAsB,GAAG,WAEzB,YACF;cAEA,oBAAC,OAAD;KAAK,GAAI,qBAAqB;eAAI;IAAkB,CAAA;GACjD,CAAA,IACH;EACD;;AAET;;;AC9IA,IAAA,iBAAeC"}
|
|
@@ -1,153 +0,0 @@
|
|
|
1
|
-
import { useUniformField } from "./hooks/useUniformField/index.js";
|
|
2
|
-
import { cn, tv, variantsToClassNames } from "@fuf-stack/pixel-utils";
|
|
3
|
-
import { useRef } from "react";
|
|
4
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
-
import { VisuallyHidden } from "@react-aria/visually-hidden";
|
|
6
|
-
import { useSwitch } from "@heroui/switch";
|
|
7
|
-
//#region src/SwitchBox/SwitchBox.tsx
|
|
8
|
-
const switchBoxVariants = tv({
|
|
9
|
-
slots: {
|
|
10
|
-
box: "group inline-flex w-full cursor-pointer items-center justify-between rounded-lg border-2 border-default hover:bg-content2 data-[selected=true]:border-focus",
|
|
11
|
-
description: "text-foreground opacity-70",
|
|
12
|
-
icon: "",
|
|
13
|
-
label: "font-medium text-foreground group-data-[required=true]:after:ml-0.5 group-data-[required=true]:after:text-danger group-data-[required=true]:after:content-[\"*\"]",
|
|
14
|
-
wrapper: "",
|
|
15
|
-
thumb: "",
|
|
16
|
-
thumbIcon: ""
|
|
17
|
-
},
|
|
18
|
-
variants: {
|
|
19
|
-
isDisabled: { true: { box: "pointer-events-none opacity-disabled" } },
|
|
20
|
-
isInvalid: { true: {
|
|
21
|
-
box: "!border-danger",
|
|
22
|
-
label: "!text-danger"
|
|
23
|
-
} },
|
|
24
|
-
size: {
|
|
25
|
-
sm: {
|
|
26
|
-
box: "gap-2 p-3",
|
|
27
|
-
description: "text-xs",
|
|
28
|
-
label: "text-xs"
|
|
29
|
-
},
|
|
30
|
-
md: {
|
|
31
|
-
box: "gap-4 p-4",
|
|
32
|
-
description: "text-small",
|
|
33
|
-
label: "text-sm"
|
|
34
|
-
},
|
|
35
|
-
lg: {
|
|
36
|
-
box: "gap-4 p-5",
|
|
37
|
-
description: "text-small",
|
|
38
|
-
label: "text-base"
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
defaultVariants: { size: "md" }
|
|
43
|
-
});
|
|
44
|
-
/**
|
|
45
|
-
* SwitchBox component - A card-like box with a switch control
|
|
46
|
-
*/
|
|
47
|
-
const SwitchBox = ({ className = void 0, description = void 0, icon = void 0, name, size = void 0, thumbIcon = void 0, ...uniformFieldProps }) => {
|
|
48
|
-
const { defaultValue, disabled, errorMessage, field, getErrorMessageProps, getHelperWrapperProps, invalid, label, onBlur, onChange, ref, required, testId } = useUniformField({
|
|
49
|
-
name,
|
|
50
|
-
...uniformFieldProps
|
|
51
|
-
});
|
|
52
|
-
const visualSwitchRef = useRef(null);
|
|
53
|
-
const { Component, slots, isSelected, getBaseProps, getInputProps, getWrapperProps } = useSwitch({
|
|
54
|
-
defaultSelected: !!defaultValue,
|
|
55
|
-
isDisabled: disabled,
|
|
56
|
-
isSelected: !!field.value,
|
|
57
|
-
name: `${name}_switch`,
|
|
58
|
-
onValueChange: onChange,
|
|
59
|
-
size,
|
|
60
|
-
thumbIcon
|
|
61
|
-
});
|
|
62
|
-
const classNames = variantsToClassNames(switchBoxVariants({
|
|
63
|
-
isDisabled: disabled,
|
|
64
|
-
isInvalid: invalid,
|
|
65
|
-
size
|
|
66
|
-
}), className, "box");
|
|
67
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs(Component, {
|
|
68
|
-
...getBaseProps(),
|
|
69
|
-
className: classNames.box,
|
|
70
|
-
"data-invalid": invalid,
|
|
71
|
-
"data-required": required,
|
|
72
|
-
"data-testid": testId,
|
|
73
|
-
children: [
|
|
74
|
-
/* @__PURE__ */ jsxs(VisuallyHidden, { children: [/* @__PURE__ */ jsx("input", {
|
|
75
|
-
ref,
|
|
76
|
-
"aria-label": typeof label === "string" ? label : name,
|
|
77
|
-
checked: !!field.value,
|
|
78
|
-
name,
|
|
79
|
-
tabIndex: -1,
|
|
80
|
-
type: "checkbox",
|
|
81
|
-
onChange: (e) => {
|
|
82
|
-
onChange(e.target.checked);
|
|
83
|
-
},
|
|
84
|
-
onFocus: () => {
|
|
85
|
-
visualSwitchRef.current?.focus();
|
|
86
|
-
}
|
|
87
|
-
}), /* @__PURE__ */ jsx("input", {
|
|
88
|
-
ref: visualSwitchRef,
|
|
89
|
-
...getInputProps(),
|
|
90
|
-
onBlur: (e) => {
|
|
91
|
-
getInputProps().onBlur?.(e);
|
|
92
|
-
onBlur();
|
|
93
|
-
}
|
|
94
|
-
})] }),
|
|
95
|
-
!icon ? /* @__PURE__ */ jsx("span", {
|
|
96
|
-
...getWrapperProps(),
|
|
97
|
-
className: cn(getWrapperProps().className, classNames.wrapper),
|
|
98
|
-
children: /* @__PURE__ */ jsx("span", {
|
|
99
|
-
className: cn(slots.thumb({ class: classNames.thumb })),
|
|
100
|
-
children: thumbIcon && typeof thumbIcon === "function" ? thumbIcon({
|
|
101
|
-
isSelected: !!isSelected,
|
|
102
|
-
className: slots.thumbIcon({ class: classNames.thumbIcon }),
|
|
103
|
-
width: "1em",
|
|
104
|
-
height: "1em",
|
|
105
|
-
"data-checked": isSelected ? "true" : "false"
|
|
106
|
-
}) : thumbIcon
|
|
107
|
-
})
|
|
108
|
-
}) : null,
|
|
109
|
-
icon ? /* @__PURE__ */ jsx("div", {
|
|
110
|
-
className: classNames.icon,
|
|
111
|
-
children: icon
|
|
112
|
-
}) : null,
|
|
113
|
-
/* @__PURE__ */ jsxs("div", {
|
|
114
|
-
className: "grow",
|
|
115
|
-
children: [label ? /* @__PURE__ */ jsx("div", {
|
|
116
|
-
className: classNames.label,
|
|
117
|
-
children: label
|
|
118
|
-
}) : null, description ? /* @__PURE__ */ jsx("div", {
|
|
119
|
-
className: classNames.description,
|
|
120
|
-
children: description
|
|
121
|
-
}) : null]
|
|
122
|
-
}),
|
|
123
|
-
icon ? /* @__PURE__ */ jsx("span", {
|
|
124
|
-
...getWrapperProps(),
|
|
125
|
-
className: cn(getWrapperProps().className, classNames.wrapper),
|
|
126
|
-
children: /* @__PURE__ */ jsx("span", {
|
|
127
|
-
className: cn(slots.thumb({ class: classNames.thumb })),
|
|
128
|
-
children: thumbIcon && typeof thumbIcon === "function" ? thumbIcon({
|
|
129
|
-
isSelected: !!isSelected,
|
|
130
|
-
className: slots.thumbIcon({ class: classNames.thumbIcon }),
|
|
131
|
-
width: "1em",
|
|
132
|
-
height: "1em",
|
|
133
|
-
"data-checked": isSelected ? "true" : "false"
|
|
134
|
-
}) : thumbIcon
|
|
135
|
-
})
|
|
136
|
-
}) : null
|
|
137
|
-
]
|
|
138
|
-
}), invalid ? /* @__PURE__ */ jsx("div", {
|
|
139
|
-
...getHelperWrapperProps(),
|
|
140
|
-
className: cn(getHelperWrapperProps()?.className, "ml-0 block"),
|
|
141
|
-
children: /* @__PURE__ */ jsx("div", {
|
|
142
|
-
...getErrorMessageProps(),
|
|
143
|
-
children: errorMessage
|
|
144
|
-
})
|
|
145
|
-
}) : null] });
|
|
146
|
-
};
|
|
147
|
-
//#endregion
|
|
148
|
-
//#region src/SwitchBox/index.ts
|
|
149
|
-
var SwitchBox_default = SwitchBox;
|
|
150
|
-
//#endregion
|
|
151
|
-
export { SwitchBox as n, switchBoxVariants as r, SwitchBox_default as t };
|
|
152
|
-
|
|
153
|
-
//# sourceMappingURL=SwitchBox-BU1XieaZ.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SwitchBox-BU1XieaZ.js","names":[],"sources":["../src/SwitchBox/SwitchBox.tsx","../src/SwitchBox/index.ts"],"sourcesContent":["import type { TVClassName } from '@fuf-stack/pixel-utils';\nimport type { SwitchProps as HeroSwitchProps } from '@heroui/switch';\nimport type { ReactNode } from 'react';\n\nimport { useRef } from 'react';\n\nimport { useSwitch } from '@heroui/switch';\nimport { VisuallyHidden } from '@react-aria/visually-hidden';\n\nimport { cn, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../hooks/useUniformField';\n\nexport const switchBoxVariants = tv({\n slots: {\n box: 'group inline-flex w-full cursor-pointer items-center justify-between rounded-lg border-2 border-default hover:bg-content2 data-[selected=true]:border-focus',\n description: 'text-foreground opacity-70',\n icon: '',\n label:\n 'font-medium text-foreground group-data-[required=true]:after:ml-0.5 group-data-[required=true]:after:text-danger group-data-[required=true]:after:content-[\"*\"]',\n wrapper: '',\n thumb: '',\n thumbIcon: '',\n },\n variants: {\n isDisabled: {\n true: {\n box: 'pointer-events-none opacity-disabled',\n },\n },\n isInvalid: {\n true: {\n box: '!border-danger',\n label: '!text-danger',\n },\n },\n size: {\n sm: {\n box: 'gap-2 p-3',\n description: 'text-xs',\n label: 'text-xs',\n },\n md: {\n box: 'gap-4 p-4',\n description: 'text-small',\n label: 'text-sm',\n },\n lg: {\n box: 'gap-4 p-5',\n description: 'text-small',\n label: 'text-base',\n },\n },\n },\n defaultVariants: {\n size: 'md',\n },\n});\n\ntype ClassName = TVClassName<typeof switchBoxVariants>;\n\nexport interface SwitchBoxProps {\n /** CSS class name */\n className?: ClassName;\n /** Description text displayed below the label */\n description?: ReactNode;\n /** whether the switch should be disabled */\n disabled?: boolean;\n /** Icon to be displayed in the box */\n icon?: ReactNode;\n /** component displayed as the label */\n label?: ReactNode;\n /** name the field is registered under */\n name: string;\n /** whether the field is required */\n required?: boolean;\n /* Size of the switch */\n size?: 'sm' | 'md' | 'lg';\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /** Icon to be displayed inside the thumb */\n thumbIcon?: HeroSwitchProps['thumbIcon'];\n}\n\n/**\n * SwitchBox component - A card-like box with a switch control\n */\nconst SwitchBox = ({\n className = undefined,\n description = undefined,\n icon = undefined,\n name,\n size = undefined,\n thumbIcon = undefined,\n ...uniformFieldProps\n}: SwitchBoxProps) => {\n const {\n defaultValue,\n disabled,\n errorMessage,\n field,\n getErrorMessageProps,\n getHelperWrapperProps,\n invalid,\n label,\n onBlur,\n onChange,\n ref,\n required,\n testId,\n } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n // Ref for the visual switch to forward focus\n const visualSwitchRef = useRef<HTMLInputElement>(null);\n\n // Use the useSwitch hook to get access to all the necessary props\n const {\n Component,\n slots,\n isSelected,\n getBaseProps,\n getInputProps,\n getWrapperProps,\n } = useSwitch({\n defaultSelected: !!defaultValue,\n isDisabled: disabled,\n isSelected: !!field.value,\n name: `${name}_switch`,\n onValueChange: onChange,\n size,\n thumbIcon,\n });\n\n // classNames from slots\n const variants = switchBoxVariants({\n isDisabled: disabled,\n isInvalid: invalid,\n size,\n });\n const classNames = variantsToClassNames(variants, className, 'box');\n\n return (\n <>\n <Component\n {...getBaseProps()}\n className={classNames.box}\n data-invalid={invalid}\n data-required={required}\n data-testid={testId}\n >\n <VisuallyHidden>\n <input\n ref={ref}\n aria-label={typeof label === 'string' ? label : name}\n checked={!!field.value}\n name={name}\n tabIndex={-1}\n type=\"checkbox\"\n onChange={(e) => {\n onChange(e.target.checked);\n }}\n onFocus={() => {\n // When RHF focuses this hidden input (e.g., on validation error),\n // forward focus to the visual switch to show focus ring\n visualSwitchRef.current?.focus();\n }}\n />\n {/* Visual switch input for focus ring */}\n <input\n ref={visualSwitchRef}\n {...getInputProps()}\n onBlur={(e) => {\n // Call HeroUI's internal onBlur to clear focus state and remove focus ring\n getInputProps().onBlur?.(e);\n // Then call RHF's onBlur to mark field as touched\n onBlur();\n }}\n />\n </VisuallyHidden>\n {!icon ? (\n <span\n {...getWrapperProps()}\n className={cn(getWrapperProps().className, classNames.wrapper)}\n >\n <span className={cn(slots.thumb({ class: classNames.thumb }))}>\n {thumbIcon && typeof thumbIcon === 'function'\n ? thumbIcon({\n isSelected: !!isSelected,\n className: slots.thumbIcon({ class: classNames.thumbIcon }),\n width: '1em',\n height: '1em',\n 'data-checked': isSelected ? 'true' : 'false',\n })\n : thumbIcon}\n </span>\n </span>\n ) : null}\n {icon ? <div className={classNames.icon}>{icon}</div> : null}\n <div className=\"grow\">\n {label ? <div className={classNames.label}>{label}</div> : null}\n {description ? (\n <div className={classNames.description}>{description}</div>\n ) : null}\n </div>\n {icon ? (\n <span\n {...getWrapperProps()}\n className={cn(getWrapperProps().className, classNames.wrapper)}\n >\n <span className={cn(slots.thumb({ class: classNames.thumb }))}>\n {thumbIcon && typeof thumbIcon === 'function'\n ? thumbIcon({\n isSelected: !!isSelected,\n className: slots.thumbIcon({ class: classNames.thumbIcon }),\n width: '1em',\n height: '1em',\n 'data-checked': isSelected ? 'true' : 'false',\n })\n : thumbIcon}\n </span>\n </span>\n ) : null}\n </Component>\n {invalid ? (\n <div\n {...getHelperWrapperProps()}\n className={cn(\n getHelperWrapperProps()?.className,\n // force helper to be visible (for some reason it's hidden by default) and remove margin\n 'ml-0 block',\n )}\n >\n <div {...getErrorMessageProps()}>{errorMessage}</div>\n </div>\n ) : null}\n </>\n );\n};\n\nexport default SwitchBox;\n","import SwitchBox from './SwitchBox';\n\nexport type { SwitchBoxProps } from './SwitchBox';\n\nexport { switchBoxVariants } from './SwitchBox';\n\nexport { SwitchBox };\n\nexport default SwitchBox;\n"],"mappings":";;;;;;;AAaA,MAAa,oBAAoB,GAAG;CAClC,OAAO;EACL,KAAK;EACL,aAAa;EACb,MAAM;EACN,OACE;EACF,SAAS;EACT,OAAO;EACP,WAAW;CACb;CACA,UAAU;EACR,YAAY,EACV,MAAM,EACJ,KAAK,uCACP,EACF;EACA,WAAW,EACT,MAAM;GACJ,KAAK;GACL,OAAO;EACT,EACF;EACA,MAAM;GACJ,IAAI;IACF,KAAK;IACL,aAAa;IACb,OAAO;GACT;GACA,IAAI;IACF,KAAK;IACL,aAAa;IACb,OAAO;GACT;GACA,IAAI;IACF,KAAK;IACL,aAAa;IACb,OAAO;GACT;EACF;CACF;CACA,iBAAiB,EACf,MAAM,KACR;AACF,CAAC;;;;AA8BD,MAAM,aAAa,EACjB,YAAY,KAAA,GACZ,cAAc,KAAA,GACd,OAAO,KAAA,GACP,MACA,OAAO,KAAA,GACP,YAAY,KAAA,GACZ,GAAG,wBACiB;CACpB,MAAM,EACJ,cACA,UACA,cACA,OACA,sBACA,uBACA,SACA,OACA,QACA,UACA,KACA,UACA,WACE,gBAAgB;EAClB;EACA,GAAG;CACL,CAAC;CAGD,MAAM,kBAAkB,OAAyB,IAAI;CAGrD,MAAM,EACJ,WACA,OACA,YACA,cACA,eACA,oBACE,UAAU;EACZ,iBAAiB,CAAC,CAAC;EACnB,YAAY;EACZ,YAAY,CAAC,CAAC,MAAM;EACpB,MAAM,GAAG,KAAK;EACd,eAAe;EACf;EACA;CACF,CAAC;CAQD,MAAM,aAAa,qBALF,kBAAkB;EACjC,YAAY;EACZ,WAAW;EACX;CACF,CAC+C,GAAG,WAAW,KAAK;CAElE,OACE,qBAAA,UAAA,EAAA,UAAA,CACE,qBAAC,WAAD;EACE,GAAI,aAAa;EACjB,WAAW,WAAW;EACtB,gBAAc;EACd,iBAAe;EACf,eAAa;YALf;GAOE,qBAAC,gBAAD,EAAA,UAAA,CACE,oBAAC,SAAD;IACO;IACL,cAAY,OAAO,UAAU,WAAW,QAAQ;IAChD,SAAS,CAAC,CAAC,MAAM;IACX;IACN,UAAU;IACV,MAAK;IACL,WAAW,MAAM;KACf,SAAS,EAAE,OAAO,OAAO;IAC3B;IACA,eAAe;KAGb,gBAAgB,SAAS,MAAM;IACjC;GACD,CAAA,GAED,oBAAC,SAAD;IACE,KAAK;IACL,GAAI,cAAc;IAClB,SAAS,MAAM;KAEb,cAAc,EAAE,SAAS,CAAC;KAE1B,OAAO;IACT;GACD,CAAA,CACa,EAAA,CAAA;GACf,CAAC,OACA,oBAAC,QAAD;IACE,GAAI,gBAAgB;IACpB,WAAW,GAAG,gBAAgB,EAAE,WAAW,WAAW,OAAO;cAE7D,oBAAC,QAAD;KAAM,WAAW,GAAG,MAAM,MAAM,EAAE,OAAO,WAAW,MAAM,CAAC,CAAC;eACzD,aAAa,OAAO,cAAc,aAC/B,UAAU;MACR,YAAY,CAAC,CAAC;MACd,WAAW,MAAM,UAAU,EAAE,OAAO,WAAW,UAAU,CAAC;MAC1D,OAAO;MACP,QAAQ;MACR,gBAAgB,aAAa,SAAS;KACxC,CAAC,IACD;IACA,CAAA;GACF,CAAA,IACJ;GACH,OAAO,oBAAC,OAAD;IAAK,WAAW,WAAW;cAAO;GAAU,CAAA,IAAI;GACxD,qBAAC,OAAD;IAAK,WAAU;cAAf,CACG,QAAQ,oBAAC,OAAD;KAAK,WAAW,WAAW;eAAQ;IAAW,CAAA,IAAI,MAC1D,cACC,oBAAC,OAAD;KAAK,WAAW,WAAW;eAAc;IAAiB,CAAA,IACxD,IACD;;GACJ,OACC,oBAAC,QAAD;IACE,GAAI,gBAAgB;IACpB,WAAW,GAAG,gBAAgB,EAAE,WAAW,WAAW,OAAO;cAE7D,oBAAC,QAAD;KAAM,WAAW,GAAG,MAAM,MAAM,EAAE,OAAO,WAAW,MAAM,CAAC,CAAC;eACzD,aAAa,OAAO,cAAc,aAC/B,UAAU;MACR,YAAY,CAAC,CAAC;MACd,WAAW,MAAM,UAAU,EAAE,OAAO,WAAW,UAAU,CAAC;MAC1D,OAAO;MACP,QAAQ;MACR,gBAAgB,aAAa,SAAS;KACxC,CAAC,IACD;IACA,CAAA;GACF,CAAA,IACJ;EACK;KACV,UACC,oBAAC,OAAD;EACE,GAAI,sBAAsB;EAC1B,WAAW,GACT,sBAAsB,GAAG,WAEzB,YACF;YAEA,oBAAC,OAAD;GAAK,GAAI,qBAAqB;aAAI;EAAkB,CAAA;CACjD,CAAA,IACH,IACJ,EAAA,CAAA;AAEN;;;ACxOA,IAAA,oBAAe"}
|
|
@@ -1,171 +0,0 @@
|
|
|
1
|
-
require("./FormContext-DsmS_mkO.cjs");
|
|
2
|
-
const require_hooks_useUniformField_index = require("./hooks/useUniformField/index.cjs");
|
|
3
|
-
let _fuf_stack_pixel_utils = require("@fuf-stack/pixel-utils");
|
|
4
|
-
let react = require("react");
|
|
5
|
-
let react_jsx_runtime = require("react/jsx-runtime");
|
|
6
|
-
let _react_aria_visually_hidden = require("@react-aria/visually-hidden");
|
|
7
|
-
let _heroui_switch = require("@heroui/switch");
|
|
8
|
-
//#region src/SwitchBox/SwitchBox.tsx
|
|
9
|
-
const switchBoxVariants = (0, _fuf_stack_pixel_utils.tv)({
|
|
10
|
-
slots: {
|
|
11
|
-
box: "group inline-flex w-full cursor-pointer items-center justify-between rounded-lg border-2 border-default hover:bg-content2 data-[selected=true]:border-focus",
|
|
12
|
-
description: "text-foreground opacity-70",
|
|
13
|
-
icon: "",
|
|
14
|
-
label: "font-medium text-foreground group-data-[required=true]:after:ml-0.5 group-data-[required=true]:after:text-danger group-data-[required=true]:after:content-[\"*\"]",
|
|
15
|
-
wrapper: "",
|
|
16
|
-
thumb: "",
|
|
17
|
-
thumbIcon: ""
|
|
18
|
-
},
|
|
19
|
-
variants: {
|
|
20
|
-
isDisabled: { true: { box: "pointer-events-none opacity-disabled" } },
|
|
21
|
-
isInvalid: { true: {
|
|
22
|
-
box: "!border-danger",
|
|
23
|
-
label: "!text-danger"
|
|
24
|
-
} },
|
|
25
|
-
size: {
|
|
26
|
-
sm: {
|
|
27
|
-
box: "gap-2 p-3",
|
|
28
|
-
description: "text-xs",
|
|
29
|
-
label: "text-xs"
|
|
30
|
-
},
|
|
31
|
-
md: {
|
|
32
|
-
box: "gap-4 p-4",
|
|
33
|
-
description: "text-small",
|
|
34
|
-
label: "text-sm"
|
|
35
|
-
},
|
|
36
|
-
lg: {
|
|
37
|
-
box: "gap-4 p-5",
|
|
38
|
-
description: "text-small",
|
|
39
|
-
label: "text-base"
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
defaultVariants: { size: "md" }
|
|
44
|
-
});
|
|
45
|
-
/**
|
|
46
|
-
* SwitchBox component - A card-like box with a switch control
|
|
47
|
-
*/
|
|
48
|
-
const SwitchBox = ({ className = void 0, description = void 0, icon = void 0, name, size = void 0, thumbIcon = void 0, ...uniformFieldProps }) => {
|
|
49
|
-
const { defaultValue, disabled, errorMessage, field, getErrorMessageProps, getHelperWrapperProps, invalid, label, onBlur, onChange, ref, required, testId } = require_hooks_useUniformField_index.useUniformField({
|
|
50
|
-
name,
|
|
51
|
-
...uniformFieldProps
|
|
52
|
-
});
|
|
53
|
-
const visualSwitchRef = (0, react.useRef)(null);
|
|
54
|
-
const { Component, slots, isSelected, getBaseProps, getInputProps, getWrapperProps } = (0, _heroui_switch.useSwitch)({
|
|
55
|
-
defaultSelected: !!defaultValue,
|
|
56
|
-
isDisabled: disabled,
|
|
57
|
-
isSelected: !!field.value,
|
|
58
|
-
name: `${name}_switch`,
|
|
59
|
-
onValueChange: onChange,
|
|
60
|
-
size,
|
|
61
|
-
thumbIcon
|
|
62
|
-
});
|
|
63
|
-
const classNames = (0, _fuf_stack_pixel_utils.variantsToClassNames)(switchBoxVariants({
|
|
64
|
-
isDisabled: disabled,
|
|
65
|
-
isInvalid: invalid,
|
|
66
|
-
size
|
|
67
|
-
}), className, "box");
|
|
68
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(Component, {
|
|
69
|
-
...getBaseProps(),
|
|
70
|
-
className: classNames.box,
|
|
71
|
-
"data-invalid": invalid,
|
|
72
|
-
"data-required": required,
|
|
73
|
-
"data-testid": testId,
|
|
74
|
-
children: [
|
|
75
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_react_aria_visually_hidden.VisuallyHidden, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
76
|
-
ref,
|
|
77
|
-
"aria-label": typeof label === "string" ? label : name,
|
|
78
|
-
checked: !!field.value,
|
|
79
|
-
name,
|
|
80
|
-
tabIndex: -1,
|
|
81
|
-
type: "checkbox",
|
|
82
|
-
onChange: (e) => {
|
|
83
|
-
onChange(e.target.checked);
|
|
84
|
-
},
|
|
85
|
-
onFocus: () => {
|
|
86
|
-
visualSwitchRef.current?.focus();
|
|
87
|
-
}
|
|
88
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
89
|
-
ref: visualSwitchRef,
|
|
90
|
-
...getInputProps(),
|
|
91
|
-
onBlur: (e) => {
|
|
92
|
-
getInputProps().onBlur?.(e);
|
|
93
|
-
onBlur();
|
|
94
|
-
}
|
|
95
|
-
})] }),
|
|
96
|
-
!icon ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
97
|
-
...getWrapperProps(),
|
|
98
|
-
className: (0, _fuf_stack_pixel_utils.cn)(getWrapperProps().className, classNames.wrapper),
|
|
99
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
100
|
-
className: (0, _fuf_stack_pixel_utils.cn)(slots.thumb({ class: classNames.thumb })),
|
|
101
|
-
children: thumbIcon && typeof thumbIcon === "function" ? thumbIcon({
|
|
102
|
-
isSelected: !!isSelected,
|
|
103
|
-
className: slots.thumbIcon({ class: classNames.thumbIcon }),
|
|
104
|
-
width: "1em",
|
|
105
|
-
height: "1em",
|
|
106
|
-
"data-checked": isSelected ? "true" : "false"
|
|
107
|
-
}) : thumbIcon
|
|
108
|
-
})
|
|
109
|
-
}) : null,
|
|
110
|
-
icon ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
111
|
-
className: classNames.icon,
|
|
112
|
-
children: icon
|
|
113
|
-
}) : null,
|
|
114
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
115
|
-
className: "grow",
|
|
116
|
-
children: [label ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
117
|
-
className: classNames.label,
|
|
118
|
-
children: label
|
|
119
|
-
}) : null, description ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
120
|
-
className: classNames.description,
|
|
121
|
-
children: description
|
|
122
|
-
}) : null]
|
|
123
|
-
}),
|
|
124
|
-
icon ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
125
|
-
...getWrapperProps(),
|
|
126
|
-
className: (0, _fuf_stack_pixel_utils.cn)(getWrapperProps().className, classNames.wrapper),
|
|
127
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
128
|
-
className: (0, _fuf_stack_pixel_utils.cn)(slots.thumb({ class: classNames.thumb })),
|
|
129
|
-
children: thumbIcon && typeof thumbIcon === "function" ? thumbIcon({
|
|
130
|
-
isSelected: !!isSelected,
|
|
131
|
-
className: slots.thumbIcon({ class: classNames.thumbIcon }),
|
|
132
|
-
width: "1em",
|
|
133
|
-
height: "1em",
|
|
134
|
-
"data-checked": isSelected ? "true" : "false"
|
|
135
|
-
}) : thumbIcon
|
|
136
|
-
})
|
|
137
|
-
}) : null
|
|
138
|
-
]
|
|
139
|
-
}), invalid ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
140
|
-
...getHelperWrapperProps(),
|
|
141
|
-
className: (0, _fuf_stack_pixel_utils.cn)(getHelperWrapperProps()?.className, "ml-0 block"),
|
|
142
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
143
|
-
...getErrorMessageProps(),
|
|
144
|
-
children: errorMessage
|
|
145
|
-
})
|
|
146
|
-
}) : null] });
|
|
147
|
-
};
|
|
148
|
-
//#endregion
|
|
149
|
-
//#region src/SwitchBox/index.ts
|
|
150
|
-
var SwitchBox_default = SwitchBox;
|
|
151
|
-
//#endregion
|
|
152
|
-
Object.defineProperty(exports, "SwitchBox", {
|
|
153
|
-
enumerable: true,
|
|
154
|
-
get: function() {
|
|
155
|
-
return SwitchBox;
|
|
156
|
-
}
|
|
157
|
-
});
|
|
158
|
-
Object.defineProperty(exports, "SwitchBox_default", {
|
|
159
|
-
enumerable: true,
|
|
160
|
-
get: function() {
|
|
161
|
-
return SwitchBox_default;
|
|
162
|
-
}
|
|
163
|
-
});
|
|
164
|
-
Object.defineProperty(exports, "switchBoxVariants", {
|
|
165
|
-
enumerable: true,
|
|
166
|
-
get: function() {
|
|
167
|
-
return switchBoxVariants;
|
|
168
|
-
}
|
|
169
|
-
});
|
|
170
|
-
|
|
171
|
-
//# sourceMappingURL=SwitchBox-Dl-F5y2m.cjs.map
|