@fuf-stack/uniform 1.22.4 → 1.22.5
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 +2 -1
- package/dist/Checkboxes/index.d.cts +2 -2
- package/dist/Checkboxes/index.d.ts +2 -2
- package/dist/Checkboxes/index.js +2 -2
- package/dist/{Checkboxes-DHk09GmH.cjs → Checkboxes-DrJqx6O2.cjs} +7 -1
- package/dist/{Checkboxes-DHk09GmH.cjs.map → Checkboxes-DrJqx6O2.cjs.map} +1 -1
- package/dist/{Checkboxes-D1hppxDE.js → Checkboxes-X6FRwI50.js} +2 -2
- package/dist/{Checkboxes-D1hppxDE.js.map → Checkboxes-X6FRwI50.js.map} +1 -1
- package/dist/DatePicker/index.cjs +2 -1
- package/dist/DatePicker/index.d.cts +2 -2
- package/dist/DatePicker/index.d.ts +2 -2
- package/dist/DatePicker/index.js +2 -2
- package/dist/{DatePicker-BUSi8SWQ.js → DatePicker-CGIWizz9.js} +2 -2
- package/dist/{DatePicker-BUSi8SWQ.js.map → DatePicker-CGIWizz9.js.map} +1 -1
- package/dist/{DatePicker-DuBjvS5g.cjs → DatePicker-CYUuwwsm.cjs} +7 -1
- package/dist/{DatePicker-DuBjvS5g.cjs.map → DatePicker-CYUuwwsm.cjs.map} +1 -1
- package/dist/FieldArray/index.cjs +2 -1
- package/dist/FieldArray/index.d.cts +2 -2
- package/dist/FieldArray/index.d.ts +2 -2
- package/dist/FieldArray/index.js +2 -2
- package/dist/{FieldArray-BxmK1NRd.js → FieldArray-Dkw6JBnT.js} +2 -2
- package/dist/{FieldArray-BxmK1NRd.js.map → FieldArray-Dkw6JBnT.js.map} +1 -1
- package/dist/{FieldArray-DgiQpIdr.cjs → FieldArray-V66fsvtd.cjs} +7 -1
- package/dist/{FieldArray-DgiQpIdr.cjs.map → FieldArray-V66fsvtd.cjs.map} +1 -1
- package/dist/FieldCard/index.cjs +6 -2
- package/dist/FieldCard/index.d.cts +2 -2
- package/dist/FieldCard/index.d.ts +2 -2
- package/dist/FieldCard/index.js +2 -2
- package/dist/{FieldCard-C-DZ5ARr.cjs → FieldCard-CAHnM8C0.cjs} +10 -1
- package/dist/FieldCard-CAHnM8C0.cjs.map +1 -0
- package/dist/{FieldCard-BK6SNqFY.js → FieldCard-Cg31ce9J.js} +5 -2
- package/dist/FieldCard-Cg31ce9J.js.map +1 -0
- package/dist/Input/index.d.cts +1 -1
- package/dist/Input/index.d.ts +1 -1
- package/dist/RadioBoxes/index.cjs +1 -1
- package/dist/RadioBoxes/index.d.cts +2 -2
- package/dist/RadioBoxes/index.d.ts +2 -2
- package/dist/RadioBoxes/index.js +1 -1
- package/dist/{RadioBoxes-CR--FBhQ.cjs → RadioBoxes-BmLrbYXt.cjs} +3 -3
- package/dist/RadioBoxes-BmLrbYXt.cjs.map +1 -0
- package/dist/{RadioBoxes-BJz-aJp3.js → RadioBoxes-DWxJBTKR.js} +3 -3
- package/dist/RadioBoxes-DWxJBTKR.js.map +1 -0
- package/dist/RadioTabs/index.cjs +2 -1
- package/dist/RadioTabs/index.d.cts +2 -2
- package/dist/RadioTabs/index.d.ts +2 -2
- package/dist/RadioTabs/index.js +2 -2
- package/dist/{RadioTabs-Btt582Nl.cjs → RadioTabs-14XTbTJU.cjs} +20 -14
- package/dist/RadioTabs-14XTbTJU.cjs.map +1 -0
- package/dist/{RadioTabs-CYmzrPBG.js → RadioTabs-DAY6MYJI.js} +15 -15
- package/dist/RadioTabs-DAY6MYJI.js.map +1 -0
- package/dist/Radios/index.cjs +2 -1
- package/dist/Radios/index.d.cts +2 -2
- package/dist/Radios/index.d.ts +2 -2
- package/dist/Radios/index.js +2 -2
- package/dist/{Radios-DZxhrX96.js → Radios-C938-msm.js} +2 -2
- package/dist/{Radios-DZxhrX96.js.map → Radios-C938-msm.js.map} +1 -1
- package/dist/{Radios-Jg9mwE0B.cjs → Radios-D_B9Y8s2.cjs} +7 -1
- package/dist/{Radios-Jg9mwE0B.cjs.map → Radios-D_B9Y8s2.cjs.map} +1 -1
- package/dist/Select/index.cjs +2 -1
- package/dist/Select/index.d.cts +2 -2
- package/dist/Select/index.d.ts +2 -2
- package/dist/Select/index.js +2 -2
- package/dist/{Select-CgeqhZIC.js → Select-BL6k_e-D.js} +2 -2
- package/dist/Select-BL6k_e-D.js.map +1 -0
- package/dist/{Select-CZwuEAB5.cjs → Select-D66A-hYm.cjs} +7 -1
- package/dist/Select-D66A-hYm.cjs.map +1 -0
- package/dist/Slider/index.cjs +2 -1
- package/dist/Slider/index.d.cts +2 -2
- package/dist/Slider/index.d.ts +2 -2
- package/dist/Slider/index.js +2 -2
- package/dist/{Slider-Bpxt-Qgj.cjs → Slider-ChC2PZNb.cjs} +7 -1
- package/dist/{Slider-Bpxt-Qgj.cjs.map → Slider-ChC2PZNb.cjs.map} +1 -1
- package/dist/{Slider-DRfSw0uE.js → Slider-DmEwhC1T.js} +2 -2
- package/dist/{Slider-DRfSw0uE.js.map → Slider-DmEwhC1T.js.map} +1 -1
- package/dist/Switch/index.cjs +2 -1
- package/dist/Switch/index.d.cts +2 -2
- package/dist/Switch/index.d.ts +2 -2
- package/dist/Switch/index.js +2 -2
- package/dist/{Switch-hjjy34QB.cjs → Switch-Ch6_VInV.cjs} +7 -1
- package/dist/{Switch-hjjy34QB.cjs.map → Switch-Ch6_VInV.cjs.map} +1 -1
- package/dist/{Switch-D9DNrqmj.js → Switch-DvKRPFcC.js} +2 -2
- package/dist/{Switch-D9DNrqmj.js.map → Switch-DvKRPFcC.js.map} +1 -1
- package/dist/SwitchBox/index.d.cts +1 -1
- package/dist/SwitchBox/index.d.ts +1 -1
- package/dist/SwitchBox-BU1XieaZ.js.map +1 -1
- package/dist/SwitchBox-Dl-F5y2m.cjs.map +1 -1
- package/dist/TextArea/index.d.cts +1 -1
- package/dist/TextArea/index.d.ts +1 -1
- package/dist/Time/index.cjs +7 -2
- package/dist/Time/index.d.cts +2 -2
- package/dist/Time/index.d.ts +2 -2
- package/dist/Time/index.js +2 -2
- package/dist/{Time-CDptQ3CK.js → Time-B_SXrKWK.js} +5 -2
- package/dist/Time-B_SXrKWK.js.map +1 -0
- package/dist/{Time-WKgbji5k.cjs → Time-CYoWaQsz.cjs} +16 -1
- package/dist/Time-CYoWaQsz.cjs.map +1 -0
- package/dist/hooks/useFormContext/index.d.cts +1 -1
- package/dist/hooks/useFormContext/index.d.ts +1 -1
- package/dist/hooks/useUniformField/index.d.cts +1 -1
- package/dist/hooks/useUniformField/index.d.ts +1 -1
- package/dist/hooks/useUniformFieldArray/index.d.cts +1 -1
- package/dist/hooks/useUniformFieldArray/index.d.ts +1 -1
- package/dist/index-19JGtN7H.d.cts +1257 -0
- package/dist/index-19JGtN7H.d.cts.map +1 -0
- package/dist/index-B4XExHDi.d.cts +539 -0
- package/dist/index-B4XExHDi.d.cts.map +1 -0
- package/dist/index-BUZEnZDm.d.ts +1760 -0
- package/dist/index-BUZEnZDm.d.ts.map +1 -0
- package/dist/index-Bbaubtxp.d.cts +677 -0
- package/dist/index-Bbaubtxp.d.cts.map +1 -0
- package/dist/index-BdgFJ-dj.d.ts +1028 -0
- package/dist/index-BdgFJ-dj.d.ts.map +1 -0
- package/dist/index-BiZNkLK3.d.cts +1477 -0
- package/dist/index-BiZNkLK3.d.cts.map +1 -0
- package/dist/index-Bie3CWyW.d.cts +1760 -0
- package/dist/index-Bie3CWyW.d.cts.map +1 -0
- package/dist/index-BsTqcI1C.d.cts +659 -0
- package/dist/index-BsTqcI1C.d.cts.map +1 -0
- package/dist/index-C6Y8KybK.d.ts +677 -0
- package/dist/index-C6Y8KybK.d.ts.map +1 -0
- package/dist/index-CD0Wpla3.d.cts +1413 -0
- package/dist/index-CD0Wpla3.d.cts.map +1 -0
- package/dist/index-CUByIf_d.d.ts +314 -0
- package/dist/index-CUByIf_d.d.ts.map +1 -0
- package/dist/index-Cf2B9woY.d.cts +473 -0
- package/dist/index-Cf2B9woY.d.cts.map +1 -0
- package/dist/index-CqXEYILn.d.cts +1263 -0
- package/dist/index-CqXEYILn.d.cts.map +1 -0
- package/dist/index-D1cB3mbB.d.ts +3917 -0
- package/dist/index-D1cB3mbB.d.ts.map +1 -0
- package/dist/index-D7AUghFx.d.ts +1413 -0
- package/dist/index-D7AUghFx.d.ts.map +1 -0
- package/dist/index-DCwffq1f.d.ts +1263 -0
- package/dist/index-DCwffq1f.d.ts.map +1 -0
- package/dist/index-DFbuWomg.d.ts +534 -0
- package/dist/index-DFbuWomg.d.ts.map +1 -0
- package/dist/index-DXOBPBft.d.ts +659 -0
- package/dist/index-DXOBPBft.d.ts.map +1 -0
- package/dist/index-DY-d4cFe.d.cts +1028 -0
- package/dist/index-DY-d4cFe.d.cts.map +1 -0
- package/dist/index-DqMpHpu7.d.ts +1257 -0
- package/dist/index-DqMpHpu7.d.ts.map +1 -0
- package/dist/index-DwnqyNnX.d.cts +534 -0
- package/dist/index-DwnqyNnX.d.cts.map +1 -0
- package/dist/index-OdNTqjhQ.d.ts +585 -0
- package/dist/index-OdNTqjhQ.d.ts.map +1 -0
- package/dist/index-QPDvw5Z5.d.cts +585 -0
- package/dist/index-QPDvw5Z5.d.cts.map +1 -0
- package/dist/index-amMd-sQN.d.ts +473 -0
- package/dist/index-amMd-sQN.d.ts.map +1 -0
- package/dist/index-clztdahp.d.ts +1477 -0
- package/dist/index-clztdahp.d.ts.map +1 -0
- package/dist/index-jK092-MJ.d.cts +314 -0
- package/dist/index-jK092-MJ.d.cts.map +1 -0
- package/dist/index-veBM95Gw.d.cts +3917 -0
- package/dist/index-veBM95Gw.d.cts.map +1 -0
- package/dist/index-yYjVSHlN.d.ts +539 -0
- package/dist/index-yYjVSHlN.d.ts.map +1 -0
- package/dist/index.cjs +20 -11
- package/dist/index.d.cts +18 -18
- package/dist/index.d.ts +18 -18
- package/dist/index.js +12 -12
- package/dist/{useFormContext-CpLVpNAf.d.ts → useFormContext-Bj1gXLt_.d.ts} +3 -3
- package/dist/{useFormContext-CpLVpNAf.d.ts.map → useFormContext-Bj1gXLt_.d.ts.map} +1 -1
- package/dist/{useFormContext-Ddc1HWKv.d.cts → useFormContext-M94eQfHm.d.cts} +3 -3
- package/dist/{useFormContext-Ddc1HWKv.d.cts.map → useFormContext-M94eQfHm.d.cts.map} +1 -1
- package/dist/{useUniformField-CmAYcGER.d.cts → useUniformField-BE-e3C4Y.d.cts} +2 -2
- package/dist/{useUniformField-CmAYcGER.d.cts.map → useUniformField-BE-e3C4Y.d.cts.map} +1 -1
- package/dist/{useUniformField-DJDpQzRo.d.ts → useUniformField-DUW-svZD.d.ts} +2 -2
- package/dist/{useUniformField-DJDpQzRo.d.ts.map → useUniformField-DUW-svZD.d.ts.map} +1 -1
- package/dist/{useUniformFieldArray-zGcIhwhF.d.ts → useUniformFieldArray-CdWv1SEk.d.ts} +2 -2
- package/dist/{useUniformFieldArray-zGcIhwhF.d.ts.map → useUniformFieldArray-CdWv1SEk.d.ts.map} +1 -1
- package/dist/{useUniformFieldArray-D3fdzwzD.d.cts → useUniformFieldArray-kkOHxNFF.d.cts} +2 -2
- package/dist/{useUniformFieldArray-D3fdzwzD.d.cts.map → useUniformFieldArray-kkOHxNFF.d.cts.map} +1 -1
- package/package.json +6 -6
- package/dist/FieldCard-BK6SNqFY.js.map +0 -1
- package/dist/FieldCard-C-DZ5ARr.cjs.map +0 -1
- package/dist/RadioBoxes-BJz-aJp3.js.map +0 -1
- package/dist/RadioBoxes-CR--FBhQ.cjs.map +0 -1
- package/dist/RadioTabs-Btt582Nl.cjs.map +0 -1
- package/dist/RadioTabs-CYmzrPBG.js.map +0 -1
- package/dist/Select-CZwuEAB5.cjs.map +0 -1
- package/dist/Select-CgeqhZIC.js.map +0 -1
- package/dist/Time-CDptQ3CK.js.map +0 -1
- package/dist/Time-WKgbji5k.cjs.map +0 -1
- package/dist/index-7UT2Ki5e.d.cts +0 -113
- package/dist/index-7UT2Ki5e.d.cts.map +0 -1
- package/dist/index-9_3XTDJC.d.cts +0 -174
- package/dist/index-9_3XTDJC.d.cts.map +0 -1
- package/dist/index-B5SfdA5O.d.cts +0 -99
- package/dist/index-B5SfdA5O.d.cts.map +0 -1
- package/dist/index-B61zRzeS.d.cts +0 -101
- package/dist/index-B61zRzeS.d.cts.map +0 -1
- package/dist/index-B7gQppgQ.d.ts +0 -116
- package/dist/index-B7gQppgQ.d.ts.map +0 -1
- package/dist/index-BDFJDKmz.d.ts +0 -166
- package/dist/index-BDFJDKmz.d.ts.map +0 -1
- package/dist/index-BPaSE_7b.d.ts +0 -179
- package/dist/index-BPaSE_7b.d.ts.map +0 -1
- package/dist/index-BSjcTo7A.d.ts +0 -147
- package/dist/index-BSjcTo7A.d.ts.map +0 -1
- package/dist/index-BmMspnsJ.d.cts +0 -137
- package/dist/index-BmMspnsJ.d.cts.map +0 -1
- package/dist/index-Bzs7_gnk.d.cts +0 -116
- package/dist/index-Bzs7_gnk.d.cts.map +0 -1
- package/dist/index-C4GJH8Xv.d.ts +0 -290
- package/dist/index-C4GJH8Xv.d.ts.map +0 -1
- package/dist/index-CE8fnXuQ.d.ts +0 -167
- package/dist/index-CE8fnXuQ.d.ts.map +0 -1
- package/dist/index-CIiOXrrY.d.ts +0 -99
- package/dist/index-CIiOXrrY.d.ts.map +0 -1
- package/dist/index-C_zjtsGM.d.ts +0 -113
- package/dist/index-C_zjtsGM.d.ts.map +0 -1
- package/dist/index-CbPJiRK2.d.ts +0 -83
- package/dist/index-CbPJiRK2.d.ts.map +0 -1
- package/dist/index-CvP3tbVV.d.ts +0 -137
- package/dist/index-CvP3tbVV.d.ts.map +0 -1
- package/dist/index-Cwb7sTO0.d.ts +0 -154
- package/dist/index-Cwb7sTO0.d.ts.map +0 -1
- package/dist/index-CxY9VWv5.d.cts +0 -154
- package/dist/index-CxY9VWv5.d.cts.map +0 -1
- package/dist/index-D8udSkgA.d.cts +0 -167
- package/dist/index-D8udSkgA.d.cts.map +0 -1
- package/dist/index-DBsF7xsq.d.cts +0 -147
- package/dist/index-DBsF7xsq.d.cts.map +0 -1
- package/dist/index-DNADTCoc.d.cts +0 -290
- package/dist/index-DNADTCoc.d.cts.map +0 -1
- package/dist/index-DRg0anjB.d.cts +0 -179
- package/dist/index-DRg0anjB.d.cts.map +0 -1
- package/dist/index-DUmNI6cE.d.cts +0 -83
- package/dist/index-DUmNI6cE.d.cts.map +0 -1
- package/dist/index-Db0WD4d1.d.cts +0 -166
- package/dist/index-Db0WD4d1.d.cts.map +0 -1
- package/dist/index-GxTY7aAc.d.ts +0 -174
- package/dist/index-GxTY7aAc.d.ts.map +0 -1
- package/dist/index-PMCqBX0t.d.ts +0 -101
- package/dist/index-PMCqBX0t.d.ts.map +0 -1
- package/dist/index-QgVr4iWX.d.cts +0 -122
- package/dist/index-QgVr4iWX.d.cts.map +0 -1
- package/dist/index-dgho7gpc.d.ts +0 -122
- package/dist/index-dgho7gpc.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-yYjVSHlN.d.ts","names":[],"sources":["../src/FieldArray/subcomponents/FieldArrayElement.tsx","../src/FieldArray/types.ts","../src/FieldArray/FieldArray.tsx"],"mappings":";;;;UAiBiB,wBAAA;;EAEf,MAAA;EAFuC;EAIvC,SAAA;EAJuC;EAMvC,MAAA;EAFA;EAIA,MAAA;AAAA;;;KCpBG,YAAA,GAAe,OAAO,QAAQ,kBAAA;AAAA,KAC9B,SAAA,GAAY,WAAW,QAAQ,kBAAA;;KAGxB,0BAAA,IAA8B,IAAA;EDUxC,sDCRA,KAAA,UDYA;ECVA,MAAA,UDYM;ECVN,OAAA,EAAS,wBAAA;EAET,IAAA;EAEA,MAAA;AAAA,MACI,GAAA,CAAI,OAAO;AAAA,UAEA,kBAAA;EAjBG;EAmBlB,SAAA;EAlBG;EAoBH,WAAA;;EAEA,QAAA;AAAA;AAAA,UAGe,eAAA,SAAwB,kBAAA,EAAoB,YAAA;EAtBvB;EAwBpC,gBAAA;EAbe;EAef,QAAA,EAAU,0BAAA;EAtBV;EAwBA,SAAA,GAAY,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AA;EAAA,GAAA;AAAA,GAajB,eAAA,iCAAe,GAAA,CAAA,OAAA"}
|
package/dist/index.cjs
CHANGED
|
@@ -7,26 +7,26 @@ const require_useController = require("./useController--lRPWBuD.cjs");
|
|
|
7
7
|
const require_useFormContext = require("./useFormContext-CrXwNYiB.cjs");
|
|
8
8
|
const require_useInputValueTransform = require("./useInputValueTransform-Bm65K8LX.cjs");
|
|
9
9
|
const require_hooks_useUniformField_index = require("./hooks/useUniformField/index.cjs");
|
|
10
|
-
const require_Checkboxes = require("./Checkboxes-
|
|
11
|
-
const require_DatePicker = require("./DatePicker-
|
|
10
|
+
const require_Checkboxes = require("./Checkboxes-DrJqx6O2.cjs");
|
|
11
|
+
const require_DatePicker = require("./DatePicker-CYUuwwsm.cjs");
|
|
12
12
|
const require_hooks_useWatchFormReset_index = require("./hooks/useWatchFormReset/index.cjs");
|
|
13
13
|
const require_hooks_useUniformFieldArray_index = require("./hooks/useUniformFieldArray/index.cjs");
|
|
14
|
-
const require_FieldArray = require("./FieldArray-
|
|
14
|
+
const require_FieldArray = require("./FieldArray-V66fsvtd.cjs");
|
|
15
15
|
const require_Grid = require("./Grid-D-VcRGi9.cjs");
|
|
16
|
-
const require_FieldCard = require("./FieldCard-
|
|
16
|
+
const require_FieldCard = require("./FieldCard-CAHnM8C0.cjs");
|
|
17
17
|
const require_Form = require("./Form-CYlsIABv.cjs");
|
|
18
18
|
const require_hooks_useInputValueDebounce_index = require("./hooks/useInputValueDebounce/index.cjs");
|
|
19
19
|
const require_Input = require("./Input-DvVViuWH.cjs");
|
|
20
|
-
const require_RadioBoxes = require("./RadioBoxes-
|
|
21
|
-
const require_RadioTabs = require("./RadioTabs-
|
|
22
|
-
const require_Radios = require("./Radios-
|
|
23
|
-
const require_Select = require("./Select-
|
|
24
|
-
const require_Slider = require("./Slider-
|
|
20
|
+
const require_RadioBoxes = require("./RadioBoxes-BmLrbYXt.cjs");
|
|
21
|
+
const require_RadioTabs = require("./RadioTabs-14XTbTJU.cjs");
|
|
22
|
+
const require_Radios = require("./Radios-D_B9Y8s2.cjs");
|
|
23
|
+
const require_Select = require("./Select-D66A-hYm.cjs");
|
|
24
|
+
const require_Slider = require("./Slider-ChC2PZNb.cjs");
|
|
25
25
|
const require_SubmitButton = require("./SubmitButton-D-wn1PJV.cjs");
|
|
26
|
-
const require_Switch = require("./Switch-
|
|
26
|
+
const require_Switch = require("./Switch-Ch6_VInV.cjs");
|
|
27
27
|
const require_SwitchBox = require("./SwitchBox-Dl-F5y2m.cjs");
|
|
28
28
|
const require_TextArea = require("./TextArea-CMXm-kTK.cjs");
|
|
29
|
-
const require_Time = require("./Time-
|
|
29
|
+
const require_Time = require("./Time-CYoWaQsz.cjs");
|
|
30
30
|
const require_useClientValidation = require("./useClientValidation-BRfhqRom.cjs");
|
|
31
31
|
const require_useWatchUserChange = require("./useWatchUserChange-C1xWHtFG.cjs");
|
|
32
32
|
let _heroui_input = require("@heroui/input");
|
|
@@ -53,15 +53,24 @@ exports.SwitchBox = require_SwitchBox.SwitchBox;
|
|
|
53
53
|
exports.TextArea = require_TextArea.TextArea;
|
|
54
54
|
exports.Time = require_Time.Time;
|
|
55
55
|
exports.checkFieldIsRequired = require_useFormContext.checkFieldIsRequired;
|
|
56
|
+
exports.checkboxesVariants = require_Checkboxes.checkboxesVariants;
|
|
56
57
|
exports.clientValidationSchemaByName = require_useClientValidation.clientValidationSchemaByName;
|
|
57
58
|
exports.createOptionValueConverter = require_helpers_index.createOptionValueConverter;
|
|
59
|
+
exports.datePickerVariants = require_DatePicker.datePickerVariants;
|
|
60
|
+
exports.fieldArrayVariants = require_FieldArray.fieldArrayVariants;
|
|
58
61
|
exports.fieldCardVariants = require_FieldCard.fieldCardVariants;
|
|
59
62
|
exports.flatArrayKey = require_helpers_index.flatArrayKey;
|
|
60
63
|
exports.fromNullishString = require_helpers_index.fromNullishString;
|
|
61
64
|
exports.isValueEmpty = require_helpers_index.isValueEmpty;
|
|
62
65
|
exports.nameToTestId = require_helpers_index.nameToTestId;
|
|
63
66
|
exports.radioBoxVariants = require_RadioBoxes.radioBoxVariants;
|
|
67
|
+
exports.radioTabsVariants = require_RadioTabs.radioTabsVariants;
|
|
68
|
+
exports.radiosVariants = require_Radios.radiosVariants;
|
|
69
|
+
exports.selectVariants = require_Select.selectVariants;
|
|
70
|
+
exports.sliderVariants = require_Slider.sliderVariants;
|
|
64
71
|
exports.switchBoxVariants = require_SwitchBox.switchBoxVariants;
|
|
72
|
+
exports.switchVariants = require_Switch.switchVariants;
|
|
73
|
+
exports.timeVariants = require_Time.timeVariants;
|
|
65
74
|
exports.toFormFormat = require_helpers_index.toFormFormat;
|
|
66
75
|
exports.toNullishString = require_helpers_index.toNullishString;
|
|
67
76
|
exports.toSubmitFormat = require_helpers_index.toSubmitFormat;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import { i as useInputValueTransform, n as UseInputValueTransformOptions, r as UseInputValueTransformReturn, t as InputValueTransform } from "./useInputValueTransform-CNCBU7a9.cjs";
|
|
2
|
-
import { n as Checkboxes, r as CheckboxesProps, t as CheckboxOption } from "./index-
|
|
3
|
-
import { n as DatePickerProps, t as DatePicker } from "./index-
|
|
4
|
-
import {
|
|
5
|
-
import { n as FieldCardProps, r as fieldCardVariants, t as FieldCard } from "./index-
|
|
2
|
+
import { i as checkboxesVariants, n as Checkboxes, r as CheckboxesProps, t as CheckboxOption } from "./index-DwnqyNnX.cjs";
|
|
3
|
+
import { n as DatePickerProps, r as datePickerVariants, t as DatePicker } from "./index-CD0Wpla3.cjs";
|
|
4
|
+
import { a as FieldArrayProps, i as FieldArrayFeatures, n as fieldArrayVariants, r as FieldArrayChildrenRenderFn, t as FieldArray } from "./index-B4XExHDi.cjs";
|
|
5
|
+
import { n as FieldCardProps, r as fieldCardVariants, t as FieldCard } from "./index-jK092-MJ.cjs";
|
|
6
6
|
import { n as FormProps, t as Form } from "./index-C3-TV4Up.cjs";
|
|
7
7
|
import { n as GridProps, t as Grid } from "./index-BqxDWhNr.cjs";
|
|
8
|
-
import { n as InputProps, t as Input } from "./index-
|
|
9
|
-
import { n as
|
|
10
|
-
import { n as RadioTabsProps, t as
|
|
11
|
-
import { n as RadiosProps, t as
|
|
12
|
-
import { n as SelectProps, t as Select } from "./index-
|
|
13
|
-
import { n as SliderProps, t as Slider } from "./index-
|
|
8
|
+
import { n as InputProps, t as Input } from "./index-Bbaubtxp.cjs";
|
|
9
|
+
import { i as RadioBoxesProps, n as RadioBoxOption, r as RadioBoxes, t as radioBoxVariants } from "./index-BiZNkLK3.cjs";
|
|
10
|
+
import { i as radioTabsVariants, n as RadioTabs, r as RadioTabsProps, t as RadioTabOption } from "./index-QPDvw5Z5.cjs";
|
|
11
|
+
import { i as radiosVariants, n as Radios, r as RadiosProps, t as RadioOption } from "./index-CqXEYILn.cjs";
|
|
12
|
+
import { i as selectVariants, n as SelectOption, r as SelectProps, t as Select } from "./index-veBM95Gw.cjs";
|
|
13
|
+
import { n as SliderProps, r as sliderVariants, t as Slider } from "./index-Bie3CWyW.cjs";
|
|
14
14
|
import { n as SubmitButtonProps, t as SubmitButton } from "./index-DpXSZCZe.cjs";
|
|
15
|
-
import { n as SwitchProps, t as Switch } from "./index-
|
|
16
|
-
import { n as SwitchBoxProps, r as switchBoxVariants, t as SwitchBox } from "./index-
|
|
17
|
-
import { n as TextAreaProps, t as TextArea } from "./index-
|
|
18
|
-
import { n as TimeProps, t as Time } from "./index-
|
|
15
|
+
import { n as SwitchProps, r as switchVariants, t as Switch } from "./index-19JGtN7H.cjs";
|
|
16
|
+
import { n as SwitchBoxProps, r as switchBoxVariants, t as SwitchBox } from "./index-Cf2B9woY.cjs";
|
|
17
|
+
import { n as TextAreaProps, t as TextArea } from "./index-BsTqcI1C.cjs";
|
|
18
|
+
import { n as TimeProps, r as timeVariants, t as Time } from "./index-DY-d4cFe.cjs";
|
|
19
19
|
import { createOptionValueConverter, flatArrayKey, fromNullishString, isValueEmpty, nameToTestId, toFormFormat, toNullishString, toSubmitFormat, toValidationFormat } from "./helpers/index.cjs";
|
|
20
20
|
import { n as useClientValidation, t as clientValidationSchemaByName } from "./useClientValidation-C2dLJnDI.cjs";
|
|
21
21
|
import { n as UseControllerReturn, r as useController, t as UseControllerProps } from "./useController-BT3Fd0IO.cjs";
|
|
22
|
-
import { n as useFormContext, t as checkFieldIsRequired } from "./useFormContext-
|
|
22
|
+
import { n as useFormContext, t as checkFieldIsRequired } from "./useFormContext-M94eQfHm.cjs";
|
|
23
23
|
import { t as useInput } from "./useInput-DZOmMKcp.cjs";
|
|
24
24
|
import { n as UseInputValueDebounceReturn, r as useInputValueDebounce, t as UseInputValueDebounceOptions } from "./useInputValueDebounce-CfQDiomI.cjs";
|
|
25
|
-
import { n as UseUniformFieldReturn, r as useUniformField, t as UseUniformFieldParams } from "./useUniformField-
|
|
26
|
-
import { n as useUniformFieldArray, t as UseUniformFieldArrayProps } from "./useUniformFieldArray-
|
|
25
|
+
import { n as UseUniformFieldReturn, r as useUniformField, t as UseUniformFieldParams } from "./useUniformField-BE-e3C4Y.cjs";
|
|
26
|
+
import { n as useUniformFieldArray, t as UseUniformFieldArrayProps } from "./useUniformFieldArray-kkOHxNFF.cjs";
|
|
27
27
|
import { n as useWatchFormReset, t as UseWatchFormResetOptions } from "./useWatchFormReset-BSd6jMxU.cjs";
|
|
28
28
|
import { n as useWatchUserChange, t as UseWatchUserChangeOptions } from "./useWatchUserChange-DSAboNCs.cjs";
|
|
29
29
|
import { n as FieldCopyTestIdButtonProps, t as FieldCopyTestIdButton } from "./index-CXvUaeCL.cjs";
|
|
30
30
|
import { n as FieldValidationErrorProps, t as FieldValidationError } from "./index-P30z4VRT.cjs";
|
|
31
|
-
export { type CheckboxOption, Checkboxes, type CheckboxesProps, DatePicker, type DatePickerProps, FieldArray, type FieldArrayChildrenRenderFn, type FieldArrayFeatures, type FieldArrayProps, FieldCard, type FieldCardProps, FieldCopyTestIdButton, type FieldCopyTestIdButtonProps, FieldValidationError, type FieldValidationErrorProps, Form, type FormProps, Grid, type GridProps, Input, type InputProps, InputValueTransform, RadioBoxes, type RadioBoxesProps, RadioTabs, type RadioTabsProps, Radios, type RadiosProps, Select, type SelectProps, Slider, type SliderProps, SubmitButton, type SubmitButtonProps, Switch, SwitchBox, type SwitchBoxProps, type SwitchProps, TextArea, type TextAreaProps, Time, type TimeProps, UseControllerProps, UseControllerReturn, UseInputValueDebounceOptions, UseInputValueDebounceReturn, UseInputValueTransformOptions, UseInputValueTransformReturn, UseUniformFieldArrayProps, UseUniformFieldParams, UseUniformFieldReturn, UseWatchFormResetOptions, UseWatchUserChangeOptions, checkFieldIsRequired, clientValidationSchemaByName, createOptionValueConverter, fieldCardVariants, flatArrayKey, fromNullishString, isValueEmpty, nameToTestId, radioBoxVariants, switchBoxVariants, toFormFormat, toNullishString, toSubmitFormat, toValidationFormat, useClientValidation, useController, useFormContext, useInput, useInputValueDebounce, useInputValueTransform, useUniformField, useUniformFieldArray, useWatchFormReset, useWatchUserChange };
|
|
31
|
+
export { type CheckboxOption, Checkboxes, type CheckboxesProps, DatePicker, type DatePickerProps, FieldArray, type FieldArrayChildrenRenderFn, type FieldArrayFeatures, type FieldArrayProps, FieldCard, type FieldCardProps, FieldCopyTestIdButton, type FieldCopyTestIdButtonProps, FieldValidationError, type FieldValidationErrorProps, Form, type FormProps, Grid, type GridProps, Input, type InputProps, InputValueTransform, type RadioBoxOption, RadioBoxes, type RadioBoxesProps, type RadioOption, type RadioTabOption, RadioTabs, type RadioTabsProps, Radios, type RadiosProps, Select, type SelectOption, type SelectProps, Slider, type SliderProps, SubmitButton, type SubmitButtonProps, Switch, SwitchBox, type SwitchBoxProps, type SwitchProps, TextArea, type TextAreaProps, Time, type TimeProps, UseControllerProps, UseControllerReturn, UseInputValueDebounceOptions, UseInputValueDebounceReturn, UseInputValueTransformOptions, UseInputValueTransformReturn, UseUniformFieldArrayProps, UseUniformFieldParams, UseUniformFieldReturn, UseWatchFormResetOptions, UseWatchUserChangeOptions, checkFieldIsRequired, checkboxesVariants, clientValidationSchemaByName, createOptionValueConverter, datePickerVariants, fieldArrayVariants, fieldCardVariants, flatArrayKey, fromNullishString, isValueEmpty, nameToTestId, radioBoxVariants, radioTabsVariants, radiosVariants, selectVariants, sliderVariants, switchBoxVariants, switchVariants, timeVariants, toFormFormat, toNullishString, toSubmitFormat, toValidationFormat, useClientValidation, useController, useFormContext, useInput, useInputValueDebounce, useInputValueTransform, useUniformField, useUniformFieldArray, useWatchFormReset, useWatchUserChange };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import { i as useInputValueTransform, n as UseInputValueTransformOptions, r as UseInputValueTransformReturn, t as InputValueTransform } from "./useInputValueTransform-dLfFIYW4.js";
|
|
2
|
-
import { n as Checkboxes, r as CheckboxesProps, t as CheckboxOption } from "./index-
|
|
3
|
-
import { n as DatePickerProps, t as DatePicker } from "./index-
|
|
4
|
-
import {
|
|
5
|
-
import { n as FieldCardProps, r as fieldCardVariants, t as FieldCard } from "./index-
|
|
2
|
+
import { i as checkboxesVariants, n as Checkboxes, r as CheckboxesProps, t as CheckboxOption } from "./index-DFbuWomg.js";
|
|
3
|
+
import { n as DatePickerProps, r as datePickerVariants, t as DatePicker } from "./index-D7AUghFx.js";
|
|
4
|
+
import { a as FieldArrayProps, i as FieldArrayFeatures, n as fieldArrayVariants, r as FieldArrayChildrenRenderFn, t as FieldArray } from "./index-yYjVSHlN.js";
|
|
5
|
+
import { n as FieldCardProps, r as fieldCardVariants, t as FieldCard } from "./index-CUByIf_d.js";
|
|
6
6
|
import { n as FormProps, t as Form } from "./index-54OZEaUU.js";
|
|
7
7
|
import { n as GridProps, t as Grid } from "./index-PWRw2bPH.js";
|
|
8
|
-
import { n as InputProps, t as Input } from "./index-
|
|
9
|
-
import { n as
|
|
10
|
-
import { n as RadioTabsProps, t as
|
|
11
|
-
import { n as RadiosProps, t as
|
|
12
|
-
import { n as SelectProps, t as Select } from "./index-
|
|
13
|
-
import { n as SliderProps, t as Slider } from "./index-
|
|
8
|
+
import { n as InputProps, t as Input } from "./index-C6Y8KybK.js";
|
|
9
|
+
import { i as RadioBoxesProps, n as RadioBoxOption, r as RadioBoxes, t as radioBoxVariants } from "./index-clztdahp.js";
|
|
10
|
+
import { i as radioTabsVariants, n as RadioTabs, r as RadioTabsProps, t as RadioTabOption } from "./index-OdNTqjhQ.js";
|
|
11
|
+
import { i as radiosVariants, n as Radios, r as RadiosProps, t as RadioOption } from "./index-DCwffq1f.js";
|
|
12
|
+
import { i as selectVariants, n as SelectOption, r as SelectProps, t as Select } from "./index-D1cB3mbB.js";
|
|
13
|
+
import { n as SliderProps, r as sliderVariants, t as Slider } from "./index-BUZEnZDm.js";
|
|
14
14
|
import { n as SubmitButtonProps, t as SubmitButton } from "./index-CV7wqRev.js";
|
|
15
|
-
import { n as SwitchProps, t as Switch } from "./index-
|
|
16
|
-
import { n as SwitchBoxProps, r as switchBoxVariants, t as SwitchBox } from "./index-
|
|
17
|
-
import { n as TextAreaProps, t as TextArea } from "./index-
|
|
18
|
-
import { n as TimeProps, t as Time } from "./index-
|
|
15
|
+
import { n as SwitchProps, r as switchVariants, t as Switch } from "./index-DqMpHpu7.js";
|
|
16
|
+
import { n as SwitchBoxProps, r as switchBoxVariants, t as SwitchBox } from "./index-amMd-sQN.js";
|
|
17
|
+
import { n as TextAreaProps, t as TextArea } from "./index-DXOBPBft.js";
|
|
18
|
+
import { n as TimeProps, r as timeVariants, t as Time } from "./index-BdgFJ-dj.js";
|
|
19
19
|
import { createOptionValueConverter, flatArrayKey, fromNullishString, isValueEmpty, nameToTestId, toFormFormat, toNullishString, toSubmitFormat, toValidationFormat } from "./helpers/index.js";
|
|
20
20
|
import { n as useClientValidation, t as clientValidationSchemaByName } from "./useClientValidation-qRq2_spX.js";
|
|
21
21
|
import { n as UseControllerReturn, r as useController, t as UseControllerProps } from "./useController-CzP0aVFC.js";
|
|
22
|
-
import { n as useFormContext, t as checkFieldIsRequired } from "./useFormContext-
|
|
22
|
+
import { n as useFormContext, t as checkFieldIsRequired } from "./useFormContext-Bj1gXLt_.js";
|
|
23
23
|
import { t as useInput } from "./useInput-BdH8oftG.js";
|
|
24
24
|
import { n as UseInputValueDebounceReturn, r as useInputValueDebounce, t as UseInputValueDebounceOptions } from "./useInputValueDebounce-DZgzL7GQ.js";
|
|
25
|
-
import { n as UseUniformFieldReturn, r as useUniformField, t as UseUniformFieldParams } from "./useUniformField-
|
|
26
|
-
import { n as useUniformFieldArray, t as UseUniformFieldArrayProps } from "./useUniformFieldArray-
|
|
25
|
+
import { n as UseUniformFieldReturn, r as useUniformField, t as UseUniformFieldParams } from "./useUniformField-DUW-svZD.js";
|
|
26
|
+
import { n as useUniformFieldArray, t as UseUniformFieldArrayProps } from "./useUniformFieldArray-CdWv1SEk.js";
|
|
27
27
|
import { n as useWatchFormReset, t as UseWatchFormResetOptions } from "./useWatchFormReset-C7YJ-I3N.js";
|
|
28
28
|
import { n as useWatchUserChange, t as UseWatchUserChangeOptions } from "./useWatchUserChange-CpyZz2i7.js";
|
|
29
29
|
import { n as FieldCopyTestIdButtonProps, t as FieldCopyTestIdButton } from "./index-CHQKk_fN2.js";
|
|
30
30
|
import { n as FieldValidationErrorProps, t as FieldValidationError } from "./index-CEJxjf5R.js";
|
|
31
|
-
export { type CheckboxOption, Checkboxes, type CheckboxesProps, DatePicker, type DatePickerProps, FieldArray, type FieldArrayChildrenRenderFn, type FieldArrayFeatures, type FieldArrayProps, FieldCard, type FieldCardProps, FieldCopyTestIdButton, type FieldCopyTestIdButtonProps, FieldValidationError, type FieldValidationErrorProps, Form, type FormProps, Grid, type GridProps, Input, type InputProps, InputValueTransform, RadioBoxes, type RadioBoxesProps, RadioTabs, type RadioTabsProps, Radios, type RadiosProps, Select, type SelectProps, Slider, type SliderProps, SubmitButton, type SubmitButtonProps, Switch, SwitchBox, type SwitchBoxProps, type SwitchProps, TextArea, type TextAreaProps, Time, type TimeProps, UseControllerProps, UseControllerReturn, UseInputValueDebounceOptions, UseInputValueDebounceReturn, UseInputValueTransformOptions, UseInputValueTransformReturn, UseUniformFieldArrayProps, UseUniformFieldParams, UseUniformFieldReturn, UseWatchFormResetOptions, UseWatchUserChangeOptions, checkFieldIsRequired, clientValidationSchemaByName, createOptionValueConverter, fieldCardVariants, flatArrayKey, fromNullishString, isValueEmpty, nameToTestId, radioBoxVariants, switchBoxVariants, toFormFormat, toNullishString, toSubmitFormat, toValidationFormat, useClientValidation, useController, useFormContext, useInput, useInputValueDebounce, useInputValueTransform, useUniformField, useUniformFieldArray, useWatchFormReset, useWatchUserChange };
|
|
31
|
+
export { type CheckboxOption, Checkboxes, type CheckboxesProps, DatePicker, type DatePickerProps, FieldArray, type FieldArrayChildrenRenderFn, type FieldArrayFeatures, type FieldArrayProps, FieldCard, type FieldCardProps, FieldCopyTestIdButton, type FieldCopyTestIdButtonProps, FieldValidationError, type FieldValidationErrorProps, Form, type FormProps, Grid, type GridProps, Input, type InputProps, InputValueTransform, type RadioBoxOption, RadioBoxes, type RadioBoxesProps, type RadioOption, type RadioTabOption, RadioTabs, type RadioTabsProps, Radios, type RadiosProps, Select, type SelectOption, type SelectProps, Slider, type SliderProps, SubmitButton, type SubmitButtonProps, Switch, SwitchBox, type SwitchBoxProps, type SwitchProps, TextArea, type TextAreaProps, Time, type TimeProps, UseControllerProps, UseControllerReturn, UseInputValueDebounceOptions, UseInputValueDebounceReturn, UseInputValueTransformOptions, UseInputValueTransformReturn, UseUniformFieldArrayProps, UseUniformFieldParams, UseUniformFieldReturn, UseWatchFormResetOptions, UseWatchUserChangeOptions, checkFieldIsRequired, checkboxesVariants, clientValidationSchemaByName, createOptionValueConverter, datePickerVariants, fieldArrayVariants, fieldCardVariants, flatArrayKey, fromNullishString, isValueEmpty, nameToTestId, radioBoxVariants, radioTabsVariants, radiosVariants, selectVariants, sliderVariants, switchBoxVariants, switchVariants, timeVariants, toFormFormat, toNullishString, toSubmitFormat, toValidationFormat, useClientValidation, useController, useFormContext, useInput, useInputValueDebounce, useInputValueTransform, useUniformField, useUniformFieldArray, useWatchFormReset, useWatchUserChange };
|
package/dist/index.js
CHANGED
|
@@ -6,31 +6,31 @@ import { n as useFormContext, t as checkFieldIsRequired } from "./useFormContext
|
|
|
6
6
|
import { t as useInput } from "./useInput-CVm3tP78.js";
|
|
7
7
|
import { t as useInputValueTransform } from "./useInputValueTransform-CXdmtc0Q.js";
|
|
8
8
|
import { useUniformField } from "./hooks/useUniformField/index.js";
|
|
9
|
-
import { n as Checkboxes } from "./Checkboxes-
|
|
10
|
-
import { n as DatePicker } from "./DatePicker-
|
|
9
|
+
import { n as Checkboxes, r as checkboxesVariants } from "./Checkboxes-X6FRwI50.js";
|
|
10
|
+
import { n as DatePicker, r as datePickerVariants } from "./DatePicker-CGIWizz9.js";
|
|
11
11
|
import { useWatchFormReset } from "./hooks/useWatchFormReset/index.js";
|
|
12
12
|
import { useUniformFieldArray } from "./hooks/useUniformFieldArray/index.js";
|
|
13
|
-
import { n as FieldArray } from "./FieldArray-
|
|
13
|
+
import { n as FieldArray, r as fieldArrayVariants } from "./FieldArray-Dkw6JBnT.js";
|
|
14
14
|
import { n as Grid } from "./Grid-BQpLOB0G.js";
|
|
15
|
-
import { n as
|
|
15
|
+
import { n as FieldCard, r as fieldCardVariants } from "./FieldCard-Cg31ce9J.js";
|
|
16
16
|
import { n as Form } from "./Form-D3yfDu4L.js";
|
|
17
17
|
import { useInputValueDebounce } from "./hooks/useInputValueDebounce/index.js";
|
|
18
18
|
import { n as Input } from "./Input-B5RxbkNS.js";
|
|
19
|
-
import { n as RadioBoxes, r as radioBoxVariants } from "./RadioBoxes-
|
|
20
|
-
import { n as RadioTabs } from "./RadioTabs-
|
|
21
|
-
import { n as Radios } from "./Radios-
|
|
22
|
-
import { n as Select } from "./Select-
|
|
23
|
-
import { n as Slider } from "./Slider-
|
|
19
|
+
import { n as RadioBoxes, r as radioBoxVariants } from "./RadioBoxes-DWxJBTKR.js";
|
|
20
|
+
import { n as RadioTabs, r as radioTabsVariants } from "./RadioTabs-DAY6MYJI.js";
|
|
21
|
+
import { n as Radios, r as radiosVariants } from "./Radios-C938-msm.js";
|
|
22
|
+
import { n as Select, r as selectVariants } from "./Select-BL6k_e-D.js";
|
|
23
|
+
import { n as Slider, r as sliderVariants } from "./Slider-DmEwhC1T.js";
|
|
24
24
|
import { n as SubmitButton } from "./SubmitButton-D6aU7IgC.js";
|
|
25
|
-
import { n as Switch } from "./Switch-
|
|
25
|
+
import { n as Switch, r as switchVariants } from "./Switch-DvKRPFcC.js";
|
|
26
26
|
import { n as SwitchBox, r as switchBoxVariants } from "./SwitchBox-BU1XieaZ.js";
|
|
27
27
|
import { n as TextArea } from "./TextArea-DAg_K-QP.js";
|
|
28
|
-
import {
|
|
28
|
+
import { n as Time, r as timeVariants } from "./Time-B_SXrKWK.js";
|
|
29
29
|
import { n as useClientValidation, t as clientValidationSchemaByName } from "./useClientValidation-DpLdzIAb.js";
|
|
30
30
|
import { t as useWatchUserChange } from "./useWatchUserChange-DSQGsl1R.js";
|
|
31
31
|
//#region src/index.ts
|
|
32
32
|
/* v8 ignore stop */
|
|
33
33
|
//#endregion
|
|
34
|
-
export { Checkboxes, DatePicker, FieldArray, FieldCard, FieldCopyTestIdButton, FieldValidationError, Form, Grid, Input, RadioBoxes, RadioTabs, Radios, Select, Slider, SubmitButton, Switch, SwitchBox, TextArea, Time, checkFieldIsRequired, clientValidationSchemaByName, createOptionValueConverter, fieldCardVariants, flatArrayKey, fromNullishString, isValueEmpty, nameToTestId, radioBoxVariants, switchBoxVariants, toFormFormat, toNullishString, toSubmitFormat, toValidationFormat, useClientValidation, useController, useFormContext, useInput, useInputValueDebounce, useInputValueTransform, useUniformField, useUniformFieldArray, useWatchFormReset, useWatchUserChange };
|
|
34
|
+
export { Checkboxes, DatePicker, FieldArray, FieldCard, FieldCopyTestIdButton, FieldValidationError, Form, Grid, Input, RadioBoxes, RadioTabs, Radios, Select, Slider, SubmitButton, Switch, SwitchBox, TextArea, Time, checkFieldIsRequired, checkboxesVariants, clientValidationSchemaByName, createOptionValueConverter, datePickerVariants, fieldArrayVariants, fieldCardVariants, flatArrayKey, fromNullishString, isValueEmpty, nameToTestId, radioBoxVariants, radioTabsVariants, radiosVariants, selectVariants, sliderVariants, switchBoxVariants, switchVariants, timeVariants, toFormFormat, toNullishString, toSubmitFormat, toValidationFormat, useClientValidation, useController, useFormContext, useInput, useInputValueDebounce, useInputValueTransform, useUniformField, useUniformFieldArray, useWatchFormReset, useWatchUserChange };
|
|
35
35
|
|
|
36
36
|
//# sourceMappingURL=index.js.map
|
|
@@ -30,14 +30,14 @@ declare const useFormContext$1: <TFieldValues extends FieldValues = FieldValues,
|
|
|
30
30
|
reset: import("react-hook-form").UseFormReset<TFieldValues>;
|
|
31
31
|
subscribe: import("react-hook-form").UseFormSubscribe<TFieldValues>;
|
|
32
32
|
watch: import("react-hook-form").UseFormWatch<TFieldValues>;
|
|
33
|
-
debugMode: "
|
|
33
|
+
debugMode: "disabled" | "debug" | "debug-testids" | "off";
|
|
34
34
|
debugModeSettings?: DebugModeSettings;
|
|
35
35
|
formReset: {
|
|
36
36
|
subscribe: (listener: FormResetListener) => () => void;
|
|
37
37
|
notify: () => void;
|
|
38
38
|
};
|
|
39
39
|
preventSubmit: (prevent: boolean) => void;
|
|
40
|
-
setDebugMode: (debugMode: "
|
|
40
|
+
setDebugMode: (debugMode: "disabled" | "debug" | "debug-testids" | "off") => void;
|
|
41
41
|
triggerSubmit: (e?: import("react").BaseSyntheticEvent) => Promise<void> | void;
|
|
42
42
|
userChange: {
|
|
43
43
|
subscribe: (listener: UserChangeListener) => () => void;
|
|
@@ -63,4 +63,4 @@ declare const useFormContext$1: <TFieldValues extends FieldValues = FieldValues,
|
|
|
63
63
|
};
|
|
64
64
|
//#endregion
|
|
65
65
|
export { useFormContext$1 as n, checkFieldIsRequired as t };
|
|
66
|
-
//# sourceMappingURL=useFormContext-
|
|
66
|
+
//# sourceMappingURL=useFormContext-Bj1gXLt_.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFormContext-
|
|
1
|
+
{"version":3,"file":"useFormContext-Bj1gXLt_.d.ts","names":[],"sources":["../src/hooks/useFormContext/useFormContext.ts"],"mappings":";;;;;;cAYa,oBAAA,GACX,UAAA,EAAY,YAAY,EACxB,IAAA;;AAFF;;;;;;;;AAEgB;cAmEH,gBAAA,wBACU,WAAA,GAAc,WAAA,uCAEd,YAAA;;wBAoCQ,IAAA,CAAK,YAAA,GAAa,MAAA;;;;;;;;;;;;;;;;;;;;;sCAwB3C,kBAAA,KAAA,OAAA;;0BAAA,kBAAA;;;;mBAiBa,YAAA;eAEE,YAAA;aAC6B,kBAAA"}
|
|
@@ -30,14 +30,14 @@ declare const useFormContext: <TFieldValues extends FieldValues = FieldValues, T
|
|
|
30
30
|
reset: import("react-hook-form").UseFormReset<TFieldValues>;
|
|
31
31
|
subscribe: import("react-hook-form").UseFormSubscribe<TFieldValues>;
|
|
32
32
|
watch: import("react-hook-form").UseFormWatch<TFieldValues>;
|
|
33
|
-
debugMode: "
|
|
33
|
+
debugMode: "disabled" | "debug" | "debug-testids" | "off";
|
|
34
34
|
debugModeSettings?: DebugModeSettings;
|
|
35
35
|
formReset: {
|
|
36
36
|
subscribe: (listener: FormResetListener) => () => void;
|
|
37
37
|
notify: () => void;
|
|
38
38
|
};
|
|
39
39
|
preventSubmit: (prevent: boolean) => void;
|
|
40
|
-
setDebugMode: (debugMode: "
|
|
40
|
+
setDebugMode: (debugMode: "disabled" | "debug" | "debug-testids" | "off") => void;
|
|
41
41
|
triggerSubmit: (e?: import("react").BaseSyntheticEvent) => Promise<void> | void;
|
|
42
42
|
userChange: {
|
|
43
43
|
subscribe: (listener: UserChangeListener) => () => void;
|
|
@@ -63,4 +63,4 @@ declare const useFormContext: <TFieldValues extends FieldValues = FieldValues, T
|
|
|
63
63
|
};
|
|
64
64
|
//#endregion
|
|
65
65
|
export { useFormContext as n, checkFieldIsRequired as t };
|
|
66
|
-
//# sourceMappingURL=useFormContext-
|
|
66
|
+
//# sourceMappingURL=useFormContext-M94eQfHm.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFormContext-
|
|
1
|
+
{"version":3,"file":"useFormContext-M94eQfHm.d.cts","names":[],"sources":["../src/hooks/useFormContext/useFormContext.ts"],"mappings":";;;;;;cAYa,oBAAA,GACX,UAAA,EAAY,YAAY,EACxB,IAAA;;AAFF;;;;;;;;AAEgB;cAmEH,cAAA,wBACU,WAAA,GAAc,WAAA,uCAEd,YAAA;;wBAoCQ,IAAA,CAAK,YAAA,GAAa,MAAA;;;;;;;;;;;;;;;;;;;;;sCAwB3C,kBAAA,KAAA,OAAA;;0BAAA,kBAAA;;;;mBAiBa,YAAA;eAEE,YAAA;aAC6B,kBAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as InputValueTransform } from "./useInputValueTransform-CNCBU7a9.cjs";
|
|
2
2
|
import { r as useController } from "./useController-BT3Fd0IO.cjs";
|
|
3
|
-
import { n as useFormContext } from "./useFormContext-
|
|
3
|
+
import { n as useFormContext } from "./useFormContext-M94eQfHm.cjs";
|
|
4
4
|
import { t as useInput } from "./useInput-DZOmMKcp.cjs";
|
|
5
5
|
import { ReactNode } from "react";
|
|
6
6
|
import { FieldError, FieldValues, Path } from "react-hook-form";
|
|
@@ -95,4 +95,4 @@ interface UseUniformFieldReturn<TFieldValues extends FieldValues = FieldValues>
|
|
|
95
95
|
declare const useUniformField: <TFieldValues extends FieldValues = FieldValues, TDisplay = unknown>(params: UseUniformFieldParams<TFieldValues, TDisplay>) => UseUniformFieldReturn<TFieldValues>;
|
|
96
96
|
//#endregion
|
|
97
97
|
export { UseUniformFieldReturn as n, useUniformField as r, UseUniformFieldParams as t };
|
|
98
|
-
//# sourceMappingURL=useUniformField-
|
|
98
|
+
//# sourceMappingURL=useUniformField-BE-e3C4Y.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|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gB7B,MAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA+BW,eAAA,wBACU,WAAA,GAAc,WAAA,sBAGnC,MAAA,EAAQ,qBAAA,CAAsB,YAAA,EAAc,QAAA,MAC3C,qBAAA,CAAsB,YAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { t as InputValueTransform } from "./useInputValueTransform-dLfFIYW4.js";
|
|
2
2
|
import { r as useController$1 } from "./useController-CzP0aVFC.js";
|
|
3
|
-
import { n as useFormContext$1 } from "./useFormContext-
|
|
3
|
+
import { n as useFormContext$1 } from "./useFormContext-Bj1gXLt_.js";
|
|
4
4
|
import { t as useInput } from "./useInput-BdH8oftG.js";
|
|
5
5
|
import { ReactNode } from "react";
|
|
6
6
|
import { FieldError, FieldValues, Path } from "react-hook-form";
|
|
@@ -95,4 +95,4 @@ interface UseUniformFieldReturn<TFieldValues extends FieldValues = FieldValues>
|
|
|
95
95
|
declare const useUniformField: <TFieldValues extends FieldValues = FieldValues, TDisplay = unknown>(params: UseUniformFieldParams<TFieldValues, TDisplay>) => UseUniformFieldReturn<TFieldValues>;
|
|
96
96
|
//#endregion
|
|
97
97
|
export { UseUniformFieldReturn as n, useUniformField as r, UseUniformFieldParams as t };
|
|
98
|
-
//# sourceMappingURL=useUniformField-
|
|
98
|
+
//# sourceMappingURL=useUniformField-DUW-svZD.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useUniformField-
|
|
1
|
+
{"version":3,"file":"useUniformField-DUW-svZD.d.ts","names":[],"sources":["../src/hooks/useUniformField/useUniformField.tsx"],"mappings":";;;;;;;;UAgBiB,qBAAA,sBACM,WAAA,GAAc,WAAA;;EAInC,IAAA,EAAM,IAAA,CAAK,YAAA;EALyB;EAOpC,SAAA;EANqB;EAQrB,QAAA;EAJW;EAMX,KAAA,GAAQ,SAAA;EAAA;EAER,MAAA;EAEY;EAAZ,SAAA,GAAY,mBAAA,CAAoB,QAAA;EAAD;EAE/B,IAAA;AAAA;AAAA,UAGe,qBAAA,sBACM,WAAA,GAAc,WAAA;EAnBnC;EAsBA,SAAA;EAnBM;EAqBN,OAAA,EAAS,UAAA,QAAkB,gBAAA,CAAe,YAAA;EAnB1C;EAqBA,SAAA,EAAW,UAAA,QAAkB,gBAAA,CAAe,YAAA;EAjB5C;EAmBA,YAAA;EAjBA;EAmBA,QAAA;EAjBY;EAmBZ,KAAA,EAAO,UAAA;EAjBP;EAmBA,YAAA,EAAc,SAAA;EAnBV;EAqBJ,KAAA,EAAO,UAAA,QAAkB,eAAA,CAAc,YAAA;EAlBH;EAoBpC,oBAAA,EAAsB,UAAA,QAAkB,QAAA;EAnBnB;EAqBrB,qBAAA,EAAuB,UAAA,QAAkB,QAAA;EAhBC;EAkB1C,aAAA,EAAe,UAAA,QAAkB,QAAA;EAlBxB;EAoBT,SAAA,EAAW,UAAA,QAAkB,gBAAA,CAAe,YAAA;EAlBf;EAoB7B,OAAA;EAdO;EAgBP,KAAA,EAAO,SAAA;EAZgC;EAcvC,MAAA,EAAQ,UAAA,QAAkB,eAAA,CAAc,YAAA;EAdjC;EAgBP,QAAA,EAAU,UAAA,QAAkB,eAAA,CAAc,YAAA;EAdpB;EAgBtB,GAAA,EAAK,UAAA,QAAkB,eAAA,CAAc,YAAA;EAdd;EAgBvB,QAAA;EAde;EAgBf,UAAA,EAAY,UAAA,QAAkB,gBAAA,CAAe,YAAA;EAdhB;EAgB7B,MAAA;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA+BW,eAAA,wBACU,WAAA,GAAc,WAAA,sBAGnC,MAAA,EAAQ,qBAAA,CAAsB,YAAA,EAAc,QAAA,MAC3C,qBAAA,CAAsB,YAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as useController$1 } from "./useController-CzP0aVFC.js";
|
|
2
|
-
import { n as useFormContext$1 } from "./useFormContext-
|
|
2
|
+
import { n as useFormContext$1 } from "./useFormContext-Bj1gXLt_.js";
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
4
|
import { ArrayPath, FieldValues } from "react-hook-form";
|
|
5
5
|
|
|
@@ -76,4 +76,4 @@ declare const useUniformFieldArray: <TFieldValues extends FieldValues = FieldVal
|
|
|
76
76
|
};
|
|
77
77
|
//#endregion
|
|
78
78
|
export { useUniformFieldArray as n, UseUniformFieldArrayProps as t };
|
|
79
|
-
//# sourceMappingURL=useUniformFieldArray-
|
|
79
|
+
//# sourceMappingURL=useUniformFieldArray-CdWv1SEk.d.ts.map
|
package/dist/{useUniformFieldArray-zGcIhwhF.d.ts.map → useUniformFieldArray-CdWv1SEk.d.ts.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useUniformFieldArray-
|
|
1
|
+
{"version":3,"file":"useUniformFieldArray-CdWv1SEk.d.ts","names":[],"sources":["../src/hooks/useUniformFieldArray/useUniformFieldArray.ts"],"mappings":";;;;;;UAaiB,yBAAA,sBACM,WAAA,GAAc,WAAA;;EAGnC,IAAA,EAAM,SAAA,CAAU,YAAA;;EAEhB,IAAA;EANe;EAQf,mBAAA;EARwC;EAUxC,uBAAA;EATmC;EAWnC,QAAA;EARM;EAUN,MAAA;EAEiB;EAAjB,KAAA,GAAQ,SAAA;AAAA;;;;;;;;;;;;;;AAAS;cAiBN,oBAAA,wBACU,WAAA,GAAc,WAAA;EACnC,IAAA;EAAA,IAAA;EAAA,mBAAA,EAAA,oBAAA;EAAA,uBAAA;EAAA,QAAA;EAAA,MAAA,EAAA,cAAA;EAAA;AAAA,GAQC,yBAAA,CAA0B,YAAA;;;;;;;;;kBAnCR,KAAA;;;;;;;;;UAoEJ,UAAA;YAEuB,UAAA,QAFvB,eAAA;OAK4B,UAAA,QAHL,eAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as useController } from "./useController-BT3Fd0IO.cjs";
|
|
2
|
-
import { n as useFormContext } from "./useFormContext-
|
|
2
|
+
import { n as useFormContext } from "./useFormContext-M94eQfHm.cjs";
|
|
3
3
|
import { ReactNode } from "react";
|
|
4
4
|
import { ArrayPath, FieldValues } from "react-hook-form";
|
|
5
5
|
|
|
@@ -76,4 +76,4 @@ declare const useUniformFieldArray: <TFieldValues extends FieldValues = FieldVal
|
|
|
76
76
|
};
|
|
77
77
|
//#endregion
|
|
78
78
|
export { useUniformFieldArray as n, UseUniformFieldArrayProps as t };
|
|
79
|
-
//# sourceMappingURL=useUniformFieldArray-
|
|
79
|
+
//# sourceMappingURL=useUniformFieldArray-kkOHxNFF.d.cts.map
|
package/dist/{useUniformFieldArray-D3fdzwzD.d.cts.map → useUniformFieldArray-kkOHxNFF.d.cts.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useUniformFieldArray-
|
|
1
|
+
{"version":3,"file":"useUniformFieldArray-kkOHxNFF.d.cts","names":[],"sources":["../src/hooks/useUniformFieldArray/useUniformFieldArray.ts"],"mappings":";;;;;;UAaiB,yBAAA,sBACM,WAAA,GAAc,WAAA;;EAGnC,IAAA,EAAM,SAAA,CAAU,YAAA;;EAEhB,IAAA;EANe;EAQf,mBAAA;EARwC;EAUxC,uBAAA;EATmC;EAWnC,QAAA;EARM;EAUN,MAAA;EAEiB;EAAjB,KAAA,GAAQ,SAAA;AAAA;;;;;;;;;;;;;;AAAS;cAiBN,oBAAA,wBACU,WAAA,GAAc,WAAA;EACnC,IAAA;EAAA,IAAA;EAAA,mBAAA,EAAA,oBAAA;EAAA,uBAAA;EAAA,QAAA;EAAA,MAAA,EAAA,cAAA;EAAA;AAAA,GAQC,yBAAA,CAA0B,YAAA;;;;;;;;;kBAnCR,KAAA;;;;;;;;;UAoEJ,UAAA;YAEuB,UAAA,QAFvB,aAAA;OAK4B,UAAA,QAHL,aAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fuf-stack/uniform",
|
|
3
|
-
"version": "1.22.
|
|
3
|
+
"version": "1.22.5",
|
|
4
4
|
"description": "fuf react form library",
|
|
5
5
|
"author": "Fröhlich ∧ Frei",
|
|
6
6
|
"homepage": "https://github.com/fuf-stack/pixels#readme",
|
|
@@ -165,10 +165,10 @@
|
|
|
165
165
|
"@dnd-kit/modifiers": "9.0.0",
|
|
166
166
|
"@dnd-kit/sortable": "10.0.0",
|
|
167
167
|
"@dnd-kit/utilities": "3.2.2",
|
|
168
|
-
"@fuf-stack/pixel-motion": "1.2.
|
|
169
|
-
"@fuf-stack/pixel-utils": "1.3.
|
|
170
|
-
"@fuf-stack/pixels": "1.11.
|
|
171
|
-
"@fuf-stack/veto": "1.7.
|
|
168
|
+
"@fuf-stack/pixel-motion": "1.2.2",
|
|
169
|
+
"@fuf-stack/pixel-utils": "1.3.1",
|
|
170
|
+
"@fuf-stack/pixels": "1.11.1",
|
|
171
|
+
"@fuf-stack/veto": "1.7.2",
|
|
172
172
|
"@heroui/button": "2.2.32",
|
|
173
173
|
"@heroui/checkbox": "2.3.32",
|
|
174
174
|
"@heroui/date-input": "2.3.32",
|
|
@@ -196,5 +196,5 @@
|
|
|
196
196
|
"react": "19.2.6",
|
|
197
197
|
"react-dom": "19.2.6"
|
|
198
198
|
},
|
|
199
|
-
"gitHead": "
|
|
199
|
+
"gitHead": "5fc894eb5b00c05de016d88466523a07ad858c99"
|
|
200
200
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FieldCard-BK6SNqFY.js","names":[],"sources":["../src/FieldCard/subcomponents/FieldCardValidationError.tsx","../src/FieldCard/FieldCard.tsx"],"sourcesContent":["import type { FieldError } from 'react-hook-form';\n\nimport {\n AnimatePresence,\n motion,\n useReducedMotion,\n} from '@fuf-stack/pixel-motion';\nimport { cn } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../../hooks/useUniformField';\nimport FieldValidationError from '../../partials/FieldValidationError/FieldValidationError';\n\nexport interface FieldCardValidationErrorProps {\n /** CSS class name for the error footer wrapper */\n className?: string;\n /** Error object from parent FieldCard (passed directly to avoid duplicate hook calls) */\n error?: FieldError[] | undefined;\n /** CSS class name for the error text (controls color based on invalid state) */\n errorTextClassName?: string;\n /** Field name */\n name: string;\n}\n\n/**\n * Renders validation errors in the footer of a FieldCard component.\n *\n * This component handles displaying field-level validation errors with proper\n * accessibility attributes and animates them in/out using Framer Motion.\n *\n * Note: Object-level errors (_errors) are always shown when they exist,\n * but the danger styling is controlled by the parent FieldCard based on\n * whether child fields have been touched.\n */\nconst FieldCardValidationError = ({\n className = undefined,\n error = undefined,\n errorTextClassName = undefined,\n name,\n}: FieldCardValidationErrorProps) => {\n const { getErrorMessageProps, getHelperWrapperProps, testId } =\n useUniformField({\n name,\n });\n\n // disable all animation if user prefers reduced motion\n const disableAnimation = useReducedMotion();\n\n // Always show object-level errors (_errors) when they exist\n // @ts-expect-error - error._errors exists but not typed\n const hasErrors = !!error?._errors;\n\n return (\n <AnimatePresence initial={!disableAnimation}>\n {hasErrors ? (\n <motion.div\n key=\"field-card-errors\"\n exit={disableAnimation ? undefined : { opacity: 0, height: 0 }}\n initial={disableAnimation ? false : { height: 0, opacity: 0 }}\n style={{ overflow: 'hidden' }}\n transition={{ duration: 0.4, ease: 'circOut' }}\n animate={\n disableAnimation ? undefined : { opacity: 1, height: 'auto' }\n }\n >\n <div\n {...getHelperWrapperProps()}\n className={cn(getHelperWrapperProps()?.className, className)}\n >\n <div\n {...getErrorMessageProps()}\n className={cn(\n getErrorMessageProps()?.className,\n errorTextClassName,\n )}\n >\n <FieldValidationError\n // @ts-expect-error - error._errors exists but not typed\n error={error._errors}\n testId={testId}\n />\n </div>\n </div>\n </motion.div>\n ) : null}\n </AnimatePresence>\n );\n};\n\nexport default FieldCardValidationError;\n","import type { TVClassName } from '@fuf-stack/pixel-utils';\nimport type { ReactNode } from 'react';\n\nimport { tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\nimport { useDebounce } from '@fuf-stack/pixels';\n\nimport { checkFieldIsRequired, useFormContext } from '../hooks/useFormContext';\nimport { useUniformField } from '../hooks/useUniformField';\nimport FieldCardValidationError from './subcomponents/FieldCardValidationError';\n\n/**\n * Recursively checks if any child field has an error (regardless of touched state).\n * Returns true if at least one child has an error.\n */\nexport const hasAnyChildErrors = (\n errors: Record<string, unknown> | undefined,\n): boolean => {\n if (!errors) {\n return false;\n }\n\n return Object.keys(errors)\n .filter((key) => {\n return key !== '_errors';\n })\n .some((key) => {\n const errorValue = errors[key];\n if (errorValue === undefined) {\n return false;\n }\n // If errorValue is an array, it's a leaf field error\n if (Array.isArray(errorValue)) {\n return true;\n }\n // Recursively check nested objects\n if (typeof errorValue === 'object' && errorValue !== null) {\n return hasAnyChildErrors(errorValue as Record<string, unknown>);\n }\n return false;\n });\n};\n\n/**\n * Recursively checks if any child field is touched.\n * Returns true if at least one child is touched.\n */\nexport const hasAnyChildTouched = (\n touched: Record<string, unknown> | undefined,\n): boolean => {\n if (!touched) {\n return false;\n }\n\n return Object.keys(touched)\n .filter((key) => {\n return key !== '_errors';\n })\n .some((key) => {\n const touchedValue = touched[key];\n if (touchedValue === undefined) {\n return false;\n }\n // If touchedValue is truthy (boolean true), field is touched\n if (touchedValue === true) {\n return true;\n }\n // Recursively check nested objects\n if (typeof touchedValue === 'object' && touchedValue !== null) {\n return hasAnyChildTouched(touchedValue as Record<string, unknown>);\n }\n return false;\n });\n};\n\n/**\n * Recursively checks if any child field with an error is also touched.\n * Returns true if at least one touched child has an error.\n */\nexport const hasVisibleChildErrors = (\n errors: Record<string, unknown> | undefined,\n touched: Record<string, unknown> | undefined,\n): boolean => {\n if (!errors || !touched) {\n return false;\n }\n\n return Object.keys(errors)\n .filter((key) => {\n // Skip object-level errors (_errors) - those are handled separately\n return key !== '_errors';\n })\n .some((key) => {\n const errorValue = errors[key];\n const touchedValue = touched[key];\n\n // If this key doesn't exist in both errors and touched, skip\n if (errorValue === undefined || touchedValue === undefined) {\n return false;\n }\n\n // If errorValue is an array, it's a leaf field error\n if (Array.isArray(errorValue)) {\n // touchedValue being truthy means the field is touched\n return !!touchedValue;\n }\n\n // Recursively check nested objects\n if (typeof errorValue === 'object' && errorValue !== null) {\n return hasVisibleChildErrors(\n errorValue as Record<string, unknown>,\n touchedValue as Record<string, unknown>,\n );\n }\n\n return false;\n });\n};\n\nexport const fieldCardVariants = tv({\n slots: {\n /** base class for the field card wrapper */\n base: [\n // base styles\n 'overflow-hidden rounded-small border bg-content1',\n // animate border color change, respect reduced motion\n 'transition-colors duration-150 motion-reduce:transition-none',\n ],\n /** class for the label/header */\n label: [\n // override HeroUI label positioning and display\n 'pointer-events-auto! static! z-auto! block! w-full!',\n // reset any transforms or translations\n 'translate-x-0! translate-y-0! transform-none!',\n // card header styling - use text-medium (16px) for proper header size\n 'rounded-t-small border-b p-3 font-semibold text-medium',\n // animate border and text color change, respect reduced motion\n 'transition-colors duration-150 motion-reduce:transition-none',\n ],\n /** class for the content */\n content: [\n // same as p-3 of Card component\n 'p-3',\n // default grid for form components (see Grid component)\n 'grid gap-4',\n ],\n /** class for the error footer wrapper */\n errorFooter: [\n 'border-t',\n // force helper to be visible and add padding (pt-1 to compensate for inner content's top padding)\n 'block px-3 pb-2 pt-1',\n // animate border color change, respect reduced motion\n 'transition-colors duration-150 motion-reduce:transition-none',\n ],\n /** class for the error text (empty base, color controlled by variant) */\n errorText: [],\n },\n variants: {\n invalid: {\n true: {\n base: 'border-danger-200',\n label: 'border-danger-200 text-danger',\n errorFooter: 'border-danger-200',\n errorText: '!text-danger text-tiny',\n },\n false: {\n base: 'border-divider',\n label: 'border-divider text-foreground',\n errorFooter: 'border-divider',\n errorText: '!text-foreground-500 text-tiny',\n },\n },\n },\n defaultVariants: {\n invalid: false,\n },\n});\n\ntype ClassName = TVClassName<typeof fieldCardVariants>;\n\nexport interface FieldCardProps {\n /** Content to render inside the card */\n children: ReactNode;\n /** CSS class name */\n className?: ClassName;\n /** Label content for the card header */\n label: ReactNode;\n /** Field name for validation */\n name: string;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\n/**\n * FieldCard component - A card-styled container with label header and error footer\n *\n * Displays form field content in a card layout with:\n * - Label/title in the header\n * - Content in the body\n * - Validation errors in the footer\n * - Danger outline when validation errors exist\n */\nconst FieldCard = ({\n children,\n className: _className = undefined,\n name,\n ...uniformFieldProps\n}: FieldCardProps) => {\n const { error, getLabelProps, label } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n const {\n control,\n formState: { touchedFields, submitCount },\n validation,\n } = useFormContext();\n\n // Check if any registered child field is required\n const validationInstance = validation?.baseInstance ?? validation?.instance;\n const registeredFields: string[] = Array.from(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (control as any)._names?.mount ?? [],\n );\n const childFieldPrefix = `${name}.`;\n const isRequired = validationInstance\n ? registeredFields\n .filter((f) => {\n return f.startsWith(childFieldPrefix);\n })\n .some((f) => {\n return checkFieldIsRequired(\n validationInstance,\n f.split('.').filter((k) => {\n return k !== '';\n }),\n );\n })\n : false;\n\n // Get touched state for this field's children by traversing the path\n const getNestedValue = (\n obj: Record<string, unknown> | undefined,\n path: string,\n ): Record<string, unknown> | undefined => {\n if (!obj) {\n return undefined;\n }\n const keys = path.split('.');\n let current: unknown = obj;\n keys.every((key) => {\n if (current && typeof current === 'object') {\n current = (current as Record<string, unknown>)[key];\n return true;\n }\n current = undefined;\n return false;\n });\n return current as Record<string, unknown> | undefined;\n };\n\n const fieldTouched = getNestedValue(\n touchedFields as Record<string, unknown>,\n name,\n );\n\n // Check for object-level errors (_errors)\n // @ts-expect-error - error._errors exists but not typed\n const hasObjectErrors = !!error?._errors;\n\n const errorRecord = error as unknown as Record<string, unknown>;\n\n // Check if any child field has errors (regardless of touched state)\n const hasChildErrors = hasAnyChildErrors(errorRecord);\n // Check if any child field is touched\n const isAnyChildTouched = hasAnyChildTouched(fieldTouched);\n\n // Show invalid styling (danger border/header/error text) when:\n // 1. Any child field has an error AND (it's touched OR form was submitted), OR\n // 2. Object-level _errors exists AND no child errors AND (any child touched OR submitted)\n const rawShowInvalid =\n (hasChildErrors &&\n (hasVisibleChildErrors(errorRecord, fieldTouched) || submitCount > 0)) ||\n (hasObjectErrors &&\n !hasChildErrors &&\n (isAnyChildTouched || submitCount > 0));\n\n // Debounce to prevent flickering during rapid state changes\n const showInvalid = useDebounce(rawShowInvalid, 200);\n\n // className from slots\n const variants = fieldCardVariants({ invalid: showInvalid });\n const className = variantsToClassNames(variants, _className, 'base');\n\n return (\n <div className={className.base}>\n {/* card header with label */}\n {label ? (\n <div\n {...getLabelProps()}\n aria-level={3}\n // Override getLabelProps className to use our own invalid styling based on hasErrors,\n // not HeroUI's which is based on any child field being invalid\n className={className.label}\n role=\"heading\"\n >\n {label}\n {/* Manual asterisk: getLabelProps uses schema-required for the object itself,\n but FieldCard needs asterisk based on whether any CHILD field is required */}\n {isRequired ? (\n <span aria-hidden=\"true\" className=\"ml-0.5 text-danger\">\n *\n </span>\n ) : null}\n </div>\n ) : null}\n\n {/* card content */}\n <div className={className.content}>{children}</div>\n\n {/* card footer with validation errors - always show _errors, but danger styling controlled by showInvalid */}\n <FieldCardValidationError\n className={className.errorFooter}\n error={error}\n errorTextClassName={className.errorText}\n name={name}\n />\n </div>\n );\n};\n\nexport default FieldCard;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAiCA,MAAM,4BAA4B,EAChC,YAAY,KAAA,GACZ,QAAQ,KAAA,GACR,qBAAqB,KAAA,GACrB,WACmC;CACnC,MAAM,EAAE,sBAAsB,uBAAuB,WACnD,gBAAgB,EACd,KACF,CAAC;CAGH,MAAM,mBAAmB,iBAAiB;CAI1C,MAAM,YAAY,CAAC,CAAC,OAAO;CAE3B,OACE,oBAAC,iBAAD;EAAiB,SAAS,CAAC;YACxB,YACC,oBAAC,OAAO,KAAR;GAEE,MAAM,mBAAmB,KAAA,IAAY;IAAE,SAAS;IAAG,QAAQ;GAAE;GAC7D,SAAS,mBAAmB,QAAQ;IAAE,QAAQ;IAAG,SAAS;GAAE;GAC5D,OAAO,EAAE,UAAU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ACf,CAAC,CACH;CACF,CAAC,IACH;CAGJ,MAAM,kBACJ,KACA,SACwC;EACxC,IAAI,CAAC,KACH;EAEF,MAAM,OAAO,KAAK,MAAM,GAAG;EAC3B,IAAI,UAAmB;EACvB,KAAK,OAAO,QAAQ;GAClB,IAAI,WAAW,OAAO,YAAY,UAAU;IAC1C,UAAW,QAAoC;IAC/C,OAAO;GACT;GACA,UAAU,KAAA;GACV,OAAO;EACT,CAAC;EACD,OAAO;CACT;CAEA,MAAM,eAAe,eACnB,eACA,IACF;CAIA,MAAM,kBAAkB,CAAC,CAAC,OAAO;CAEjC,MAAM,cAAc;CAGpB,MAAM,iBAAiB,kBAAkB,WAAW;CAEpD,MAAM,oBAAoB,mBAAmB,YAAY;CAiBzD,MAAM,YAAY,qBADD,kBAAkB,EAAE,SAHjB,YAPjB,mBACE,sBAAsB,aAAa,YAAY,KAAK,cAAc,MACpE,mBACC,CAAC,mBACA,qBAAqB,cAAc,IAGQ,GAGQ,EAAE,CACZ,GAAG,YAAY,MAAM;CAEnE,OACE,qBAAC,OAAD;EAAK,WAAW,UAAU;YAA1B;GAEG,QACC,qBAAC,OAAD;IACE,GAAI,cAAc;IAClB,cAAY;IAGZ,WAAW,UAAU;IACrB,MAAK;cANP,CAQG,OAGA,aACC,oBAAC,QAAD;KAAM,eAAY;KAAO,WAAU;eAAqB;IAElD,CAAA,IACJ,IACD;QACH;GAGJ,oBAAC,OAAD;IAAK,WAAW,UAAU;IAAU;GAAc,CAAA;GAGlD,oBAAC,0BAAD;IACE,WAAW,UAAU;IACd;IACP,oBAAoB,UAAU;IACxB;GACP,CAAA;EACE;;AAET"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FieldCard-C-DZ5ARr.cjs","names":["useUniformField","AnimatePresence","motion","FieldValidationError","useUniformField","useFormContext","checkFieldIsRequired"],"sources":["../src/FieldCard/subcomponents/FieldCardValidationError.tsx","../src/FieldCard/FieldCard.tsx"],"sourcesContent":["import type { FieldError } from 'react-hook-form';\n\nimport {\n AnimatePresence,\n motion,\n useReducedMotion,\n} from '@fuf-stack/pixel-motion';\nimport { cn } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../../hooks/useUniformField';\nimport FieldValidationError from '../../partials/FieldValidationError/FieldValidationError';\n\nexport interface FieldCardValidationErrorProps {\n /** CSS class name for the error footer wrapper */\n className?: string;\n /** Error object from parent FieldCard (passed directly to avoid duplicate hook calls) */\n error?: FieldError[] | undefined;\n /** CSS class name for the error text (controls color based on invalid state) */\n errorTextClassName?: string;\n /** Field name */\n name: string;\n}\n\n/**\n * Renders validation errors in the footer of a FieldCard component.\n *\n * This component handles displaying field-level validation errors with proper\n * accessibility attributes and animates them in/out using Framer Motion.\n *\n * Note: Object-level errors (_errors) are always shown when they exist,\n * but the danger styling is controlled by the parent FieldCard based on\n * whether child fields have been touched.\n */\nconst FieldCardValidationError = ({\n className = undefined,\n error = undefined,\n errorTextClassName = undefined,\n name,\n}: FieldCardValidationErrorProps) => {\n const { getErrorMessageProps, getHelperWrapperProps, testId } =\n useUniformField({\n name,\n });\n\n // disable all animation if user prefers reduced motion\n const disableAnimation = useReducedMotion();\n\n // Always show object-level errors (_errors) when they exist\n // @ts-expect-error - error._errors exists but not typed\n const hasErrors = !!error?._errors;\n\n return (\n <AnimatePresence initial={!disableAnimation}>\n {hasErrors ? (\n <motion.div\n key=\"field-card-errors\"\n exit={disableAnimation ? undefined : { opacity: 0, height: 0 }}\n initial={disableAnimation ? false : { height: 0, opacity: 0 }}\n style={{ overflow: 'hidden' }}\n transition={{ duration: 0.4, ease: 'circOut' }}\n animate={\n disableAnimation ? undefined : { opacity: 1, height: 'auto' }\n }\n >\n <div\n {...getHelperWrapperProps()}\n className={cn(getHelperWrapperProps()?.className, className)}\n >\n <div\n {...getErrorMessageProps()}\n className={cn(\n getErrorMessageProps()?.className,\n errorTextClassName,\n )}\n >\n <FieldValidationError\n // @ts-expect-error - error._errors exists but not typed\n error={error._errors}\n testId={testId}\n />\n </div>\n </div>\n </motion.div>\n ) : null}\n </AnimatePresence>\n );\n};\n\nexport default FieldCardValidationError;\n","import type { TVClassName } from '@fuf-stack/pixel-utils';\nimport type { ReactNode } from 'react';\n\nimport { tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\nimport { useDebounce } from '@fuf-stack/pixels';\n\nimport { checkFieldIsRequired, useFormContext } from '../hooks/useFormContext';\nimport { useUniformField } from '../hooks/useUniformField';\nimport FieldCardValidationError from './subcomponents/FieldCardValidationError';\n\n/**\n * Recursively checks if any child field has an error (regardless of touched state).\n * Returns true if at least one child has an error.\n */\nexport const hasAnyChildErrors = (\n errors: Record<string, unknown> | undefined,\n): boolean => {\n if (!errors) {\n return false;\n }\n\n return Object.keys(errors)\n .filter((key) => {\n return key !== '_errors';\n })\n .some((key) => {\n const errorValue = errors[key];\n if (errorValue === undefined) {\n return false;\n }\n // If errorValue is an array, it's a leaf field error\n if (Array.isArray(errorValue)) {\n return true;\n }\n // Recursively check nested objects\n if (typeof errorValue === 'object' && errorValue !== null) {\n return hasAnyChildErrors(errorValue as Record<string, unknown>);\n }\n return false;\n });\n};\n\n/**\n * Recursively checks if any child field is touched.\n * Returns true if at least one child is touched.\n */\nexport const hasAnyChildTouched = (\n touched: Record<string, unknown> | undefined,\n): boolean => {\n if (!touched) {\n return false;\n }\n\n return Object.keys(touched)\n .filter((key) => {\n return key !== '_errors';\n })\n .some((key) => {\n const touchedValue = touched[key];\n if (touchedValue === undefined) {\n return false;\n }\n // If touchedValue is truthy (boolean true), field is touched\n if (touchedValue === true) {\n return true;\n }\n // Recursively check nested objects\n if (typeof touchedValue === 'object' && touchedValue !== null) {\n return hasAnyChildTouched(touchedValue as Record<string, unknown>);\n }\n return false;\n });\n};\n\n/**\n * Recursively checks if any child field with an error is also touched.\n * Returns true if at least one touched child has an error.\n */\nexport const hasVisibleChildErrors = (\n errors: Record<string, unknown> | undefined,\n touched: Record<string, unknown> | undefined,\n): boolean => {\n if (!errors || !touched) {\n return false;\n }\n\n return Object.keys(errors)\n .filter((key) => {\n // Skip object-level errors (_errors) - those are handled separately\n return key !== '_errors';\n })\n .some((key) => {\n const errorValue = errors[key];\n const touchedValue = touched[key];\n\n // If this key doesn't exist in both errors and touched, skip\n if (errorValue === undefined || touchedValue === undefined) {\n return false;\n }\n\n // If errorValue is an array, it's a leaf field error\n if (Array.isArray(errorValue)) {\n // touchedValue being truthy means the field is touched\n return !!touchedValue;\n }\n\n // Recursively check nested objects\n if (typeof errorValue === 'object' && errorValue !== null) {\n return hasVisibleChildErrors(\n errorValue as Record<string, unknown>,\n touchedValue as Record<string, unknown>,\n );\n }\n\n return false;\n });\n};\n\nexport const fieldCardVariants = tv({\n slots: {\n /** base class for the field card wrapper */\n base: [\n // base styles\n 'overflow-hidden rounded-small border bg-content1',\n // animate border color change, respect reduced motion\n 'transition-colors duration-150 motion-reduce:transition-none',\n ],\n /** class for the label/header */\n label: [\n // override HeroUI label positioning and display\n 'pointer-events-auto! static! z-auto! block! w-full!',\n // reset any transforms or translations\n 'translate-x-0! translate-y-0! transform-none!',\n // card header styling - use text-medium (16px) for proper header size\n 'rounded-t-small border-b p-3 font-semibold text-medium',\n // animate border and text color change, respect reduced motion\n 'transition-colors duration-150 motion-reduce:transition-none',\n ],\n /** class for the content */\n content: [\n // same as p-3 of Card component\n 'p-3',\n // default grid for form components (see Grid component)\n 'grid gap-4',\n ],\n /** class for the error footer wrapper */\n errorFooter: [\n 'border-t',\n // force helper to be visible and add padding (pt-1 to compensate for inner content's top padding)\n 'block px-3 pb-2 pt-1',\n // animate border color change, respect reduced motion\n 'transition-colors duration-150 motion-reduce:transition-none',\n ],\n /** class for the error text (empty base, color controlled by variant) */\n errorText: [],\n },\n variants: {\n invalid: {\n true: {\n base: 'border-danger-200',\n label: 'border-danger-200 text-danger',\n errorFooter: 'border-danger-200',\n errorText: '!text-danger text-tiny',\n },\n false: {\n base: 'border-divider',\n label: 'border-divider text-foreground',\n errorFooter: 'border-divider',\n errorText: '!text-foreground-500 text-tiny',\n },\n },\n },\n defaultVariants: {\n invalid: false,\n },\n});\n\ntype ClassName = TVClassName<typeof fieldCardVariants>;\n\nexport interface FieldCardProps {\n /** Content to render inside the card */\n children: ReactNode;\n /** CSS class name */\n className?: ClassName;\n /** Label content for the card header */\n label: ReactNode;\n /** Field name for validation */\n name: string;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\n/**\n * FieldCard component - A card-styled container with label header and error footer\n *\n * Displays form field content in a card layout with:\n * - Label/title in the header\n * - Content in the body\n * - Validation errors in the footer\n * - Danger outline when validation errors exist\n */\nconst FieldCard = ({\n children,\n className: _className = undefined,\n name,\n ...uniformFieldProps\n}: FieldCardProps) => {\n const { error, getLabelProps, label } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n const {\n control,\n formState: { touchedFields, submitCount },\n validation,\n } = useFormContext();\n\n // Check if any registered child field is required\n const validationInstance = validation?.baseInstance ?? validation?.instance;\n const registeredFields: string[] = Array.from(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (control as any)._names?.mount ?? [],\n );\n const childFieldPrefix = `${name}.`;\n const isRequired = validationInstance\n ? registeredFields\n .filter((f) => {\n return f.startsWith(childFieldPrefix);\n })\n .some((f) => {\n return checkFieldIsRequired(\n validationInstance,\n f.split('.').filter((k) => {\n return k !== '';\n }),\n );\n })\n : false;\n\n // Get touched state for this field's children by traversing the path\n const getNestedValue = (\n obj: Record<string, unknown> | undefined,\n path: string,\n ): Record<string, unknown> | undefined => {\n if (!obj) {\n return undefined;\n }\n const keys = path.split('.');\n let current: unknown = obj;\n keys.every((key) => {\n if (current && typeof current === 'object') {\n current = (current as Record<string, unknown>)[key];\n return true;\n }\n current = undefined;\n return false;\n });\n return current as Record<string, unknown> | undefined;\n };\n\n const fieldTouched = getNestedValue(\n touchedFields as Record<string, unknown>,\n name,\n );\n\n // Check for object-level errors (_errors)\n // @ts-expect-error - error._errors exists but not typed\n const hasObjectErrors = !!error?._errors;\n\n const errorRecord = error as unknown as Record<string, unknown>;\n\n // Check if any child field has errors (regardless of touched state)\n const hasChildErrors = hasAnyChildErrors(errorRecord);\n // Check if any child field is touched\n const isAnyChildTouched = hasAnyChildTouched(fieldTouched);\n\n // Show invalid styling (danger border/header/error text) when:\n // 1. Any child field has an error AND (it's touched OR form was submitted), OR\n // 2. Object-level _errors exists AND no child errors AND (any child touched OR submitted)\n const rawShowInvalid =\n (hasChildErrors &&\n (hasVisibleChildErrors(errorRecord, fieldTouched) || submitCount > 0)) ||\n (hasObjectErrors &&\n !hasChildErrors &&\n (isAnyChildTouched || submitCount > 0));\n\n // Debounce to prevent flickering during rapid state changes\n const showInvalid = useDebounce(rawShowInvalid, 200);\n\n // className from slots\n const variants = fieldCardVariants({ invalid: showInvalid });\n const className = variantsToClassNames(variants, _className, 'base');\n\n return (\n <div className={className.base}>\n {/* card header with label */}\n {label ? (\n <div\n {...getLabelProps()}\n aria-level={3}\n // Override getLabelProps className to use our own invalid styling based on hasErrors,\n // not HeroUI's which is based on any child field being invalid\n className={className.label}\n role=\"heading\"\n >\n {label}\n {/* Manual asterisk: getLabelProps uses schema-required for the object itself,\n but FieldCard needs asterisk based on whether any CHILD field is required */}\n {isRequired ? (\n <span aria-hidden=\"true\" className=\"ml-0.5 text-danger\">\n *\n </span>\n ) : null}\n </div>\n ) : null}\n\n {/* card content */}\n <div className={className.content}>{children}</div>\n\n {/* card footer with validation errors - always show _errors, but danger styling controlled by showInvalid */}\n <FieldCardValidationError\n className={className.errorFooter}\n error={error}\n errorTextClassName={className.errorText}\n name={name}\n />\n </div>\n );\n};\n\nexport default FieldCard;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAiCA,MAAM,4BAA4B,EAChC,YAAY,KAAA,GACZ,QAAQ,KAAA,GACR,qBAAqB,KAAA,GACrB,WACmC;CACnC,MAAM,EAAE,sBAAsB,uBAAuB,WACnDA,oCAAAA,gBAAgB,EACd,KACF,CAAC;CAGH,MAAM,oBAAA,GAAA,wBAAA,k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IACE,GAAI,cAAc;IAClB,cAAY;IAGZ,WAAW,UAAU;IACrB,MAAK;cANP,CAQG,OAGA,aACC,iBAAA,GAAA,kBAAA,KAAC,QAAD;KAAM,eAAY;KAAO,WAAU;eAAqB;IAElD,CAAA,IACJ,IACD;QACH;GAGJ,iBAAA,GAAA,kBAAA,KAAC,OAAD;IAAK,WAAW,UAAU;IAAU;GAAc,CAAA;GAGlD,iBAAA,GAAA,kBAAA,KAAC,0BAAD;IACE,WAAW,UAAU;IACd;IACP,oBAAoB,UAAU;IACxB;GACP,CAAA;EACE;;AAET"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RadioBoxes-BJz-aJp3.js","names":["HeroRadioGroup"],"sources":["../src/RadioBoxes/RadioBox.tsx","../src/RadioBoxes/RadioBoxes.tsx","../src/RadioBoxes/index.ts"],"sourcesContent":["import type { TVClassName } from '@fuf-stack/pixel-utils';\nimport type { RadioProps as HeroRadioProps } from '@heroui/radio';\nimport type { ReactNode } from 'react';\n\nimport { useRadio } from '@heroui/radio';\nimport { VisuallyHidden } from '@react-aria/visually-hidden';\n\nimport { cn, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nexport const radioBoxVariants = tv({\n slots: {\n base: 'group inline-flex flex-auto cursor-pointer items-center justify-between gap-4 rounded-lg border-2 border-default p-4 hover:bg-content2 data-[selected=true]:border-focus',\n control: '',\n description: 'text-foreground opacity-70 text-small',\n icon: '',\n label: '',\n labelWrapper: 'grow',\n },\n variants: {\n isDisabled: {\n true: {\n base: 'pointer-events-none opacity-disabled',\n },\n },\n isInvalid: {\n true: {\n base: '!border-danger',\n },\n },\n },\n});\n\ntype ClassName = TVClassName<typeof radioBoxVariants>;\n\nexport interface RadioBoxProps extends Omit<HeroRadioProps, 'className'> {\n /** CSS class name */\n className?: ClassName;\n /** icon for the option */\n icon?: ReactNode;\n /** whether the radio is invalid */\n isInvalid?: boolean;\n}\n\nexport const RadioBox = ({\n classNames: _classNames = undefined,\n icon = undefined,\n isInvalid = false,\n ...props\n}: RadioBoxProps) => {\n const {\n children,\n Component,\n description,\n getBaseProps,\n getControlProps,\n getInputProps,\n getLabelProps,\n getLabelWrapperProps,\n getWrapperProps,\n isDisabled,\n } = useRadio(props as HeroRadioProps);\n\n // classNames from slots\n const variants = radioBoxVariants({\n isDisabled,\n isInvalid,\n });\n const classNames = variantsToClassNames(\n variants,\n // @ts-expect-error not sure here, but it works\n _classNames,\n 'base',\n );\n\n return (\n <Component {...getBaseProps()} className={classNames.base}>\n <VisuallyHidden>\n <input {...getInputProps()} />\n </VisuallyHidden>\n {!icon ? (\n <span {...getWrapperProps()}>\n <span\n {...getControlProps()}\n className={cn(getControlProps().className, classNames.control)}\n />\n </span>\n ) : null}\n {icon ? <div className={classNames.icon}>{icon}</div> : null}\n <div\n {...getLabelWrapperProps()}\n className={cn(\n getLabelWrapperProps().className,\n classNames.labelWrapper,\n )}\n >\n {children ? (\n <span\n {...getLabelProps()}\n className={cn(getLabelProps().className, classNames.label)}\n >\n {children}\n </span>\n ) : null}\n {description ? (\n <div className={classNames.description}>{description}</div>\n ) : null}\n </div>\n {icon ? (\n <span {...getWrapperProps()}>\n <span\n {...getControlProps()}\n className={cn(getControlProps().className, classNames.control)}\n />\n </span>\n ) : null}\n </Component>\n );\n};\n\nexport default RadioBox;\n","import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { ReactNode } from 'react';\n//\nimport type { RadioBoxProps } from './RadioBox';\n\nimport { RadioGroup as HeroRadioGroup } from '@heroui/radio';\n\nimport { slugify, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { createOptionValueConverter } from '../helpers';\nimport { useUniformField } from '../hooks/useUniformField';\nimport { RadioBox } from './RadioBox';\n\nexport const radioBoxesVariants = tv({\n slots: {\n base: 'group gap-0', // Needs group for group-data condition\n boxBase: '',\n boxControl: '',\n boxDescription: '',\n boxLabel: '',\n boxLabelWrapper: '',\n // see HeroUI styles for group-data condition,\n // e.g.: https://github.com/heroui-inc/heroui/blob/main/packages/core/theme/src/components/select.ts\n label:\n 'mb-2 inline-flex text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:text-danger',\n wrapper: '',\n },\n});\n\ntype VariantProps = TVProps<typeof radioBoxesVariants>;\ntype ClassName = TVClassName<typeof radioBoxesVariants>;\n\nexport interface 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,mBAAmB,GAAG;CACjC,OAAO;EACL,MAAM;EACN,SAAS;EACT,aAAa;EACb,MAAM;EACN,OAAO;EACP,cAAc;CAChB;CACA,UAAU;EACR,YAAY,EACV,MAAM,EACJ,MAAM,uCACR,EACF;EACA,WAAW,EACT,MAAM,EACJ,MAAM,iBACR,EACF;CACF;AACF,CAAC;AAaD,MAAa,YAAY,EACvB,YAAY,cAAc,KAAA,GAC1B,OAAO,KAAA,GACP,YAAY,OACZ,GAAG,YACgB;CACnB,MAAM,EACJ,UACA,WACA,aACA,cACA,iBACA,eACA,eACA,sBACA,iBACA,eACE,SAAS,KAAuB;CAOpC,MAAM,a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A,GAAG;CACL,CAAC;CAGD,MAAM,EAAE,0BAA0B,2BAA2B,OAAO;CAIpE,MAAM,aAAa,qBADF,mBAC8B,GAAG,WAAW,MAAM;CACnE,MAAM,gBAA6C;EACjD,MAAM,WAAW;EACjB,SAAS,WAAW;EACpB,aAAa,WAAW;EACxB,OAAO,WAAW;EAClB,cAAc,WAAW;CAC3B;CAEA,OACE,oBAACA,YAAD;EACO;EACL,cAAY;EACA;EAGZ,gBAAc;EACd,iBAAe;EACf,eAAa;EACC;EACd,YAAY;EACZ,WAAW;EACX,YAAY;EACZ,OAAO,QAAQ,oBAAC,UAAD,EAAA,UAAS,MAAc,CAAA,IAAI;EACpC;EACE;EACR,aAAa,SAAS,eAAe;EACrC,OAAO,SAAS,OAAO,OAAO,KAAK,IAAI;EACvC,gBAAgB,aAAa;GAC3B,SAAS,sBAAsB,QAAQ,CAAC;EAC1C;YAEC,QAAQ,KAAK,WAAW;GACvB,IAAI,WAAW,QAKb,OACE,oBAAC,UAAD;IAEE,YAAY;IACZ,eARiB,QACnB,GAAG,OAAO,UAAU,OAAO,UAAU,OAAO,SAC5C,EAAE,aAAa,KAAK,CAMM;IACxB,aAAa,OAAO;IACpB,MAAM,OAAO;IACb,YAAY,CAAC,CAAC,YAAY,OAAO;IACjC,WAAW;IACX,OAAO,OAAO,OAAO,KAAK;cAEzB,OAAO,SAAS,OAAO;GAChB,GAVH,OAAO,OAAO,KAAK,CAUhB;GAGd,OAAO;EACT,CAAC;CACa,CAAA;AAEpB;;;ACjJA,IAAA,qBAAe"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"RadioBoxes-CR--FBhQ.cjs","names":["VisuallyHidden","useUniformField","createOptionValueConverter","HeroRadioGroup"],"sources":["../src/RadioBoxes/RadioBox.tsx","../src/RadioBoxes/RadioBoxes.tsx","../src/RadioBoxes/index.ts"],"sourcesContent":["import type { TVClassName } from '@fuf-stack/pixel-utils';\nimport type { RadioProps as HeroRadioProps } from '@heroui/radio';\nimport type { ReactNode } from 'react';\n\nimport { useRadio } from '@heroui/radio';\nimport { VisuallyHidden } from '@react-aria/visually-hidden';\n\nimport { cn, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nexport const radioBoxVariants = tv({\n slots: {\n base: 'group inline-flex flex-auto cursor-pointer items-center justify-between gap-4 rounded-lg border-2 border-default p-4 hover:bg-content2 data-[selected=true]:border-focus',\n control: '',\n description: 'text-foreground opacity-70 text-small',\n icon: '',\n label: '',\n labelWrapper: 'grow',\n },\n variants: {\n isDisabled: {\n true: {\n base: 'pointer-events-none opacity-disabled',\n },\n },\n isInvalid: {\n true: {\n base: '!border-danger',\n },\n },\n },\n});\n\ntype ClassName = TVClassName<typeof radioBoxVariants>;\n\nexport interface RadioBoxProps extends Omit<HeroRadioProps, 'className'> {\n /** CSS class name */\n className?: ClassName;\n /** icon for the option */\n icon?: ReactNode;\n /** whether the radio is invalid */\n isInvalid?: boolean;\n}\n\nexport const RadioBox = ({\n classNames: _classNames = undefined,\n icon = undefined,\n isInvalid = false,\n ...props\n}: RadioBoxProps) => {\n const {\n children,\n Component,\n description,\n getBaseProps,\n getControlProps,\n getInputProps,\n getLabelProps,\n getLabelWrapperProps,\n getWrapperProps,\n isDisabled,\n } = useRadio(props as HeroRadioProps);\n\n // classNames from slots\n const variants = radioBoxVariants({\n isDisabled,\n isInvalid,\n });\n const classNames = variantsToClassNames(\n variants,\n // @ts-expect-error not sure here, but it works\n _classNames,\n 'base',\n );\n\n return (\n <Component {...getBaseProps()} className={classNames.base}>\n <VisuallyHidden>\n <input {...getInputProps()} />\n </VisuallyHidden>\n {!icon ? (\n <span {...getWrapperProps()}>\n <span\n {...getControlProps()}\n className={cn(getControlProps().className, classNames.control)}\n />\n </span>\n ) : null}\n {icon ? <div className={classNames.icon}>{icon}</div> : null}\n <div\n {...getLabelWrapperProps()}\n className={cn(\n getLabelWrapperProps().className,\n classNames.labelWrapper,\n )}\n >\n {children ? (\n <span\n {...getLabelProps()}\n className={cn(getLabelProps().className, classNames.label)}\n >\n {children}\n </span>\n ) : null}\n {description ? (\n <div className={classNames.description}>{description}</div>\n ) : null}\n </div>\n {icon ? (\n <span {...getWrapperProps()}>\n <span\n {...getControlProps()}\n className={cn(getControlProps().className, classNames.control)}\n />\n </span>\n ) : null}\n </Component>\n );\n};\n\nexport default RadioBox;\n","import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { ReactNode } from 'react';\n//\nimport type { RadioBoxProps } from './RadioBox';\n\nimport { RadioGroup as HeroRadioGroup } from '@heroui/radio';\n\nimport { slugify, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { createOptionValueConverter } from '../helpers';\nimport { useUniformField } from '../hooks/useUniformField';\nimport { RadioBox } from './RadioBox';\n\nexport const radioBoxesVariants = tv({\n slots: {\n base: 'group gap-0', // Needs group for group-data condition\n boxBase: '',\n boxControl: '',\n boxDescription: '',\n boxLabel: '',\n boxLabelWrapper: '',\n // see HeroUI styles for group-data condition,\n // e.g.: https://github.com/heroui-inc/heroui/blob/main/packages/core/theme/src/components/select.ts\n label:\n 'mb-2 inline-flex text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:text-danger',\n wrapper: '',\n },\n});\n\ntype VariantProps = TVProps<typeof radioBoxesVariants>;\ntype ClassName = TVClassName<typeof radioBoxesVariants>;\n\nexport interface 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,oBAAA,GAAA,uBAAA,IAAsB;CACjC,OAAO;EACL,MAAM;EACN,SAAS;EACT,aAAa;EACb,MAAM;EACN,OAAO;EACP,cAAc;CAChB;CACA,UAAU;EACR,YAAY,EACV,MAAM,EACJ,MAAM,uCACR,EACF;EACA,WAAW,EACT,MAAM,EACJ,MAAM,iBACR,EACF;CACF;AACF,CAAC;AAaD,MAAa,YAAY,EACvB,YAAY,cAAc,KAAA,GAC1B,OAAO,KAAA,GACP,YAAY,OACZ,GAAG,YACgB;CACnB,MAAM,EACJ,UACA,WACA,aACA,cACA,iBACA,eACA,eACA,sBACA,iBACA,gBAAA,GAAA,cAAA,UACW,KAAuB;CAOpC,MAAM,cAAA,GAAA,uBAAA,sBAJW,iBAAiB;EAChC;EACA;CACF,CAES,GAEP,aACA,MACF;CAEA,OACE,iBAAA,GAAA,kBAAA,MAAC,WAAD;EAAW,GAAI,aAAa;EAAG,WAAW,WAAW;YAArD;GACE,iBAAA,GAAA,kBAAA,KAACA,4BAAAA,gBAAD,EAAA,UACE,iBAAA,GAAA,kBAAA,KAAC,SAAD,EAAO,GAAI,cAAc,EAAI,CAAA,EACf,CAAA;GACf,CAAC,OACA,iBAAA,GAAA,kBAAA,KAAC,QAAD;IAAM,GAAI,gBAAgB;cACxB,iBAAA,GAAA,kBAAA,KAAC,QAAD;KACE,GAAI,gBAAgB;KACpB,YAAA,GAAA,uBAAA,IAAc,gBAAgB,EAAE,WAAW,WAAW,OAAO;IAC9D,CAAA;GACG,CAAA,IACJ;GACH,OAAO,iBAAA,GAAA,kBAAA,KAAC,OAAD;IAAK,WAAW,WAAW;cAAO;GA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