@fuf-stack/uniform 1.22.3 → 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.
Files changed (227) hide show
  1. package/dist/Checkboxes/index.cjs +2 -1
  2. package/dist/Checkboxes/index.d.cts +2 -2
  3. package/dist/Checkboxes/index.d.ts +2 -2
  4. package/dist/Checkboxes/index.js +2 -2
  5. package/dist/{Checkboxes-DHk09GmH.cjs → Checkboxes-DrJqx6O2.cjs} +7 -1
  6. package/dist/{Checkboxes-DHk09GmH.cjs.map → Checkboxes-DrJqx6O2.cjs.map} +1 -1
  7. package/dist/{Checkboxes-D1hppxDE.js → Checkboxes-X6FRwI50.js} +2 -2
  8. package/dist/{Checkboxes-D1hppxDE.js.map → Checkboxes-X6FRwI50.js.map} +1 -1
  9. package/dist/DatePicker/index.cjs +2 -1
  10. package/dist/DatePicker/index.d.cts +2 -2
  11. package/dist/DatePicker/index.d.ts +2 -2
  12. package/dist/DatePicker/index.js +2 -2
  13. package/dist/{DatePicker-BUSi8SWQ.js → DatePicker-CGIWizz9.js} +2 -2
  14. package/dist/{DatePicker-BUSi8SWQ.js.map → DatePicker-CGIWizz9.js.map} +1 -1
  15. package/dist/{DatePicker-DuBjvS5g.cjs → DatePicker-CYUuwwsm.cjs} +7 -1
  16. package/dist/{DatePicker-DuBjvS5g.cjs.map → DatePicker-CYUuwwsm.cjs.map} +1 -1
  17. package/dist/FieldArray/index.cjs +2 -1
  18. package/dist/FieldArray/index.d.cts +2 -2
  19. package/dist/FieldArray/index.d.ts +2 -2
  20. package/dist/FieldArray/index.js +2 -2
  21. package/dist/{FieldArray-BxmK1NRd.js → FieldArray-Dkw6JBnT.js} +2 -2
  22. package/dist/{FieldArray-BxmK1NRd.js.map → FieldArray-Dkw6JBnT.js.map} +1 -1
  23. package/dist/{FieldArray-DgiQpIdr.cjs → FieldArray-V66fsvtd.cjs} +7 -1
  24. package/dist/{FieldArray-DgiQpIdr.cjs.map → FieldArray-V66fsvtd.cjs.map} +1 -1
  25. package/dist/FieldCard/index.cjs +6 -2
  26. package/dist/FieldCard/index.d.cts +2 -2
  27. package/dist/FieldCard/index.d.ts +2 -2
  28. package/dist/FieldCard/index.js +2 -2
  29. package/dist/{FieldCard-C-DZ5ARr.cjs → FieldCard-CAHnM8C0.cjs} +10 -1
  30. package/dist/FieldCard-CAHnM8C0.cjs.map +1 -0
  31. package/dist/{FieldCard-BK6SNqFY.js → FieldCard-Cg31ce9J.js} +5 -2
  32. package/dist/FieldCard-Cg31ce9J.js.map +1 -0
  33. package/dist/Input/index.d.cts +1 -1
  34. package/dist/Input/index.d.ts +1 -1
  35. package/dist/RadioBoxes/index.cjs +1 -1
  36. package/dist/RadioBoxes/index.d.cts +2 -2
  37. package/dist/RadioBoxes/index.d.ts +2 -2
  38. package/dist/RadioBoxes/index.js +1 -1
  39. package/dist/{RadioBoxes-CR--FBhQ.cjs → RadioBoxes-BmLrbYXt.cjs} +3 -3
  40. package/dist/RadioBoxes-BmLrbYXt.cjs.map +1 -0
  41. package/dist/{RadioBoxes-BJz-aJp3.js → RadioBoxes-DWxJBTKR.js} +3 -3
  42. package/dist/RadioBoxes-DWxJBTKR.js.map +1 -0
  43. package/dist/RadioTabs/index.cjs +2 -1
  44. package/dist/RadioTabs/index.d.cts +2 -2
  45. package/dist/RadioTabs/index.d.ts +2 -2
  46. package/dist/RadioTabs/index.js +2 -2
  47. package/dist/{RadioTabs-Btt582Nl.cjs → RadioTabs-14XTbTJU.cjs} +20 -14
  48. package/dist/RadioTabs-14XTbTJU.cjs.map +1 -0
  49. package/dist/{RadioTabs-CYmzrPBG.js → RadioTabs-DAY6MYJI.js} +15 -15
  50. package/dist/RadioTabs-DAY6MYJI.js.map +1 -0
  51. package/dist/Radios/index.cjs +2 -1
  52. package/dist/Radios/index.d.cts +2 -2
  53. package/dist/Radios/index.d.ts +2 -2
  54. package/dist/Radios/index.js +2 -2
  55. package/dist/{Radios-DZxhrX96.js → Radios-C938-msm.js} +2 -2
  56. package/dist/{Radios-DZxhrX96.js.map → Radios-C938-msm.js.map} +1 -1
  57. package/dist/{Radios-Jg9mwE0B.cjs → Radios-D_B9Y8s2.cjs} +7 -1
  58. package/dist/{Radios-Jg9mwE0B.cjs.map → Radios-D_B9Y8s2.cjs.map} +1 -1
  59. package/dist/Select/index.cjs +2 -1
  60. package/dist/Select/index.d.cts +2 -2
  61. package/dist/Select/index.d.ts +2 -2
  62. package/dist/Select/index.js +2 -2
  63. package/dist/{Select-CgeqhZIC.js → Select-BL6k_e-D.js} +2 -2
  64. package/dist/Select-BL6k_e-D.js.map +1 -0
  65. package/dist/{Select-CZwuEAB5.cjs → Select-D66A-hYm.cjs} +7 -1
  66. package/dist/Select-D66A-hYm.cjs.map +1 -0
  67. package/dist/Slider/index.cjs +2 -1
  68. package/dist/Slider/index.d.cts +2 -2
  69. package/dist/Slider/index.d.ts +2 -2
  70. package/dist/Slider/index.js +2 -2
  71. package/dist/{Slider-Bpxt-Qgj.cjs → Slider-ChC2PZNb.cjs} +7 -1
  72. package/dist/{Slider-Bpxt-Qgj.cjs.map → Slider-ChC2PZNb.cjs.map} +1 -1
  73. package/dist/{Slider-DRfSw0uE.js → Slider-DmEwhC1T.js} +2 -2
  74. package/dist/{Slider-DRfSw0uE.js.map → Slider-DmEwhC1T.js.map} +1 -1
  75. package/dist/Switch/index.cjs +2 -1
  76. package/dist/Switch/index.d.cts +2 -2
  77. package/dist/Switch/index.d.ts +2 -2
  78. package/dist/Switch/index.js +2 -2
  79. package/dist/{Switch-hjjy34QB.cjs → Switch-Ch6_VInV.cjs} +7 -1
  80. package/dist/{Switch-hjjy34QB.cjs.map → Switch-Ch6_VInV.cjs.map} +1 -1
  81. package/dist/{Switch-D9DNrqmj.js → Switch-DvKRPFcC.js} +2 -2
  82. package/dist/{Switch-D9DNrqmj.js.map → Switch-DvKRPFcC.js.map} +1 -1
  83. package/dist/SwitchBox/index.d.cts +1 -1
  84. package/dist/SwitchBox/index.d.ts +1 -1
  85. package/dist/SwitchBox-BU1XieaZ.js.map +1 -1
  86. package/dist/SwitchBox-Dl-F5y2m.cjs.map +1 -1
  87. package/dist/TextArea/index.d.cts +1 -1
  88. package/dist/TextArea/index.d.ts +1 -1
  89. package/dist/Time/index.cjs +7 -2
  90. package/dist/Time/index.d.cts +2 -2
  91. package/dist/Time/index.d.ts +2 -2
  92. package/dist/Time/index.js +2 -2
  93. package/dist/{Time-CDptQ3CK.js → Time-B_SXrKWK.js} +5 -2
  94. package/dist/Time-B_SXrKWK.js.map +1 -0
  95. package/dist/{Time-WKgbji5k.cjs → Time-CYoWaQsz.cjs} +16 -1
  96. package/dist/Time-CYoWaQsz.cjs.map +1 -0
  97. package/dist/hooks/useUniformFieldArray/index.cjs +4 -4
  98. package/dist/hooks/useUniformFieldArray/index.cjs.map +1 -1
  99. package/dist/hooks/useUniformFieldArray/index.js +4 -4
  100. package/dist/hooks/useUniformFieldArray/index.js.map +1 -1
  101. package/dist/index-19JGtN7H.d.cts +1257 -0
  102. package/dist/index-19JGtN7H.d.cts.map +1 -0
  103. package/dist/index-B4XExHDi.d.cts +539 -0
  104. package/dist/index-B4XExHDi.d.cts.map +1 -0
  105. package/dist/index-BUZEnZDm.d.ts +1760 -0
  106. package/dist/index-BUZEnZDm.d.ts.map +1 -0
  107. package/dist/index-Bbaubtxp.d.cts +677 -0
  108. package/dist/index-Bbaubtxp.d.cts.map +1 -0
  109. package/dist/index-BdgFJ-dj.d.ts +1028 -0
  110. package/dist/index-BdgFJ-dj.d.ts.map +1 -0
  111. package/dist/index-BiZNkLK3.d.cts +1477 -0
  112. package/dist/index-BiZNkLK3.d.cts.map +1 -0
  113. package/dist/index-Bie3CWyW.d.cts +1760 -0
  114. package/dist/index-Bie3CWyW.d.cts.map +1 -0
  115. package/dist/index-BsTqcI1C.d.cts +659 -0
  116. package/dist/index-BsTqcI1C.d.cts.map +1 -0
  117. package/dist/index-C6Y8KybK.d.ts +677 -0
  118. package/dist/index-C6Y8KybK.d.ts.map +1 -0
  119. package/dist/index-CD0Wpla3.d.cts +1413 -0
  120. package/dist/index-CD0Wpla3.d.cts.map +1 -0
  121. package/dist/index-CUByIf_d.d.ts +314 -0
  122. package/dist/index-CUByIf_d.d.ts.map +1 -0
  123. package/dist/index-Cf2B9woY.d.cts +473 -0
  124. package/dist/index-Cf2B9woY.d.cts.map +1 -0
  125. package/dist/index-CqXEYILn.d.cts +1263 -0
  126. package/dist/index-CqXEYILn.d.cts.map +1 -0
  127. package/dist/index-D1cB3mbB.d.ts +3917 -0
  128. package/dist/index-D1cB3mbB.d.ts.map +1 -0
  129. package/dist/index-D7AUghFx.d.ts +1413 -0
  130. package/dist/index-D7AUghFx.d.ts.map +1 -0
  131. package/dist/index-DCwffq1f.d.ts +1263 -0
  132. package/dist/index-DCwffq1f.d.ts.map +1 -0
  133. package/dist/index-DFbuWomg.d.ts +534 -0
  134. package/dist/index-DFbuWomg.d.ts.map +1 -0
  135. package/dist/index-DXOBPBft.d.ts +659 -0
  136. package/dist/index-DXOBPBft.d.ts.map +1 -0
  137. package/dist/index-DY-d4cFe.d.cts +1028 -0
  138. package/dist/index-DY-d4cFe.d.cts.map +1 -0
  139. package/dist/index-DqMpHpu7.d.ts +1257 -0
  140. package/dist/index-DqMpHpu7.d.ts.map +1 -0
  141. package/dist/index-DwnqyNnX.d.cts +534 -0
  142. package/dist/index-DwnqyNnX.d.cts.map +1 -0
  143. package/dist/index-OdNTqjhQ.d.ts +585 -0
  144. package/dist/index-OdNTqjhQ.d.ts.map +1 -0
  145. package/dist/index-QPDvw5Z5.d.cts +585 -0
  146. package/dist/index-QPDvw5Z5.d.cts.map +1 -0
  147. package/dist/index-amMd-sQN.d.ts +473 -0
  148. package/dist/index-amMd-sQN.d.ts.map +1 -0
  149. package/dist/index-clztdahp.d.ts +1477 -0
  150. package/dist/index-clztdahp.d.ts.map +1 -0
  151. package/dist/index-jK092-MJ.d.cts +314 -0
  152. package/dist/index-jK092-MJ.d.cts.map +1 -0
  153. package/dist/index-veBM95Gw.d.cts +3917 -0
  154. package/dist/index-veBM95Gw.d.cts.map +1 -0
  155. package/dist/index-yYjVSHlN.d.ts +539 -0
  156. package/dist/index-yYjVSHlN.d.ts.map +1 -0
  157. package/dist/index.cjs +20 -11
  158. package/dist/index.d.cts +15 -15
  159. package/dist/index.d.ts +15 -15
  160. package/dist/index.js +12 -12
  161. package/package.json +6 -6
  162. package/dist/FieldCard-BK6SNqFY.js.map +0 -1
  163. package/dist/FieldCard-C-DZ5ARr.cjs.map +0 -1
  164. package/dist/RadioBoxes-BJz-aJp3.js.map +0 -1
  165. package/dist/RadioBoxes-CR--FBhQ.cjs.map +0 -1
  166. package/dist/RadioTabs-Btt582Nl.cjs.map +0 -1
  167. package/dist/RadioTabs-CYmzrPBG.js.map +0 -1
  168. package/dist/Select-CZwuEAB5.cjs.map +0 -1
  169. package/dist/Select-CgeqhZIC.js.map +0 -1
  170. package/dist/Time-CDptQ3CK.js.map +0 -1
  171. package/dist/Time-WKgbji5k.cjs.map +0 -1
  172. package/dist/index-B4jKGy-P.d.ts +0 -167
  173. package/dist/index-B4jKGy-P.d.ts.map +0 -1
  174. package/dist/index-B5SfdA5O.d.cts +0 -99
  175. package/dist/index-B5SfdA5O.d.cts.map +0 -1
  176. package/dist/index-B61zRzeS.d.cts +0 -101
  177. package/dist/index-B61zRzeS.d.cts.map +0 -1
  178. package/dist/index-BDFJDKmz.d.ts +0 -166
  179. package/dist/index-BDFJDKmz.d.ts.map +0 -1
  180. package/dist/index-BE4OAqJ2.d.cts +0 -113
  181. package/dist/index-BE4OAqJ2.d.cts.map +0 -1
  182. package/dist/index-BMEKfOWp.d.ts +0 -174
  183. package/dist/index-BMEKfOWp.d.ts.map +0 -1
  184. package/dist/index-BPaSE_7b.d.ts +0 -179
  185. package/dist/index-BPaSE_7b.d.ts.map +0 -1
  186. package/dist/index-BSjcTo7A.d.ts +0 -147
  187. package/dist/index-BSjcTo7A.d.ts.map +0 -1
  188. package/dist/index-Bgo2Dr6X.d.cts +0 -174
  189. package/dist/index-Bgo2Dr6X.d.cts.map +0 -1
  190. package/dist/index-BmMspnsJ.d.cts +0 -137
  191. package/dist/index-BmMspnsJ.d.cts.map +0 -1
  192. package/dist/index-BvbHkoH5.d.cts +0 -290
  193. package/dist/index-BvbHkoH5.d.cts.map +0 -1
  194. package/dist/index-C6DBVs7t.d.ts +0 -116
  195. package/dist/index-C6DBVs7t.d.ts.map +0 -1
  196. package/dist/index-CIiOXrrY.d.ts +0 -99
  197. package/dist/index-CIiOXrrY.d.ts.map +0 -1
  198. package/dist/index-CSRKNes5.d.cts +0 -167
  199. package/dist/index-CSRKNes5.d.cts.map +0 -1
  200. package/dist/index-CbPJiRK2.d.ts +0 -83
  201. package/dist/index-CbPJiRK2.d.ts.map +0 -1
  202. package/dist/index-CbQ8Ft4o.d.ts +0 -113
  203. package/dist/index-CbQ8Ft4o.d.ts.map +0 -1
  204. package/dist/index-CvP3tbVV.d.ts +0 -137
  205. package/dist/index-CvP3tbVV.d.ts.map +0 -1
  206. package/dist/index-Cwb7sTO0.d.ts +0 -154
  207. package/dist/index-Cwb7sTO0.d.ts.map +0 -1
  208. package/dist/index-CxY9VWv5.d.cts +0 -154
  209. package/dist/index-CxY9VWv5.d.cts.map +0 -1
  210. package/dist/index-Cz4JaCWd.d.ts +0 -122
  211. package/dist/index-Cz4JaCWd.d.ts.map +0 -1
  212. package/dist/index-DBsF7xsq.d.cts +0 -147
  213. package/dist/index-DBsF7xsq.d.cts.map +0 -1
  214. package/dist/index-DMOhTl4I.d.cts +0 -116
  215. package/dist/index-DMOhTl4I.d.cts.map +0 -1
  216. package/dist/index-DRg0anjB.d.cts +0 -179
  217. package/dist/index-DRg0anjB.d.cts.map +0 -1
  218. package/dist/index-DUmNI6cE.d.cts +0 -83
  219. package/dist/index-DUmNI6cE.d.cts.map +0 -1
  220. package/dist/index-Db0WD4d1.d.cts +0 -166
  221. package/dist/index-Db0WD4d1.d.cts.map +0 -1
  222. package/dist/index-GqydEAFk.d.ts +0 -290
  223. package/dist/index-GqydEAFk.d.ts.map +0 -1
  224. package/dist/index-PMCqBX0t.d.ts +0 -101
  225. package/dist/index-PMCqBX0t.d.ts.map +0 -1
  226. package/dist/index-Q3BWGyUO.d.cts +0 -122
  227. package/dist/index-Q3BWGyUO.d.cts.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,SAAA;EAEZ,mBAAA;EAKA,mBAAA,GAAsB,aAAA;EAzBtB;EA2BA,IAAA;EA1BI;EA4BJ,KAAA,GAAQ,SAAA;EA5BO;EA8Bf,uBAAA;EA5Be;EA8Bf,IAAA;;EAEA,MAAA;AAAA;;;cCzCW,kBAAA,IAAkB,KAAA;;;gbFIU;;;;obAEvC;AAAA;;;;kbAMM;;;;sbCpBS;EAAA;;;;kbACH;;;;sbAAwC;EAAA;;;;kbAKpD;;;;sbAMA;EAAA;;;;kbAGe;;;;sbAEkB;EAAA;;;;kbAMzB;;;;sbAGuB;EAAA;;;;kbAAQ;;;;sbAAA;EAAA;;;;kbAMvC;;;;sbAOsB;EAAA;;;;kbAQtB;;;;;;;;;kbCmDA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2bAuID;gcAAA;0bAAA;ubAlImB;4bAAA;2bAAA;6bAAA;IAAA;;;;ubAAA;obAAA;mbAAA;mbAajB;gcAAe;2bAAA;gcAbE;0bAAA;ubAAA;4bAAA;2bAAA;6bAAA;IAAA;EAAA;;;;;;kbAAA;;;;sbAAA;EAAA;;;;;;cAAd,UAAA;EAAc,gBAAA;EAAA,QAAA;EAAA,SAAA,EAAA,UAAA;EAAA,SAAA;EAAA,mBAAA,EAAA,oBAAA;EAAA,mBAAA;EAAA,IAAA;EAAA,WAAA;EAAA,uBAAA;EAAA,IAAA;EAAA,QAAA;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-DHk09GmH.cjs");
11
- const require_DatePicker = require("./DatePicker-DuBjvS5g.cjs");
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-DgiQpIdr.cjs");
14
+ const require_FieldArray = require("./FieldArray-V66fsvtd.cjs");
15
15
  const require_Grid = require("./Grid-D-VcRGi9.cjs");
16
- const require_FieldCard = require("./FieldCard-C-DZ5ARr.cjs");
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-CR--FBhQ.cjs");
21
- const require_RadioTabs = require("./RadioTabs-Btt582Nl.cjs");
22
- const require_Radios = require("./Radios-Jg9mwE0B.cjs");
23
- const require_Select = require("./Select-CZwuEAB5.cjs");
24
- const require_Slider = require("./Slider-Bpxt-Qgj.cjs");
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-hjjy34QB.cjs");
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-WKgbji5k.cjs");
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,21 +1,21 @@
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-DRg0anjB.cjs";
3
- import { n as DatePickerProps, t as DatePicker } from "./index-Db0WD4d1.cjs";
4
- import { i as FieldArrayProps, n as FieldArrayChildrenRenderFn, r as FieldArrayFeatures, t as FieldArray } from "./index-BmMspnsJ.cjs";
5
- import { n as FieldCardProps, r as fieldCardVariants, t as FieldCard } from "./index-B5SfdA5O.cjs";
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-B61zRzeS.cjs";
9
- import { n as RadioBoxes, r as RadioBoxesProps, t as radioBoxVariants } from "./index-Bgo2Dr6X.cjs";
10
- import { n as RadioTabsProps, t as RadioTabs } from "./index-DBsF7xsq.cjs";
11
- import { n as RadiosProps, t as Radios } from "./index-Q3BWGyUO.cjs";
12
- import { n as SelectProps, t as Select } from "./index-BvbHkoH5.cjs";
13
- import { n as SliderProps, t as Slider } from "./index-CSRKNes5.cjs";
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-DMOhTl4I.cjs";
16
- import { n as SwitchBoxProps, r as switchBoxVariants, t as SwitchBox } from "./index-CxY9VWv5.cjs";
17
- import { n as TextAreaProps, t as TextArea } from "./index-DUmNI6cE.cjs";
18
- import { n as TimeProps, t as Time } from "./index-BE4OAqJ2.cjs";
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";
@@ -28,4 +28,4 @@ import { n as useWatchFormReset, t as UseWatchFormResetOptions } from "./useWatc
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,21 +1,21 @@
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-BPaSE_7b.js";
3
- import { n as DatePickerProps, t as DatePicker } from "./index-BDFJDKmz.js";
4
- import { i as FieldArrayProps, n as FieldArrayChildrenRenderFn, r as FieldArrayFeatures, t as FieldArray } from "./index-CvP3tbVV.js";
5
- import { n as FieldCardProps, r as fieldCardVariants, t as FieldCard } from "./index-CIiOXrrY.js";
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-PMCqBX0t.js";
9
- import { n as RadioBoxes, r as RadioBoxesProps, t as radioBoxVariants } from "./index-BMEKfOWp.js";
10
- import { n as RadioTabsProps, t as RadioTabs } from "./index-BSjcTo7A.js";
11
- import { n as RadiosProps, t as Radios } from "./index-Cz4JaCWd.js";
12
- import { n as SelectProps, t as Select } from "./index-GqydEAFk.js";
13
- import { n as SliderProps, t as Slider } from "./index-B4jKGy-P.js";
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-C6DBVs7t.js";
16
- import { n as SwitchBoxProps, r as switchBoxVariants, t as SwitchBox } from "./index-Cwb7sTO0.js";
17
- import { n as TextAreaProps, t as TextArea } from "./index-CbPJiRK2.js";
18
- import { n as TimeProps, t as Time } from "./index-CbQ8Ft4o.js";
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";
@@ -28,4 +28,4 @@ import { n as useWatchFormReset, t as UseWatchFormResetOptions } from "./useWatc
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-D1hppxDE.js";
10
- import { n as DatePicker } from "./DatePicker-BUSi8SWQ.js";
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-BxmK1NRd.js";
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 fieldCardVariants, t as FieldCard } from "./FieldCard-BK6SNqFY.js";
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-BJz-aJp3.js";
20
- import { n as RadioTabs } from "./RadioTabs-CYmzrPBG.js";
21
- import { n as Radios } from "./Radios-DZxhrX96.js";
22
- import { n as Select } from "./Select-CgeqhZIC.js";
23
- import { n as Slider } from "./Slider-DRfSw0uE.js";
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-D9DNrqmj.js";
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 { t as Time } from "./Time-CDptQ3CK.js";
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fuf-stack/uniform",
3
- "version": "1.22.3",
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.1",
169
- "@fuf-stack/pixel-utils": "1.3.0",
170
- "@fuf-stack/pixels": "1.11.0",
171
- "@fuf-stack/veto": "1.7.1",
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": "a1176c10b573e507f46dd8bf06d9780b8dee74b0"
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,SAAS;GAC5B,YAAY;IAAE,UAAU;IAAK,MAAM;GAAU;GAC7C,SACE,mBAAmB,KAAA,IAAY;IAAE,SAAS;IAAG,QAAQ;GAAO;aAG9D,oBAAC,OAAD;IACE,GAAI,sBAAsB;IAC1B,WAAW,GAAG,sBAAsB,GAAG,WAAW,SAAS;cAE3D,oBAAC,OAAD;KACE,GAAI,qBAA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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,kBAAoC;CAI1C,MAAM,YAAY,CAAC,CAAC,OAAO;CAE3B,OACE,iBAAA,GAAA,kBAAA,KAACC,wBAAAA,iBAAD;EAAiB,SAAS,CAAC;YACxB,YACC,iBAAA,GAAA,kBAAA,KAACC,wBAAAA,OAAO,KAAR;GAEE,MAAM,mBAAmB,KAAA,IAAY;IAAE,SAAS;IAAG,QAAQ;GAAE;GAC7D,SAAS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GlD,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,aAAa,qBAJF,iBAAiB;EAChC;EACA;CACF,CAES,GAEP,aACA,MACF;CAEA,OACE,qBAAC,WAAD;EAAW,GAAI,aAAa;EAAG,WAAW,WAAW;YAArD;GACE,oBAAC,gBAAD,EAAA,UACE,oBAAC,SAAD,EAAO,GAAI,cAAc,EAAI,CAAA,EACf,CAAA;GACf,CAAC,OACA,oBAAC,QAAD;IAAM,GAAI,gBAAgB;cACxB,oBAA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Y;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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,IAAI;EACvC,gBAAgB,aAAa;GAC3B,SAAS,sBAAsB,QAAQ,CAAC;EAC1C;YAEC,QAAQ,KAAK,WAAW;GACvB,IAAI,WAAW,QAKb,OACE,iBAAA,GAAA,kBAAA,KAAC,UAAD;IAEE,YAAY;IACZ,gBAAA,GAAA,uBAAA,SAPF,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":"RadioTabs-Btt582Nl.cjs","names":["useUniformField","createOptionValueConverter","VisuallyHidden","HeroRadioGroup","Tabs"],"sources":["../src/RadioTabs/RadioTabs.tsx","../src/RadioTabs/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { TabsProps } from '@fuf-stack/pixels';\nimport type { TabProps } from '@fuf-stack/pixels/Tabs';\nimport type { ReactElement, ReactNode } from 'react';\n\nimport { useRef } from 'react';\n\nimport { RadioGroup as HeroRadioGroup } from '@heroui/radio';\nimport { VisuallyHidden } from '@react-aria/visually-hidden';\n\nimport { slugify, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\nimport Tabs from '@fuf-stack/pixels/Tabs';\n\nimport { createOptionValueConverter } from '../helpers';\nimport { useUniformField } from '../hooks/useUniformField';\n\nexport const radioTabsVariants = tv({\n slots: {\n base: 'group gap-0', // Needs group for group-data condition\n cursor: '',\n label:\n 'mb-2 inline-flex text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:text-danger',\n tab: '',\n tabBase: '',\n tabContent: '',\n tabList: '',\n tabPanel: 'p-3',\n tabWrapper: '',\n wrapper: '',\n },\n variants: {\n hasContent: {\n true: {\n base: '',\n tabBase: 'p-1',\n tabWrapper: [\n // border style\n 'rounded-medium border border-divider',\n // full width\n 'w-full',\n ],\n },\n },\n fullWidth: {\n true: {\n tabWrapper: 'w-full',\n },\n },\n isInvalid: {\n true: {\n tabWrapper: 'rounded-medium border-2 !border-danger',\n },\n },\n },\n});\n\ntype VariantProps = TVProps<typeof radioTabsVariants>;\ntype ClassName = TVClassName<typeof radioTabsVariants>;\n\nexport interface RadioTabsOption {\n /** Optional content inside of the tab */\n content?: ReactNode;\n /** disables the option */\n disabled?: boolean;\n /** option label */\n label?: ReactNode;\n /** option icon */\n icon?: ReactNode;\n /** HTML data-testid attribute of the option */\n testId?: string;\n /** option value */\n value: string | number | boolean;\n}\n\nexport interface RadioTabsProps extends Omit<VariantProps, 'hasContent'> {\n /** Custom aria-label for accessibility. If not provided, falls back to field name when no visible label exists */\n ariaLabel?: string;\n /** CSS class name */\n className?: ClassName;\n /** Determines if the Buttons are disabled or not. */\n disabled?: boolean;\n /** Whether tabs should take up full container width */\n fullWidth?: boolean;\n /** determines orientation of the Buttons. */\n inline?: boolean;\n /** Label displayed next to the RadioButton. */\n label?: ReactNode;\n /** Name the RadioButtons are registered at in HTML forms (react-hook-form). */\n name: string;\n /** Radio button configuration. */\n options: RadioTabsOption[];\n /** Id to grab element in internal tests. */\n testId?: string;\n /** How the RadioTabs should look like. */\n variant?: TabsProps['variant'];\n}\n\n/**\n * RadioTabs component based on [HeroUI RadioGroup](https://www.heroui.com//docs/components/radio-group)\n * and [HeroUI Tabs](https://www.heroui.com//docs/components/tabs)\n */\nconst RadioTabs = ({\n className = undefined,\n fullWidth = false,\n inline = false,\n name,\n options,\n variant = undefined,\n ...uniformFieldProps\n}: RadioTabsProps): ReactElement => {\n const {\n ariaLabel,\n disabled,\n errorMessage,\n field: { onBlur, onChange, ref, value },\n invalid,\n label,\n required,\n testId,\n } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n // Create a ref for the visual radio group to forward focus\n const visualRadioGroupRef = useRef<HTMLDivElement>(null);\n\n // Create converter to preserve number types for option values\n const { convertToOriginalType } = createOptionValueConverter(options);\n\n const tabOptions = options.map<TabProps>((option) => {\n return {\n content: option?.content,\n disabled: option?.disabled,\n // Tabs component uses string keys internally\n key: String(option.value),\n label: option?.label ?? option?.value,\n testId: slugify(`option_${option?.testId ?? option?.value}`, {\n replaceDots: true,\n }),\n };\n });\n\n const disabledAllKeys: string[] | undefined = tabOptions?.map((option) => {\n return option.key as string;\n });\n\n // check if any option has content\n // eslint-disable-next-line @typescript-eslint/no-misused-promises, @typescript-eslint/promise-function-async\n const hasContent = options.some((option) => {\n return option.content;\n });\n\n // classNames from slots\n const variants = radioTabsVariants({\n fullWidth,\n hasContent,\n isInvalid: invalid,\n });\n const classNames = variantsToClassNames(variants, className, 'base');\n\n return (\n <>\n {/* Visually hidden input for React Hook Form focus management */}\n <VisuallyHidden>\n <input\n ref={ref}\n aria-label={ariaLabel}\n name={name}\n onBlur={onBlur}\n value={value ?? ''}\n onChange={(e) => {\n onChange(convertToOriginalType(e.target.value));\n }}\n onFocus={() => {\n // Forward focus to the first tab when RHF focuses this input\n const firstTab = visualRadioGroupRef.current?.querySelector(\n '[role=\"tab\"]',\n ) as HTMLElement;\n firstTab?.focus();\n }}\n />\n </VisuallyHidden>\n\n <HeroRadioGroup\n ref={visualRadioGroupRef}\n aria-label={ariaLabel}\n // see HeroUI styles for group-data condition (data-invalid),\n // e.g.: https://github.com/heroui-inc/heroui/blob/main/packages/components/select/src/use-select.ts\n data-invalid={invalid}\n data-required={required}\n data-testid={testId}\n errorMessage={errorMessage}\n isDisabled={disabled}\n isInvalid={invalid}\n isRequired={required}\n label={label ? <legend>{label}</legend> : null}\n name={`${name}_radiotabs`}\n orientation={inline ? 'horizontal' : 'vertical'}\n classNames={{\n base: classNames.base,\n label: classNames.label,\n wrapper: classNames.wrapper,\n }}\n >\n <Tabs\n disabledKeys={disabled ? disabledAllKeys : undefined}\n // make sure component is controlled (convert to string for Tabs)\n selectedKey={value != null ? String(value) : ''}\n tabs={tabOptions}\n testId={testId}\n variant={variant}\n className={{\n base: classNames.tabBase,\n cursor: classNames.cursor,\n panel: classNames.tabPanel,\n tab: classNames.tab,\n tabContent: classNames.tabContent,\n tabList: classNames.tabList,\n tabWrapper: classNames.tabWrapper,\n }}\n onSelectionChange={(key) => {\n if (key != null) {\n onChange(convertToOriginalType(key));\n }\n }}\n />\n </HeroRadioGroup>\n </>\n );\n};\n\nexport default RadioTabs;\n","import RadioTabs from './RadioTabs';\n\nexport type { RadioTabsProps } from './RadioTabs';\n\nexport { RadioTabs };\n\nexport default RadioTabs;\n"],"mappings":";;;;;;;;;;;AAgBA,MAAa,qBAAA,GAAA,uBAAA,IAAuB;CAClC,OAAO;EACL,MAAM;EACN,QAAQ;EACR,OACE;EACF,KAAK;EACL,SAAS;EACT,YAAY;EACZ,SAAS;EACT,UAAU;EACV,YAAY;EACZ,SAAS;CACX;CACA,UAAU;EACR,YAAY,EACV,MAAM;GACJ,MAAM;GACN,SAAS;GACT,YAAY,CAEV,wCAEA,QACF;EACF,EACF;EACA,WAAW,EACT,MAAM,EACJ,YAAY,SACd,EACF;EACA,WAAW,EACT,MAAM,EACJ,YAAY,yCACd,EACF;CACF;AACF,CAAC;;;;;AA+CD,MAAM,aAAa,EACjB,YAAY,KAAA,GACZ,YAAY,OACZ,SAAS,OACT,MACA,SACA,UAAU,KAAA,GACV,GAAG,wBAC+B;CAClC,MAAM,EACJ,WACA,UACA,cACA,OAAO,EAAE,QAAQ,UAAU,KAAK,SAChC,SACA,OACA,UACA,WACEA,oCAAAA,gBAAgB;EAClB;EACA,GAAG;CACL,CAAC;CAGD,MAAM,uBAAA,GAAA,MAAA,QAA6C,IAAI;CAGvD,MAAM,EAAE,0BAA0BC,sBAAAA,2BAA2B,OAAO;CAEpE,MAAM,aAAa,QAAQ,KAAe,WAAW;EACnD,OAAO;GACL,SAAS,QA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AI;GAC7C,MAAM;GACE;GACC;GACT,WAAW;IACT,MAAM,WAAW;IACjB,QAAQ,WAAW;IACnB,OAAO,WAAW;IAClB,KAAK,WAAW;IAChB,YAAY,WAAW;IACvB,SAAS,WAAW;IACpB,YAAY,WAAW;GACzB;GACA,oBAAoB,QAAQ;IAC1B,IAAI,OAAO,MACT,SAAS,sBAAsB,GAAG,CAAC;GAEvC;EACD,CAAA;CACa,CAAA,CAChB,EAAA,CAAA;AAEN;;;AChOA,IAAA,oBAAe"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"RadioTabs-CYmzrPBG.js","names":["HeroRadioGroup"],"sources":["../src/RadioTabs/RadioTabs.tsx","../src/RadioTabs/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { TabsProps } from '@fuf-stack/pixels';\nimport type { TabProps } from '@fuf-stack/pixels/Tabs';\nimport type { ReactElement, ReactNode } from 'react';\n\nimport { useRef } from 'react';\n\nimport { RadioGroup as HeroRadioGroup } from '@heroui/radio';\nimport { VisuallyHidden } from '@react-aria/visually-hidden';\n\nimport { slugify, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\nimport Tabs from '@fuf-stack/pixels/Tabs';\n\nimport { createOptionValueConverter } from '../helpers';\nimport { useUniformField } from '../hooks/useUniformField';\n\nexport const radioTabsVariants = tv({\n slots: {\n base: 'group gap-0', // Needs group for group-data condition\n cursor: '',\n label:\n 'mb-2 inline-flex text-sm text-foreground subpixel-antialiased group-data-[invalid=true]:text-danger',\n tab: '',\n tabBase: '',\n tabContent: '',\n tabList: '',\n tabPanel: 'p-3',\n tabWrapper: '',\n wrapper: '',\n },\n variants: {\n hasContent: {\n true: {\n base: '',\n tabBase: 'p-1',\n tabWrapper: [\n // border style\n 'rounded-medium border border-divider',\n // full width\n 'w-full',\n ],\n },\n },\n fullWidth: {\n true: {\n tabWrapper: 'w-full',\n },\n },\n isInvalid: {\n true: {\n tabWrapper: 'rounded-medium border-2 !border-danger',\n },\n },\n },\n});\n\ntype VariantProps = TVProps<typeof radioTabsVariants>;\ntype ClassName = TVClassName<typeof radioTabsVariants>;\n\nexport interface RadioTabsOption {\n /** Optional content inside of the tab */\n content?: ReactNode;\n /** disables the option */\n disabled?: boolean;\n /** option label */\n label?: ReactNode;\n /** option icon */\n icon?: ReactNode;\n /** HTML data-testid attribute of the option */\n testId?: string;\n /** option value */\n value: string | number | boolean;\n}\n\nexport interface RadioTabsProps extends Omit<VariantProps, 'hasContent'> {\n /** Custom aria-label for accessibility. If not provided, falls back to field name when no visible label exists */\n ariaLabel?: string;\n /** CSS class name */\n className?: ClassName;\n /** Determines if the Buttons are disabled or not. */\n disabled?: boolean;\n /** Whether tabs should take up full container width */\n fullWidth?: boolean;\n /** determines orientation of the Buttons. */\n inline?: boolean;\n /** Label displayed next to the RadioButton. */\n label?: ReactNode;\n /** Name the RadioButtons are registered at in HTML forms (react-hook-form). */\n name: string;\n /** Radio button configuration. */\n options: RadioTabsOption[];\n /** Id to grab element in internal tests. */\n testId?: string;\n /** How the RadioTabs should look like. */\n variant?: TabsProps['variant'];\n}\n\n/**\n * RadioTabs component based on [HeroUI RadioGroup](https://www.heroui.com//docs/components/radio-group)\n * and [HeroUI Tabs](https://www.heroui.com//docs/components/tabs)\n */\nconst RadioTabs = ({\n className = undefined,\n fullWidth = false,\n inline = false,\n name,\n options,\n variant = undefined,\n ...uniformFieldProps\n}: RadioTabsProps): ReactElement => {\n const {\n ariaLabel,\n disabled,\n errorMessage,\n field: { onBlur, onChange, ref, value },\n invalid,\n label,\n required,\n testId,\n } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n // Create a ref for the visual radio group to forward focus\n const visualRadioGroupRef = useRef<HTMLDivElement>(null);\n\n // Create converter to preserve number types for option values\n const { convertToOriginalType } = createOptionValueConverter(options);\n\n const tabOptions = options.map<TabProps>((option) => {\n return {\n content: option?.content,\n disabled: option?.disabled,\n // Tabs component uses string keys internally\n key: String(option.value),\n label: option?.label ?? option?.value,\n testId: slugify(`option_${option?.testId ?? option?.value}`, {\n replaceDots: true,\n }),\n };\n });\n\n const disabledAllKeys: string[] | undefined = tabOptions?.map((option) => {\n return option.key as string;\n });\n\n // check if any option has content\n // eslint-disable-next-line @typescript-eslint/no-misused-promises, @typescript-eslint/promise-function-async\n const hasContent = options.some((option) => {\n return option.content;\n });\n\n // classNames from slots\n const variants = radioTabsVariants({\n fullWidth,\n hasContent,\n isInvalid: invalid,\n });\n const classNames = variantsToClassNames(variants, className, 'base');\n\n return (\n <>\n {/* Visually hidden input for React Hook Form focus management */}\n <VisuallyHidden>\n <input\n ref={ref}\n aria-label={ariaLabel}\n name={name}\n onBlur={onBlur}\n value={value ?? ''}\n onChange={(e) => {\n onChange(convertToOriginalType(e.target.value));\n }}\n onFocus={() => {\n // Forward focus to the first tab when RHF focuses this input\n const firstTab = visualRadioGroupRef.current?.querySelector(\n '[role=\"tab\"]',\n ) as HTMLElement;\n firstTab?.focus();\n }}\n />\n </VisuallyHidden>\n\n <HeroRadioGroup\n ref={visualRadioGroupRef}\n aria-label={ariaLabel}\n // see HeroUI styles for group-data condition (data-invalid),\n // e.g.: https://github.com/heroui-inc/heroui/blob/main/packages/components/select/src/use-select.ts\n data-invalid={invalid}\n data-required={required}\n data-testid={testId}\n errorMessage={errorMessage}\n isDisabled={disabled}\n isInvalid={invalid}\n isRequired={required}\n label={label ? <legend>{label}</legend> : null}\n name={`${name}_radiotabs`}\n orientation={inline ? 'horizontal' : 'vertical'}\n classNames={{\n base: classNames.base,\n label: classNames.label,\n wrapper: classNames.wrapper,\n }}\n >\n <Tabs\n disabledKeys={disabled ? disabledAllKeys : undefined}\n // make sure component is controlled (convert to string for Tabs)\n selectedKey={value != null ? String(value) : ''}\n tabs={tabOptions}\n testId={testId}\n variant={variant}\n className={{\n base: classNames.tabBase,\n cursor: classNames.cursor,\n panel: classNames.tabPanel,\n tab: classNames.tab,\n tabContent: classNames.tabContent,\n tabList: classNames.tabList,\n tabWrapper: classNames.tabWrapper,\n }}\n onSelectionChange={(key) => {\n if (key != null) {\n onChange(convertToOriginalType(key));\n }\n }}\n />\n </HeroRadioGroup>\n </>\n );\n};\n\nexport default RadioTabs;\n","import RadioTabs from './RadioTabs';\n\nexport type { RadioTabsProps } from './RadioTabs';\n\nexport { RadioTabs };\n\nexport default RadioTabs;\n"],"mappings":";;;;;;;;;AAgBA,MAAa,oBAAoB,GAAG;CAClC,OAAO;EACL,MAAM;EACN,QAAQ;EACR,OACE;EACF,KAAK;EACL,SAAS;EACT,YAAY;EACZ,SAAS;EACT,UAAU;EACV,YAAY;EACZ,SAAS;CACX;CACA,UAAU;EACR,YAAY,EACV,MAAM;GACJ,MAAM;GACN,SAAS;GACT,YAAY,CAEV,wCAEA,QACF;EACF,EACF;EACA,WAAW,EACT,MAAM,EACJ,YAAY,SACd,EACF;EACA,WAAW,EACT,MAAM,EACJ,YAAY,yCACd,EACF;CACF;AACF,CAAC;;;;;AA+CD,MAAM,aAAa,EACjB,YAAY,KAAA,GACZ,YAAY,OACZ,SAAS,OACT,MACA,SACA,UAAU,KAAA,GACV,GAAG,wBAC+B;CAClC,MAAM,EACJ,WACA,UACA,cACA,OAAO,EAAE,QAAQ,UAAU,KAAK,SAChC,SACA,OACA,UACA,WACE,gBAAgB;EAClB;EACA,GAAG;CACL,CAAC;CAGD,MAAM,sBAAsB,OAAuB,IAAI;CAGvD,MAAM,EAAE,0BAA0B,2BAA2B,OAAO;CAEpE,MAAM,aAAa,QAAQ,KAAe,WAAW;EACnD,OAAO;GACL,SAAS,QAAQ;GACjB,UAAU,QAAQ;GAElB,KAAK,OAAO,OAAO,KAAK;GACxB,OAAO,QAAQ,SAAS,QAAQ;GAChC,QAAQ,QAAQ,UAAU,QAAQ,UAAU,QAAQ,SAAS,EAC3D,aAAa,KACf,CAAC;EACH;CACF,CAAC;CAED,MAAM,kBAAwC,YAAY,KAAK,WAAW;EACxE,OAAO,OAAO;CAChB,CAAC;CAcD,MAAM,aAAa,qBALF,kBAAkB;EACjC;EACA,YAPiB,QAAQ,MAAM,WAAW;GAC1C,OAAO,OAAO;EAChB,CAKW;EACT,WAAW;CACb,CAC+C,GAAG,WAAW,MAAM;CAEnE,OACE,qBAAA,UAAA,EAAA,UAAA,CAEE,oBAAC,gBAAD,EAAA,UACE,oBAAC,SAAD;EACO;EACL,cAAY;EACN;EACE;EACR,OAAO,SAAS;EAChB,WAAW,MAAM;GACf,SAAS,sBAAsB,EAAE,OAAO,KAAK,CAAC;EAChD;EACA,eAAe;GAKb,CAHiB,oBAAoB,SAAS,cAC5C,gBACF,IACU,MAAM;EAClB;CACD,CAAA,EACa,CAAA,GAEhB,oBAACA,YAAD;EACE,KAAK;EACL,cAAY;EAGZ,gBAAc;EACd,iBAAe;EACf,eAAa;EACC;EACd,YAAY;EACZ,WAAW;EACX,YAAY;EACZ,OAAO,QAAQ,oBAAC,UAAD,EAAA,UAAS,MAAc,CAAA,IAAI;EAC1C,MAAM,GAAG,KAAK;EACd,aAAa,SAAS,eAAe;EACrC,YAAY;GACV,MAAM,WAAW;GACjB,OAAO,WAAW;GAClB,SAAS,WAAW;EACtB;YAEA,oBAAC,MAAD;GACE,cAAc,WAAW,kBAAkB,KAAA;GAE3C,aAAa,SAAS,OAAO,OAAO,KAAK,IAAI;GAC7C,MAAM;GACE;GACC;GACT,WAAW;IACT,MAAM,WAAW;IACjB,QAAQ,WAAW;IACnB,OAAO,WAAW;IAClB,KAAK,WAAW;IAChB,YAAY,WAAW;IACvB,SAAS,WAAW;IACpB,YAAY,WAAW;GACzB;GACA,oBAAoB,QAAQ;IAC1B,IAAI,OAAO,MACT,SAAS,sBAAsB,GAAG,CAAC;GAEvC;EACD,CAAA;CACa,CAAA,CAChB,EAAA,CAAA;AAEN;;;AChOA,IAAA,oBAAe"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Select-CZwuEAB5.cjs","names":["components","useUniformField","useFormContext","createOptionValueConverter","isValueEmpty","ReactSelect"],"sources":["../src/Select/Select.tsx","../src/Select/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { ReactNode } from 'react';\nimport type { MultiValue, Props, SingleValue } from 'react-select';\n\nimport { useState } from 'react';\nimport ReactSelect, { components } from 'react-select';\n\nimport { useSelect } from '@heroui/select';\n\nimport { cn, slugify, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { createOptionValueConverter, isValueEmpty } from '../helpers';\nimport { useFormContext } from '../hooks/useFormContext';\nimport { useUniformField } from '../hooks/useUniformField';\n\nexport const selectVariants = tv({\n slots: {\n base: 'group leading-normal',\n clearIndicator:\n 'rounded-md p-1 text-foreground-500 hover:cursor-pointer hover:bg-default-200 hover:text-foreground-800',\n control:\n 'duration-150! rounded-lg border-2 border-default-200 bg-content1 transition-background hover:border-default-400 group-data-[invalid=true]:border-danger group-data-[invalid=true]:hover:border-danger motion-reduce:transition-none',\n control_focused: 'border-focus',\n crossIcon: '',\n downChevron: '',\n dropdownIndicator:\n 'rounded-md p-1 text-foreground-500 hover:cursor-pointer hover:bg-default-200 hover:text-black',\n group: '',\n groupHeading: 'mb-1 ml-3 mt-2 text-sm text-foreground-500',\n indicatorsContainer: 'gap-1 p-1',\n indicatorSeparator: 'bg-default-300',\n input: 'py-0.5 pl-1',\n // see HeroUI styles for group-data condition,\n // e.g.: https://github.com/heroui-inc/heroui/blob/main/packages/core/theme/src/components/select.ts\n label:\n 'pointer-events-auto relative bottom-1.5 ml-1 text-foreground subpixel-antialiased text-small group-data-[invalid=true]:!text-danger',\n loadingIndicator: '',\n loadingMessage: 'rounded-sm p-2 text-foreground-500',\n menu: 'mt-2 rounded-xl border border-default-200 bg-content1 p-1 shadow-lg',\n menuList: '',\n // ensure menu has same z-index as modal so it is visible when rendered in modal\n // see: https://github.com/heroui-inc/heroui/blob/main/packages/core/theme/src/components/modal.ts (see z-50)\n menuPortal: 'z-50!',\n multiValue: 'items-center gap-1.5 rounded bg-default-100 py-0.5 pl-2 pr-1',\n multiValueContainer: '',\n multiValueLabel: 'py-0.5 leading-6',\n multiValueRemove:\n 'rounded text-default-500 hover:cursor-pointer hover:border-default-300 hover:text-default-800',\n noOptionsMessage: 'rounded-sm p-2 text-foreground-500',\n option: 'rounded px-3 py-2 hover:cursor-pointer',\n option_disabled:\n 'cursor-not-allowed! hover:cursor-not-allowed! opacity-disabled',\n option_focused: 'bg-default-100 active:bg-default-200',\n option_selected: 'bg-default-300',\n placeholder: 'ml-1 py-0.5 pl-1 text-sm text-foreground-500',\n selectContainer: '',\n singleValue: 'ml-1! leading-7!',\n valueContainer: 'gap-1 p-1',\n },\n});\n\ninterface SelectOption {\n /** set option to disabled state */\n disabled?: boolean;\n /**\n * True when option was auto-generated because the value wasn't found in options.\n * Use in renderOptionLabel to render a component that fetches the real label.\n */\n isFallback?: boolean;\n /** option label */\n label?: ReactNode;\n /** option value */\n value: string | number;\n}\n\ntype VariantProps = TVProps<typeof selectVariants>;\ntype ClassName = TVClassName<typeof selectVariants>;\n\nexport interface SelectProps extends VariantProps {\n /** Custom aria-label for accessibility. If not provided, falls back to field name when no visible label exists */\n ariaLabel?: string;\n /** CSS class name */\n className?: ClassName; // string;\n /** Determine if the */\n clearable?: boolean;\n /** Set the select to disabled state. */\n disabled?: boolean;\n /** Force menu open for debugging or visual testing. */\n debugMenuOpen?: boolean;\n /** Filter Select Options */\n filterOption?:\n | undefined\n | ((option?: SelectOption, inputValue?: string) => boolean);\n /** The value of the search input */\n inputValue?: string;\n /** Label that should be associated with the select. */\n label?: ReactNode;\n /** Set the select to a loading state. */\n loading?: boolean;\n /** switch between single and multi select mode. */\n multiSelect?: boolean;\n /** The name for the Select component, used by react-hook-form */\n name: string;\n /** Placeholder that is displayed when nothing is selected */\n placeholder?: string;\n /** Handle change events on the input */\n onInputChange?: Props['onInputChange'];\n /** The options for the Select component */\n options: SelectOption[];\n /** Render custom content when no options match the current search input. */\n renderEmptyOptions?: Props['noOptionsMessage'];\n /** Format the label of the option */\n renderOptionLabel?: undefined | Props['formatOptionLabel'];\n /**\n * Fallback option(s) for async selects when value isn't in current options.\n * Use when the selected value may not be in the options list (e.g., after\n * search results change). Used only if value not found in options.\n * For single select: pass the option object or undefined\n * For multi-select: pass an array of option objects\n */\n selectedOptionFallback?: SelectOption | SelectOption[];\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\nconst InputComponent: typeof components.Input = (props) => {\n // @ts-expect-error data-testid is not a default prop\n // eslint-disable-next-line react/destructuring-assignment\n const testId = `${props.selectProps['data-testid']}`;\n return <components.Input data-testid={testId} {...props} />;\n};\n\nconst ControlComponent: typeof components.Control = (props) => {\n // @ts-expect-error data-testid is not a default prop\n // eslint-disable-next-line react/destructuring-assignment\n const testId = `${props.selectProps['data-testid']}_select`;\n return (\n <div data-testid={testId}>\n <components.Control {...props} />\n </div>\n );\n};\n\nconst OptionComponent: typeof components.Option = (props) => {\n const { isDisabled } = props;\n // @ts-expect-error data-testid is not a default prop\n // eslint-disable-next-line react/destructuring-assignment\n const testId = `${props.selectProps['data-testid']}_select_option_${slugify(String(props?.data?.testId ?? props?.data?.value), { replaceDots: true })}`;\n return (\n <div aria-disabled={isDisabled ? true : undefined} data-testid={testId}>\n <components.Option {...props} />\n </div>\n );\n};\n\nconst DropdownIndicatorComponent: typeof components.DropdownIndicator = (\n props,\n) => {\n // @ts-expect-error data-testid is not a default prop\n const testId = props?.selectProps['data-testid'] as string;\n return (\n <div data-testid={`${testId}_select_dropdown`}>\n <components.DropdownIndicator {...props} />\n </div>\n );\n};\n\n/** Select component based on [HeroUI Select](https://www.heroui.com//docs/components/select) and [React-Select](https://react-select.com/home) */\nconst Select = ({\n className = undefined,\n clearable = true,\n debugMenuOpen = false,\n filterOption = undefined,\n inputValue = undefined,\n loading = false,\n multiSelect = false,\n name,\n onInputChange = undefined,\n options,\n placeholder = undefined,\n renderEmptyOptions = undefined,\n renderOptionLabel = undefined,\n selectedOptionFallback = undefined,\n ...uniformFieldProps\n}: SelectProps) => {\n const {\n ariaLabel,\n disabled,\n errorMessage,\n field: { onBlur, onChange, ref, value },\n getErrorMessageProps,\n getHelperWrapperProps,\n getLabelProps,\n invalid,\n label,\n required,\n testId,\n } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n // Get getFieldState to check isTouched in onChange callback\n const { getFieldState } = useFormContext();\n\n // Track if the select is focused\n const [isFocused, setIsFocused] = useState(false);\n\n // Create converter to preserve number types for option values\n const { convertToOriginalType } = createOptionValueConverter(options);\n\n // classNames from slots\n const variants = selectVariants();\n const classNames = variantsToClassNames(variants, className, 'base');\n\n // React-select classNames configuration\n const reactSelectClassNames = {\n clearIndicator: () => {\n return classNames.clearIndicator;\n },\n control: () => {\n return cn(classNames.control, {\n [classNames.control_focused]: isFocused && !invalid,\n });\n },\n dropdownIndicator: () => {\n return classNames.dropdownIndicator;\n },\n groupHeading: () => {\n return classNames.groupHeading;\n },\n indicatorSeparator: () => {\n return classNames.indicatorSeparator;\n },\n indicatorsContainer: () => {\n return classNames.indicatorsContainer;\n },\n input: () => {\n return classNames.input;\n },\n loadingIndicator: () => {\n return classNames.loadingIndicator;\n },\n loadingMessage: () => {\n return classNames.loadingMessage;\n },\n menu: () => {\n return classNames.menu;\n },\n menuList: () => {\n return classNames.menuList;\n },\n menuPortal: () => {\n return classNames.menuPortal;\n },\n multiValue: () => {\n return classNames.multiValue;\n },\n multiValueLabel: () => {\n return cn(classNames.multiValueLabel, `${getValueProps().className}`);\n },\n multiValueRemove: () => {\n return classNames.multiValueRemove;\n },\n noOptionsMessage: () => {\n return classNames.noOptionsMessage;\n },\n option: ({\n isDisabled: optionIsDisabled,\n isFocused: optionIsFocused,\n isSelected: optionIsSelected,\n }: {\n isDisabled: boolean;\n isFocused: boolean;\n isSelected: boolean;\n }) => {\n return cn(classNames.option, {\n [classNames.option_disabled]: optionIsDisabled,\n [classNames.option_focused]: optionIsFocused,\n [classNames.option_selected]: optionIsSelected,\n });\n },\n placeholder: () => {\n return classNames.placeholder;\n },\n singleValue: () => {\n return cn(classNames.singleValue, `${getValueProps().className}`);\n },\n valueContainer: () => {\n return classNames.valueContainer;\n },\n };\n\n const { getBaseProps, getTriggerProps, getValueProps } = useSelect({\n children: [],\n classNames,\n errorMessage,\n isDisabled: disabled,\n isInvalid: invalid,\n isLoading: loading,\n isRequired: required,\n label,\n labelPlacement: 'outside',\n });\n\n // react-select expects `isDisabled`, while our option contract uses `disabled`.\n const reactSelectOptions = options.map((option) => {\n return {\n ...option,\n isDisabled: option.disabled,\n };\n });\n\n // Compute selected option(s) for react-select\n //\n // Priority for finding options:\n // 1. Look in current options list\n // 2. Use selectedOptionFallback prop (for async selects with pre-fetched data)\n // 3. Create fallback with value as label\n //\n // Handles edge cases:\n // - Compares as strings to support both string and number values\n // - Returns null for empty single-select (required by react-select to clear)\n // - Creates fallback options when value exists but isn't in options list\n // (common with async selects where options change after selection)\n const reactSelectValue = (() => {\n // Helper to find option by value\n const findOption = (v: string | number): SelectOption => {\n // First, look in options list\n const inOptions = options.find((option) => {\n return String(option.value) === String(v);\n });\n if (inOptions) {\n return inOptions;\n }\n\n // Second, look in selectedOptionFallback prop (for async selects)\n if (selectedOptionFallback) {\n if (Array.isArray(selectedOptionFallback)) {\n const inSelected = selectedOptionFallback.find((option) => {\n return String(option.value) === String(v);\n });\n if (inSelected) {\n return inSelected;\n }\n } else if (String(selectedOptionFallback.value) === String(v)) {\n return selectedOptionFallback;\n }\n }\n\n // Fallback: create option with value as label, marked as fallback\n return { isFallback: true, label: String(v), value: v };\n };\n\n if (multiSelect) {\n if (!Array.isArray(value) || isValueEmpty(value)) {\n return [];\n }\n return value.map((v) => {\n return findOption(v);\n });\n }\n\n // Single select - use isValueEmpty to handle marker strings (__NULL__, etc.)\n if (isValueEmpty(value)) {\n return null;\n }\n return findOption(value);\n })();\n\n // Handle selection change\n const handleChange = (\n option: MultiValue<SelectOption> | SingleValue<SelectOption>,\n ) => {\n if (multiSelect) {\n onChange(\n (option as SelectOption[])?.map((_option) => {\n return convertToOriginalType(_option.value);\n }),\n );\n } else {\n const newValue = (option as SelectOption)?.value;\n // Pass null explicitly when clearing (not undefined)\n onChange(newValue != null ? convertToOriginalType(newValue) : null);\n }\n\n // Mark field as touched immediately when a selection is made if not already touched\n // This ensures validation errors show right away (isTouched becomes true)\n // For Select components, selecting an option is a complete user action\n // (unlike text inputs where typing is ongoing), so we mark as touched immediately\n const { isTouched: currentIsTouched } = getFieldState(name, testId);\n if (!currentIsTouched) {\n // Defer blur/touched notification until after the onChange value commit.\n // This prevents \"one render cycle behind\" validation states where blur\n // validation runs against the previous value.\n queueMicrotask(() => {\n onBlur();\n });\n }\n };\n\n // Handle blur event\n const handleBlur = () => {\n setIsFocused(false);\n onBlur();\n };\n\n // Handle focus event\n const handleFocus = () => {\n setIsFocused(true);\n };\n\n return (\n <div\n {...getBaseProps()}\n className={cn(classNames.base)}\n // see HeroUI styles for group-data condition (data-invalid),\n // e.g.: https://github.com/heroui-inc/heroui/blob/main/packages/components/select/src/use-select.ts\n data-required={required}\n data-testid={`${testId}_wrapper`}\n >\n {label ? (\n <label\n className={classNames.label}\n data-slot=\"label\"\n htmlFor={`react-select-${name}-input`}\n id={getLabelProps().id}\n >\n {label}\n {required ? (\n <span aria-hidden className=\"ml-0.5 text-danger\">\n *\n </span>\n ) : null}\n </label>\n ) : null}\n <ReactSelect\n ref={ref}\n aria-errormessage=\"\"\n aria-invalid={invalid}\n aria-label={ariaLabel}\n // set aria-labelledby to the label id so that the select is accessible\n aria-labelledby={\n label\n ? getTriggerProps()['aria-labelledby']?.split(' ')[1]\n : undefined\n }\n classNames={reactSelectClassNames}\n components={{\n Control: ControlComponent,\n DropdownIndicator: DropdownIndicatorComponent,\n Input: InputComponent,\n Option: OptionComponent,\n }}\n // Does not affect the testId of the select, but is needed to pass it to sub-components\n data-testid={testId}\n filterOption={filterOption}\n formatOptionLabel={renderOptionLabel}\n inputValue={inputValue}\n instanceId={name}\n isClearable={clearable}\n isDisabled={disabled}\n isLoading={loading}\n isMulti={multiSelect}\n menuIsOpen={debugMenuOpen ? true : undefined}\n // set menuPosition to fixed so that menu can be rendered\n // inside Card / Modal components, menuShouldBlockScroll\n // prevents container scroll when menu is open\n menuPosition=\"fixed\"\n menuShouldBlockScroll\n name={name}\n noOptionsMessage={renderEmptyOptions}\n onBlur={handleBlur}\n onChange={handleChange}\n onFocus={handleFocus}\n onInputChange={onInputChange}\n options={reactSelectOptions}\n placeholder={placeholder}\n unstyled\n value={reactSelectValue}\n />\n {invalid ? (\n <div {...getHelperWrapperProps()}>\n <div {...getErrorMessageProps()}>{errorMessage}</div>\n </div>\n ) : null}\n </div>\n );\n};\n\nexport default Select;\n","import Select from './Select';\n\nexport type { SelectProps } from './Select';\n\nexport { Select };\n\nexport default Select;\n"],"mappings":";;;;;;;;;;;AAeA,MAAa,kBAAA,GAAA,uBAAA,IAAoB,EAC/B,OAAO;CACL,MAAM;CACN,gBACE;CACF,SACE;CACF,iBAAiB;CACjB,WAAW;CACX,aAAa;CACb,mBACE;CACF,OAAO;CACP,cAAc;CACd,qBAAqB;CACrB,oBAAoB;CACpB,OAAO;CAGP,OACE;CACF,kBAAkB;CAClB,gBAAgB;CAChB,MAAM;CACN,UAAU;CAGV,YAAY;CACZ,YAAY;CACZ,qBAAqB;CACrB,iBAAiB;CACjB,kBACE;CACF,kBAAkB;CAClB,QAAQ;CACR,iBACE;CACF,gBAAgB;CAChB,iBAAiB;CACjB,aAAa;CACb,iBAAiB;CACjB,aAAa;CACb,gBAAgB;AAClB,EACF,CAAC;AAkED,MAAM,kBAA2C,UAAU;CAGzD,MAAM,SAAS,GAAG,MAAM,YAAY;CACpC,OAAO,iBAAA,GAAA,kBAAA,KAACA,aAAAA,WAAW,OAAZ;EAAkB,eAAa;EAAQ,GAAI;CAAQ,CAAA;AAC5D;AAEA,MAAM,oBAA+C,UAAU;CAI7D,OACE,iBAAA,GAAA,kBAAA,KAAC,OAAD;EAAK,eAAa,GAFF,MAAM,YAAY,eAAe;YAG/C,iBAAA,GAAA,kBAA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EACvB,aAAa,KAAK;EAClB,OAAO;CACT;CAGA,MAAM,oBAAoB;EACxB,aAAa,IAAI;CACnB;CAEA,OACE,iBAAA,GAAA,kBAAA,MAAC,OAAD;EACE,GAAI,aAAa;EACjB,YAAA,GAAA,uBAAA,IAAc,WAAW,IAAI;EAG7B,iBAAe;EACf,eAAa,GAAG,OAAO;YANzB;GAQG,QACC,iBAAA,GAAA,kBAAA,MAAC,SAAD;IACE,WAAW,WAAW;IACtB,aAAU;IACV,SAAS,gBAAgB,KAAK;IAC9B,IAAI,cAAc,EAAE;cAJtB,CAMG,OACA,WACC,iBAAA,GAAA,kBAAA,KAAC,QAAD;KAAM,eAAA;KAAY,WAAU;eAAqB;IAE3C,CAAA,IACJ,IACC;QACL;GACJ,iBAAA,GAAA,kBAAA,KAACC,aAAAA,SAAD;IACO;IACL,qBAAkB;IAClB,gBAAc;IACd,cAAY;IAEZ,mBACE,QACI,gBAAgB,EAAE,oBAAoB,MAAM,GAAG,EAAE,KACjD,KAAA;IAEN,YAAY;IACZ,YAAY;KACV,SAAS;KACT,mBAAmB;KACnB,OAAO;KACP,QAAQ;IACV;IAEA,eAAa;IACC;IACd,mBAAmB;IACP;IACZ,YAAY;IACZ,aAAa;IACb,YAAY;IACZ,WAAW;IACX,SAAS;IACT,YAAY,gBAAgB,OAAO,KAAA;IAInC,cAAa;IACb,uBAAA;IACM;IACN,kBAAkB;IAClB,QAAQ;IACR,UAAU;IACV,SAAS;IACM;IACf,SAAS;IACI;IACb,UAAA;IACA,OAAO;GACR,CAAA;GACA,UACC,iBAAA,GAAA,kBAAA,KAAC,OAAD;IAAK,GAAI,sBAAsB;cAC7B,iBAAA,GAAA,kBAAA,KAAC,OAAD;KAAK,GAAI,qBAAqB;eAAI;IAAkB,CAAA;GACjD,CAAA,IACH;EACD;;AAET;;;ACleA,IAAA,iBAAe"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"Select-CgeqhZIC.js","names":[],"sources":["../src/Select/Select.tsx","../src/Select/index.ts"],"sourcesContent":["import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { ReactNode } from 'react';\nimport type { MultiValue, Props, SingleValue } from 'react-select';\n\nimport { useState } from 'react';\nimport ReactSelect, { components } from 'react-select';\n\nimport { useSelect } from '@heroui/select';\n\nimport { cn, slugify, tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { createOptionValueConverter, isValueEmpty } from '../helpers';\nimport { useFormContext } from '../hooks/useFormContext';\nimport { useUniformField } from '../hooks/useUniformField';\n\nexport const selectVariants = tv({\n slots: {\n base: 'group leading-normal',\n clearIndicator:\n 'rounded-md p-1 text-foreground-500 hover:cursor-pointer hover:bg-default-200 hover:text-foreground-800',\n control:\n 'duration-150! rounded-lg border-2 border-default-200 bg-content1 transition-background hover:border-default-400 group-data-[invalid=true]:border-danger group-data-[invalid=true]:hover:border-danger motion-reduce:transition-none',\n control_focused: 'border-focus',\n crossIcon: '',\n downChevron: '',\n dropdownIndicator:\n 'rounded-md p-1 text-foreground-500 hover:cursor-pointer hover:bg-default-200 hover:text-black',\n group: '',\n groupHeading: 'mb-1 ml-3 mt-2 text-sm text-foreground-500',\n indicatorsContainer: 'gap-1 p-1',\n indicatorSeparator: 'bg-default-300',\n input: 'py-0.5 pl-1',\n // see HeroUI styles for group-data condition,\n // e.g.: https://github.com/heroui-inc/heroui/blob/main/packages/core/theme/src/components/select.ts\n label:\n 'pointer-events-auto relative bottom-1.5 ml-1 text-foreground subpixel-antialiased text-small group-data-[invalid=true]:!text-danger',\n loadingIndicator: '',\n loadingMessage: 'rounded-sm p-2 text-foreground-500',\n menu: 'mt-2 rounded-xl border border-default-200 bg-content1 p-1 shadow-lg',\n menuList: '',\n // ensure menu has same z-index as modal so it is visible when rendered in modal\n // see: https://github.com/heroui-inc/heroui/blob/main/packages/core/theme/src/components/modal.ts (see z-50)\n menuPortal: 'z-50!',\n multiValue: 'items-center gap-1.5 rounded bg-default-100 py-0.5 pl-2 pr-1',\n multiValueContainer: '',\n multiValueLabel: 'py-0.5 leading-6',\n multiValueRemove:\n 'rounded text-default-500 hover:cursor-pointer hover:border-default-300 hover:text-default-800',\n noOptionsMessage: 'rounded-sm p-2 text-foreground-500',\n option: 'rounded px-3 py-2 hover:cursor-pointer',\n option_disabled:\n 'cursor-not-allowed! hover:cursor-not-allowed! opacity-disabled',\n option_focused: 'bg-default-100 active:bg-default-200',\n option_selected: 'bg-default-300',\n placeholder: 'ml-1 py-0.5 pl-1 text-sm text-foreground-500',\n selectContainer: '',\n singleValue: 'ml-1! leading-7!',\n valueContainer: 'gap-1 p-1',\n },\n});\n\ninterface SelectOption {\n /** set option to disabled state */\n disabled?: boolean;\n /**\n * True when option was auto-generated because the value wasn't found in options.\n * Use in renderOptionLabel to render a component that fetches the real label.\n */\n isFallback?: boolean;\n /** option label */\n label?: ReactNode;\n /** option value */\n value: string | number;\n}\n\ntype VariantProps = TVProps<typeof selectVariants>;\ntype ClassName = TVClassName<typeof selectVariants>;\n\nexport interface SelectProps extends VariantProps {\n /** Custom aria-label for accessibility. If not provided, falls back to field name when no visible label exists */\n ariaLabel?: string;\n /** CSS class name */\n className?: ClassName; // string;\n /** Determine if the */\n clearable?: boolean;\n /** Set the select to disabled state. */\n disabled?: boolean;\n /** Force menu open for debugging or visual testing. */\n debugMenuOpen?: boolean;\n /** Filter Select Options */\n filterOption?:\n | undefined\n | ((option?: SelectOption, inputValue?: string) => boolean);\n /** The value of the search input */\n inputValue?: string;\n /** Label that should be associated with the select. */\n label?: ReactNode;\n /** Set the select to a loading state. */\n loading?: boolean;\n /** switch between single and multi select mode. */\n multiSelect?: boolean;\n /** The name for the Select component, used by react-hook-form */\n name: string;\n /** Placeholder that is displayed when nothing is selected */\n placeholder?: string;\n /** Handle change events on the input */\n onInputChange?: Props['onInputChange'];\n /** The options for the Select component */\n options: SelectOption[];\n /** Render custom content when no options match the current search input. */\n renderEmptyOptions?: Props['noOptionsMessage'];\n /** Format the label of the option */\n renderOptionLabel?: undefined | Props['formatOptionLabel'];\n /**\n * Fallback option(s) for async selects when value isn't in current options.\n * Use when the selected value may not be in the options list (e.g., after\n * search results change). Used only if value not found in options.\n * For single select: pass the option object or undefined\n * For multi-select: pass an array of option objects\n */\n selectedOptionFallback?: SelectOption | SelectOption[];\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n}\n\nconst InputComponent: typeof components.Input = (props) => {\n // @ts-expect-error data-testid is not a default prop\n // eslint-disable-next-line react/destructuring-assignment\n const testId = `${props.selectProps['data-testid']}`;\n return <components.Input data-testid={testId} {...props} />;\n};\n\nconst ControlComponent: typeof components.Control = (props) => {\n // @ts-expect-error data-testid is not a default prop\n // eslint-disable-next-line react/destructuring-assignment\n const testId = `${props.selectProps['data-testid']}_select`;\n return (\n <div data-testid={testId}>\n <components.Control {...props} />\n </div>\n );\n};\n\nconst OptionComponent: typeof components.Option = (props) => {\n const { isDisabled } = props;\n // @ts-expect-error data-testid is not a default prop\n // eslint-disable-next-line react/destructuring-assignment\n const testId = `${props.selectProps['data-testid']}_select_option_${slugify(String(props?.data?.testId ?? props?.data?.value), { replaceDots: true })}`;\n return (\n <div aria-disabled={isDisabled ? true : undefined} data-testid={testId}>\n <components.Option {...props} />\n </div>\n );\n};\n\nconst DropdownIndicatorComponent: typeof components.DropdownIndicator = (\n props,\n) => {\n // @ts-expect-error data-testid is not a default prop\n const testId = props?.selectProps['data-testid'] as string;\n return (\n <div data-testid={`${testId}_select_dropdown`}>\n <components.DropdownIndicator {...props} />\n </div>\n );\n};\n\n/** Select component based on [HeroUI Select](https://www.heroui.com//docs/components/select) and [React-Select](https://react-select.com/home) */\nconst Select = ({\n className = undefined,\n clearable = true,\n debugMenuOpen = false,\n filterOption = undefined,\n inputValue = undefined,\n loading = false,\n multiSelect = false,\n name,\n onInputChange = undefined,\n options,\n placeholder = undefined,\n renderEmptyOptions = undefined,\n renderOptionLabel = undefined,\n selectedOptionFallback = undefined,\n ...uniformFieldProps\n}: SelectProps) => {\n const {\n ariaLabel,\n disabled,\n errorMessage,\n field: { onBlur, onChange, ref, value },\n getErrorMessageProps,\n getHelperWrapperProps,\n getLabelProps,\n invalid,\n label,\n required,\n testId,\n } = useUniformField({\n name,\n ...uniformFieldProps,\n });\n\n // Get getFieldState to check isTouched in onChange callback\n const { getFieldState } = useFormContext();\n\n // Track if the select is focused\n const [isFocused, setIsFocused] = useState(false);\n\n // Create converter to preserve number types for option values\n const { convertToOriginalType } = createOptionValueConverter(options);\n\n // classNames from slots\n const variants = selectVariants();\n const classNames = variantsToClassNames(variants, className, 'base');\n\n // React-select classNames configuration\n const reactSelectClassNames = {\n clearIndicator: () => {\n return classNames.clearIndicator;\n },\n control: () => {\n return cn(classNames.control, {\n [classNames.control_focused]: isFocused && !invalid,\n });\n },\n dropdownIndicator: () => {\n return classNames.dropdownIndicator;\n },\n groupHeading: () => {\n return classNames.groupHeading;\n },\n indicatorSeparator: () => {\n return classNames.indicatorSeparator;\n },\n indicatorsContainer: () => {\n return classNames.indicatorsContainer;\n },\n input: () => {\n return classNames.input;\n },\n loadingIndicator: () => {\n return classNames.loadingIndicator;\n },\n loadingMessage: () => {\n return classNames.loadingMessage;\n },\n menu: () => {\n return classNames.menu;\n },\n menuList: () => {\n return classNames.menuList;\n },\n menuPortal: () => {\n return classNames.menuPortal;\n },\n multiValue: () => {\n return classNames.multiValue;\n },\n multiValueLabel: () => {\n return cn(classNames.multiValueLabel, `${getValueProps().className}`);\n },\n multiValueRemove: () => {\n return classNames.multiValueRemove;\n },\n noOptionsMessage: () => {\n return classNames.noOptionsMessage;\n },\n option: ({\n isDisabled: optionIsDisabled,\n isFocused: optionIsFocused,\n isSelected: optionIsSelected,\n }: {\n isDisabled: boolean;\n isFocused: boolean;\n isSelected: boolean;\n }) => {\n return cn(classNames.option, {\n [classNames.option_disabled]: optionIsDisabled,\n [classNames.option_focused]: optionIsFocused,\n [classNames.option_selected]: optionIsSelected,\n });\n },\n placeholder: () => {\n return classNames.placeholder;\n },\n singleValue: () => {\n return cn(classNames.singleValue, `${getValueProps().className}`);\n },\n valueContainer: () => {\n return classNames.valueContainer;\n },\n };\n\n const { getBaseProps, getTriggerProps, getValueProps } = useSelect({\n children: [],\n classNames,\n errorMessage,\n isDisabled: disabled,\n isInvalid: invalid,\n isLoading: loading,\n isRequired: required,\n label,\n labelPlacement: 'outside',\n });\n\n // react-select expects `isDisabled`, while our option contract uses `disabled`.\n const reactSelectOptions = options.map((option) => {\n return {\n ...option,\n isDisabled: option.disabled,\n };\n });\n\n // Compute selected option(s) for react-select\n //\n // Priority for finding options:\n // 1. Look in current options list\n // 2. Use selectedOptionFallback prop (for async selects with pre-fetched data)\n // 3. Create fallback with value as label\n //\n // Handles edge cases:\n // - Compares as strings to support both string and number values\n // - Returns null for empty single-select (required by react-select to clear)\n // - Creates fallback options when value exists but isn't in options list\n // (common with async selects where options change after selection)\n const reactSelectValue = (() => {\n // Helper to find option by value\n const findOption = (v: string | number): SelectOption => {\n // First, look in options list\n const inOptions = options.find((option) => {\n return String(option.value) === String(v);\n });\n if (inOptions) {\n return inOptions;\n }\n\n // Second, look in selectedOptionFallback prop (for async selects)\n if (selectedOptionFallback) {\n if (Array.isArray(selectedOptionFallback)) {\n const inSelected = selectedOptionFallback.find((option) => {\n return String(option.value) === String(v);\n });\n if (inSelected) {\n return inSelected;\n }\n } else if (String(selectedOptionFallback.value) === String(v)) {\n return selectedOptionFallback;\n }\n }\n\n // Fallback: create option with value as label, marked as fallback\n return { isFallback: true, label: String(v), value: v };\n };\n\n if (multiSelect) {\n if (!Array.isArray(value) || isValueEmpty(value)) {\n return [];\n }\n return value.map((v) => {\n return findOption(v);\n });\n }\n\n // Single select - use isValueEmpty to handle marker strings (__NULL__, etc.)\n if (isValueEmpty(value)) {\n return null;\n }\n return findOption(value);\n })();\n\n // Handle selection change\n const handleChange = (\n option: MultiValue<SelectOption> | SingleValue<SelectOption>,\n ) => {\n if (multiSelect) {\n onChange(\n (option as SelectOption[])?.map((_option) => {\n return convertToOriginalType(_option.value);\n }),\n );\n } else {\n const newValue = (option as SelectOption)?.value;\n // Pass null explicitly when clearing (not undefined)\n onChange(newValue != null ? convertToOriginalType(newValue) : null);\n }\n\n // Mark field as touched immediately when a selection is made if not already touched\n // This ensures validation errors show right away (isTouched becomes true)\n // For Select components, selecting an option is a complete user action\n // (unlike text inputs where typing is ongoing), so we mark as touched immediately\n const { isTouched: currentIsTouched } = getFieldState(name, testId);\n if (!currentIsTouched) {\n // Defer blur/touched notification until after the onChange value commit.\n // This prevents \"one render cycle behind\" validation states where blur\n // validation runs against the previous value.\n queueMicrotask(() => {\n onBlur();\n });\n }\n };\n\n // Handle blur event\n const handleBlur = () => {\n setIsFocused(false);\n onBlur();\n };\n\n // Handle focus event\n const handleFocus = () => {\n setIsFocused(true);\n };\n\n return (\n <div\n {...getBaseProps()}\n className={cn(classNames.base)}\n // see HeroUI styles for group-data condition (data-invalid),\n // e.g.: https://github.com/heroui-inc/heroui/blob/main/packages/components/select/src/use-select.ts\n data-required={required}\n data-testid={`${testId}_wrapper`}\n >\n {label ? (\n <label\n className={classNames.label}\n data-slot=\"label\"\n htmlFor={`react-select-${name}-input`}\n id={getLabelProps().id}\n >\n {label}\n {required ? (\n <span aria-hidden className=\"ml-0.5 text-danger\">\n *\n </span>\n ) : null}\n </label>\n ) : null}\n <ReactSelect\n ref={ref}\n aria-errormessage=\"\"\n aria-invalid={invalid}\n aria-label={ariaLabel}\n // set aria-labelledby to the label id so that the select is accessible\n aria-labelledby={\n label\n ? getTriggerProps()['aria-labelledby']?.split(' ')[1]\n : undefined\n }\n classNames={reactSelectClassNames}\n components={{\n Control: ControlComponent,\n DropdownIndicator: DropdownIndicatorComponent,\n Input: InputComponent,\n Option: OptionComponent,\n }}\n // Does not affect the testId of the select, but is needed to pass it to sub-components\n data-testid={testId}\n filterOption={filterOption}\n formatOptionLabel={renderOptionLabel}\n inputValue={inputValue}\n instanceId={name}\n isClearable={clearable}\n isDisabled={disabled}\n isLoading={loading}\n isMulti={multiSelect}\n menuIsOpen={debugMenuOpen ? true : undefined}\n // set menuPosition to fixed so that menu can be rendered\n // inside Card / Modal components, menuShouldBlockScroll\n // prevents container scroll when menu is open\n menuPosition=\"fixed\"\n menuShouldBlockScroll\n name={name}\n noOptionsMessage={renderEmptyOptions}\n onBlur={handleBlur}\n onChange={handleChange}\n onFocus={handleFocus}\n onInputChange={onInputChange}\n options={reactSelectOptions}\n placeholder={placeholder}\n unstyled\n value={reactSelectValue}\n />\n {invalid ? (\n <div {...getHelperWrapperProps()}>\n <div {...getErrorMessageProps()}>{errorMessage}</div>\n </div>\n ) : null}\n </div>\n );\n};\n\nexport default Select;\n","import Select from './Select';\n\nexport type { SelectProps } from './Select';\n\nexport { Select };\n\nexport default Select;\n"],"mappings":";;;;;;;;;AAeA,MAAa,iBAAiB,GAAG,EAC/B,OAAO;CACL,MAAM;CACN,gBACE;CACF,SACE;CACF,iBAAiB;CACjB,WAAW;CACX,aAAa;CACb,mBACE;CACF,OAAO;CACP,cAAc;CACd,qBAAqB;CACrB,oBAAoB;CACpB,OAAO;CAGP,OACE;CACF,kBAAkB;CAClB,gBAAgB;CAChB,MAAM;CACN,UAAU;CAGV,YAAY;CACZ,YAAY;CACZ,qBAAqB;CACrB,iBAAiB;CACjB,kBACE;CACF,kBAAkB;CAClB,QAAQ;CACR,iBACE;CACF,gBAAgB;CAChB,iBAAiB;CACjB,aAAa;CACb,iBAAiB;CACjB,aAAa;CACb,gBAAgB;AAClB,EACF,CAAC;AAkED,MAAM,kBAA2C,UAAU;CAGzD,MAAM,SAAS,GAAG,MAAM,YAAY;CACpC,OAAO,oBAAC,WAAW,OAAZ;EAAkB,eAAa;EAAQ,GAAI;CAAQ,CAAA;AAC5D;AAEA,MAAM,oBAA+C,UAAU;CAI7D,OACE,oBAAC,OAAD;EAAK,eAAa,GAFF,MAAM,YAAY,eAAe;YAG/C,oBAAC,WAAW,SAAZ,EAAoB,GAAI,MAAQ,CAAA;CAC7B,CAAA;AAET;AAEA,MAAM,mBAA6C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