@fuf-stack/uniform 1.22.4 → 1.22.6

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 (442) hide show
  1. package/dist/Checkboxes/index.cjs +113 -3
  2. package/dist/Checkboxes/index.cjs.map +1 -0
  3. package/dist/Checkboxes/index.d.cts +534 -2
  4. package/dist/Checkboxes/index.d.cts.map +1 -0
  5. package/dist/Checkboxes/index.d.ts +534 -2
  6. package/dist/Checkboxes/index.d.ts.map +1 -0
  7. package/dist/Checkboxes/index.js +112 -2
  8. package/dist/Checkboxes/index.js.map +1 -0
  9. package/dist/DatePicker/index.cjs +194 -3
  10. package/dist/DatePicker/index.cjs.map +1 -0
  11. package/dist/DatePicker/index.d.cts +1413 -2
  12. package/dist/DatePicker/index.d.cts.map +1 -0
  13. package/dist/DatePicker/index.d.ts +1413 -2
  14. package/dist/DatePicker/index.d.ts.map +1 -0
  15. package/dist/DatePicker/index.js +193 -2
  16. package/dist/DatePicker/index.js.map +1 -0
  17. package/dist/FieldArray/index.cjs +495 -3
  18. package/dist/FieldArray/index.cjs.map +1 -0
  19. package/dist/FieldArray/index.d.cts +539 -2
  20. package/dist/FieldArray/index.d.cts.map +1 -0
  21. package/dist/FieldArray/index.d.ts +539 -2
  22. package/dist/FieldArray/index.d.ts.map +1 -0
  23. package/dist/FieldArray/index.js +494 -2
  24. package/dist/FieldArray/index.js.map +1 -0
  25. package/dist/FieldCard/index.cjs +230 -4
  26. package/dist/FieldCard/index.cjs.map +1 -0
  27. package/dist/FieldCard/index.d.cts +314 -2
  28. package/dist/FieldCard/index.d.cts.map +1 -0
  29. package/dist/FieldCard/index.d.ts +314 -2
  30. package/dist/FieldCard/index.d.ts.map +1 -0
  31. package/dist/FieldCard/index.js +225 -2
  32. package/dist/FieldCard/index.js.map +1 -0
  33. package/dist/{FieldCopyTestIdButton-Dpmo0uBV.js → FieldCopyTestIdButton-CRJBix9D.js} +2 -2
  34. package/dist/{FieldCopyTestIdButton-Dpmo0uBV.js.map → FieldCopyTestIdButton-CRJBix9D.js.map} +1 -1
  35. package/dist/{FieldCopyTestIdButton-ptoB1F75.cjs → FieldCopyTestIdButton-D3D_LmJh.cjs} +1 -8
  36. package/dist/{FieldCopyTestIdButton-ptoB1F75.cjs.map → FieldCopyTestIdButton-D3D_LmJh.cjs.map} +1 -1
  37. package/dist/{FieldValidationError-ktTyyyip.js → FieldValidationError-ByRoIxaM.js} +5 -5
  38. package/dist/{FieldValidationError-ktTyyyip.js.map → FieldValidationError-ByRoIxaM.js.map} +1 -1
  39. package/dist/{FieldValidationError-BQcvvU9i.cjs → FieldValidationError-CfYKzl7P.cjs} +5 -6
  40. package/dist/{FieldValidationError-BQcvvU9i.cjs.map → FieldValidationError-CfYKzl7P.cjs.map} +1 -1
  41. package/dist/Form/index.cjs +118 -3
  42. package/dist/Form/index.cjs.map +1 -0
  43. package/dist/Form/index.d.cts +43 -2
  44. package/dist/Form/index.d.cts.map +1 -0
  45. package/dist/Form/index.d.ts +43 -2
  46. package/dist/Form/index.d.ts.map +1 -0
  47. package/dist/Form/index.js +118 -2
  48. package/dist/Form/index.js.map +1 -0
  49. package/dist/{FormContext-3kamRn2C.d.cts → FormContext-BLWS7bhO.d.cts} +1 -1
  50. package/dist/{FormContext-3kamRn2C.d.cts.map → FormContext-BLWS7bhO.d.cts.map} +1 -1
  51. package/dist/{FormContext-BQeKOV-0.js → FormContext-DjJOJKxj.js} +1 -1
  52. package/dist/{FormContext-BQeKOV-0.js.map → FormContext-DjJOJKxj.js.map} +1 -1
  53. package/dist/{FormContext-DsmS_mkO.cjs → FormContext-EGH0cVnH.cjs} +1 -1
  54. package/dist/{FormContext-DsmS_mkO.cjs.map → FormContext-EGH0cVnH.cjs.map} +1 -1
  55. package/dist/{FormContext-i66vM5f1.d.ts → FormContext-LgzrDWu1.d.ts} +1 -1
  56. package/dist/{FormContext-i66vM5f1.d.ts.map → FormContext-LgzrDWu1.d.ts.map} +1 -1
  57. package/dist/Grid/index.cjs +1 -2
  58. package/dist/Grid/index.d.cts +22 -2
  59. package/dist/Grid/index.d.cts.map +1 -0
  60. package/dist/Grid/index.d.ts +22 -2
  61. package/dist/Grid/index.d.ts.map +1 -0
  62. package/dist/Grid/index.js +2 -2
  63. package/dist/{Grid-D-VcRGi9.cjs → Grid-BbqCRkuY.cjs} +1 -8
  64. package/dist/{Grid-D-VcRGi9.cjs.map → Grid-BbqCRkuY.cjs.map} +1 -1
  65. package/dist/{Grid-BQpLOB0G.js → Grid-CTs-Rb9G.js} +2 -2
  66. package/dist/{Grid-BQpLOB0G.js.map → Grid-CTs-Rb9G.js.map} +1 -1
  67. package/dist/Input/index.cjs +96 -3
  68. package/dist/Input/index.cjs.map +1 -0
  69. package/dist/Input/index.d.cts +677 -2
  70. package/dist/Input/index.d.cts.map +1 -0
  71. package/dist/Input/index.d.ts +677 -2
  72. package/dist/Input/index.d.ts.map +1 -0
  73. package/dist/Input/index.js +96 -2
  74. package/dist/Input/index.js.map +1 -0
  75. package/dist/RadioBoxes/index.cjs +136 -4
  76. package/dist/RadioBoxes/index.cjs.map +1 -0
  77. package/dist/RadioBoxes/index.d.cts +1477 -2
  78. package/dist/RadioBoxes/index.d.cts.map +1 -0
  79. package/dist/RadioBoxes/index.d.ts +1477 -2
  80. package/dist/RadioBoxes/index.d.ts.map +1 -0
  81. package/dist/RadioBoxes/index.js +135 -2
  82. package/dist/RadioBoxes/index.js.map +1 -0
  83. package/dist/RadioTabs/index.cjs +123 -3
  84. package/dist/RadioTabs/index.cjs.map +1 -0
  85. package/dist/RadioTabs/index.d.cts +585 -2
  86. package/dist/RadioTabs/index.d.cts.map +1 -0
  87. package/dist/RadioTabs/index.d.ts +585 -2
  88. package/dist/RadioTabs/index.d.ts.map +1 -0
  89. package/dist/RadioTabs/index.js +120 -2
  90. package/dist/RadioTabs/index.js.map +1 -0
  91. package/dist/Radios/index.cjs +74 -3
  92. package/dist/Radios/index.cjs.map +1 -0
  93. package/dist/Radios/index.d.cts +1263 -2
  94. package/dist/Radios/index.d.cts.map +1 -0
  95. package/dist/Radios/index.d.ts +1263 -2
  96. package/dist/Radios/index.d.ts.map +1 -0
  97. package/dist/Radios/index.js +73 -2
  98. package/dist/Radios/index.js.map +1 -0
  99. package/dist/Select/index.cjs +286 -3
  100. package/dist/Select/index.cjs.map +1 -0
  101. package/dist/Select/index.d.cts +3917 -2
  102. package/dist/Select/index.d.cts.map +1 -0
  103. package/dist/Select/index.d.ts +3917 -2
  104. package/dist/Select/index.d.ts.map +1 -0
  105. package/dist/Select/index.js +283 -2
  106. package/dist/Select/index.js.map +1 -0
  107. package/dist/Slider/index.cjs +109 -3
  108. package/dist/Slider/index.cjs.map +1 -0
  109. package/dist/Slider/index.d.cts +1760 -2
  110. package/dist/Slider/index.d.cts.map +1 -0
  111. package/dist/Slider/index.d.ts +1760 -2
  112. package/dist/Slider/index.d.ts.map +1 -0
  113. package/dist/Slider/index.js +108 -2
  114. package/dist/Slider/index.js.map +1 -0
  115. package/dist/SubmitButton/index.cjs +31 -3
  116. package/dist/SubmitButton/index.cjs.map +1 -0
  117. package/dist/SubmitButton/index.d.cts +38 -2
  118. package/dist/SubmitButton/index.d.cts.map +1 -0
  119. package/dist/SubmitButton/index.d.ts +38 -2
  120. package/dist/SubmitButton/index.d.ts.map +1 -0
  121. package/dist/SubmitButton/index.js +31 -2
  122. package/dist/SubmitButton/index.js.map +1 -0
  123. package/dist/Switch/index.cjs +82 -3
  124. package/dist/Switch/index.cjs.map +1 -0
  125. package/dist/Switch/index.d.cts +1257 -2
  126. package/dist/Switch/index.d.cts.map +1 -0
  127. package/dist/Switch/index.d.ts +1257 -2
  128. package/dist/Switch/index.d.ts.map +1 -0
  129. package/dist/Switch/index.js +81 -2
  130. package/dist/Switch/index.js.map +1 -0
  131. package/dist/SwitchBox/index.cjs +154 -4
  132. package/dist/SwitchBox/index.cjs.map +1 -0
  133. package/dist/SwitchBox/index.d.cts +473 -2
  134. package/dist/SwitchBox/index.d.cts.map +1 -0
  135. package/dist/SwitchBox/index.d.ts +473 -2
  136. package/dist/SwitchBox/index.d.ts.map +1 -0
  137. package/dist/SwitchBox/index.js +153 -2
  138. package/dist/SwitchBox/index.js.map +1 -0
  139. package/dist/TextArea/index.cjs +66 -3
  140. package/dist/TextArea/index.cjs.map +1 -0
  141. package/dist/TextArea/index.d.cts +659 -2
  142. package/dist/TextArea/index.d.cts.map +1 -0
  143. package/dist/TextArea/index.d.ts +659 -2
  144. package/dist/TextArea/index.d.ts.map +1 -0
  145. package/dist/TextArea/index.js +66 -2
  146. package/dist/TextArea/index.js.map +1 -0
  147. package/dist/Time/index.cjs +221 -3
  148. package/dist/Time/index.cjs.map +1 -0
  149. package/dist/Time/index.d.cts +1028 -2
  150. package/dist/Time/index.d.cts.map +1 -0
  151. package/dist/Time/index.d.ts +1028 -2
  152. package/dist/Time/index.d.ts.map +1 -0
  153. package/dist/Time/index.js +216 -2
  154. package/dist/Time/index.js.map +1 -0
  155. package/dist/helpers/index.cjs +0 -1
  156. package/dist/helpers/index.cjs.map +1 -1
  157. package/dist/helpers/index.js.map +1 -1
  158. package/dist/hooks/useClientValidation/index.cjs +177 -3
  159. package/dist/hooks/useClientValidation/index.cjs.map +1 -1
  160. package/dist/hooks/useClientValidation/index.d.cts +148 -2
  161. package/dist/hooks/useClientValidation/index.d.cts.map +1 -0
  162. package/dist/hooks/useClientValidation/index.d.ts +148 -2
  163. package/dist/hooks/useClientValidation/index.d.ts.map +1 -0
  164. package/dist/hooks/useClientValidation/index.js +175 -1
  165. package/dist/hooks/useClientValidation/index.js.map +1 -1
  166. package/dist/hooks/useController/index.cjs +1 -1
  167. package/dist/hooks/useController/index.d.cts +1 -1
  168. package/dist/hooks/useController/index.d.ts +1 -1
  169. package/dist/hooks/useController/index.js +1 -1
  170. package/dist/hooks/useFormContext/index.cjs +1 -1
  171. package/dist/hooks/useFormContext/index.d.cts +1 -1
  172. package/dist/hooks/useFormContext/index.d.ts +1 -1
  173. package/dist/hooks/useFormContext/index.js +1 -1
  174. package/dist/hooks/useInput/index.cjs +0 -1
  175. package/dist/hooks/useInput/index.d.cts +1 -1
  176. package/dist/hooks/useInput/index.d.ts +1 -1
  177. package/dist/hooks/useInput/index.js +1 -1
  178. package/dist/hooks/useInputValueDebounce/index.cjs +1 -2
  179. package/dist/hooks/useInputValueDebounce/index.cjs.map +1 -1
  180. package/dist/hooks/useInputValueDebounce/index.d.cts +66 -2
  181. package/dist/hooks/useInputValueDebounce/index.d.cts.map +1 -0
  182. package/dist/hooks/useInputValueDebounce/index.d.ts +66 -2
  183. package/dist/hooks/useInputValueDebounce/index.d.ts.map +1 -0
  184. package/dist/hooks/useInputValueDebounce/index.js +1 -1
  185. package/dist/hooks/useInputValueTransform/index.cjs +1 -1
  186. package/dist/hooks/useInputValueTransform/index.d.cts +1 -1
  187. package/dist/hooks/useInputValueTransform/index.d.ts +1 -1
  188. package/dist/hooks/useInputValueTransform/index.js +1 -1
  189. package/dist/hooks/useUniformField/index.cjs +8 -8
  190. package/dist/hooks/useUniformField/index.cjs.map +1 -1
  191. package/dist/hooks/useUniformField/index.d.cts +98 -2
  192. package/dist/hooks/useUniformField/index.d.cts.map +1 -0
  193. package/dist/hooks/useUniformField/index.d.ts +98 -2
  194. package/dist/hooks/useUniformField/index.d.ts.map +1 -0
  195. package/dist/hooks/useUniformField/index.js +8 -8
  196. package/dist/hooks/useUniformField/index.js.map +1 -1
  197. package/dist/hooks/useUniformFieldArray/index.cjs +1 -2
  198. package/dist/hooks/useUniformFieldArray/index.cjs.map +1 -1
  199. package/dist/hooks/useUniformFieldArray/index.d.cts +79 -2
  200. package/dist/hooks/useUniformFieldArray/index.d.cts.map +1 -0
  201. package/dist/hooks/useUniformFieldArray/index.d.ts +79 -2
  202. package/dist/hooks/useUniformFieldArray/index.d.ts.map +1 -0
  203. package/dist/hooks/useUniformFieldArray/index.js +1 -1
  204. package/dist/hooks/useWatchFormReset/index.cjs +1 -2
  205. package/dist/hooks/useWatchFormReset/index.cjs.map +1 -1
  206. package/dist/hooks/useWatchFormReset/index.d.cts +38 -2
  207. package/dist/hooks/useWatchFormReset/index.d.cts.map +1 -0
  208. package/dist/hooks/useWatchFormReset/index.d.ts +38 -2
  209. package/dist/hooks/useWatchFormReset/index.d.ts.map +1 -0
  210. package/dist/hooks/useWatchFormReset/index.js +1 -1
  211. package/dist/hooks/useWatchUserChange/index.cjs +82 -2
  212. package/dist/hooks/useWatchUserChange/index.cjs.map +1 -1
  213. package/dist/hooks/useWatchUserChange/index.d.cts +80 -2
  214. package/dist/hooks/useWatchUserChange/index.d.cts.map +1 -0
  215. package/dist/hooks/useWatchUserChange/index.d.ts +80 -2
  216. package/dist/hooks/useWatchUserChange/index.d.ts.map +1 -0
  217. package/dist/hooks/useWatchUserChange/index.js +81 -1
  218. package/dist/hooks/useWatchUserChange/index.js.map +1 -1
  219. package/dist/partials/FieldCopyTestIdButton/index.cjs +1 -2
  220. package/dist/partials/FieldCopyTestIdButton/index.d.cts +14 -2
  221. package/dist/partials/FieldCopyTestIdButton/index.d.cts.map +1 -0
  222. package/dist/partials/FieldCopyTestIdButton/index.d.ts +14 -2
  223. package/dist/partials/FieldCopyTestIdButton/index.d.ts.map +1 -0
  224. package/dist/partials/FieldCopyTestIdButton/index.js +2 -2
  225. package/dist/partials/FieldValidationError/index.cjs +1 -2
  226. package/dist/partials/FieldValidationError/index.d.cts +22 -2
  227. package/dist/partials/FieldValidationError/index.d.cts.map +1 -0
  228. package/dist/partials/FieldValidationError/index.d.ts +22 -2
  229. package/dist/partials/FieldValidationError/index.d.ts.map +1 -0
  230. package/dist/partials/FieldValidationError/index.js +2 -2
  231. package/dist/{useController-CzP0aVFC.d.ts → useController-CvQqCvFJ.d.ts} +1 -1
  232. package/dist/{useController-CzP0aVFC.d.ts.map → useController-CvQqCvFJ.d.ts.map} +1 -1
  233. package/dist/{useController--lRPWBuD.cjs → useController-Dbe7ADG6.cjs} +2 -2
  234. package/dist/{useController--lRPWBuD.cjs.map → useController-Dbe7ADG6.cjs.map} +1 -1
  235. package/dist/{useController-B287flU_.js → useController-DxFS0u7c.js} +2 -2
  236. package/dist/{useController-B287flU_.js.map → useController-DxFS0u7c.js.map} +1 -1
  237. package/dist/{useController-BT3Fd0IO.d.cts → useController-fblEApv_.d.cts} +1 -1
  238. package/dist/{useController-BT3Fd0IO.d.cts.map → useController-fblEApv_.d.cts.map} +1 -1
  239. package/dist/{useFormContext-CpLVpNAf.d.ts → useFormContext-B1-deU4Z.d.ts} +4 -4
  240. package/dist/{useFormContext-CpLVpNAf.d.ts.map → useFormContext-B1-deU4Z.d.ts.map} +1 -1
  241. package/dist/{useFormContext-CT8H8xIe.js → useFormContext-BJqa1FoT.js} +2 -2
  242. package/dist/{useFormContext-CT8H8xIe.js.map → useFormContext-BJqa1FoT.js.map} +1 -1
  243. package/dist/{useFormContext-Ddc1HWKv.d.cts → useFormContext-D5vrT2sg.d.cts} +4 -4
  244. package/dist/{useFormContext-Ddc1HWKv.d.cts.map → useFormContext-D5vrT2sg.d.cts.map} +1 -1
  245. package/dist/{useFormContext-CrXwNYiB.cjs → useFormContext-kUHonwgu.cjs} +2 -2
  246. package/dist/{useFormContext-CrXwNYiB.cjs.map → useFormContext-kUHonwgu.cjs.map} +1 -1
  247. package/dist/{useInputValueTransform-CNCBU7a9.d.cts → useInputValueTransform-DCXXb2Lp.d.cts} +1 -1
  248. package/dist/{useInputValueTransform-CNCBU7a9.d.cts.map → useInputValueTransform-DCXXb2Lp.d.cts.map} +1 -1
  249. package/dist/{useInputValueTransform-dLfFIYW4.d.ts → useInputValueTransform-DCXXb2Lp.d.ts} +1 -1
  250. package/dist/{useInputValueTransform-dLfFIYW4.d.ts.map → useInputValueTransform-DCXXb2Lp.d.ts.map} +1 -1
  251. package/dist/{useInputValueTransform-CXdmtc0Q.js → useInputValueTransform-DJ5zkqSy.js} +1 -1
  252. package/dist/{useInputValueTransform-CXdmtc0Q.js.map → useInputValueTransform-DJ5zkqSy.js.map} +1 -1
  253. package/dist/{useInputValueTransform-Bm65K8LX.cjs → useInputValueTransform-P62UUZBl.cjs} +1 -2
  254. package/dist/{useInputValueTransform-Bm65K8LX.cjs.map → useInputValueTransform-P62UUZBl.cjs.map} +1 -1
  255. package/package.json +6 -13
  256. package/dist/Checkboxes-D1hppxDE.js +0 -112
  257. package/dist/Checkboxes-D1hppxDE.js.map +0 -1
  258. package/dist/Checkboxes-DHk09GmH.cjs +0 -124
  259. package/dist/Checkboxes-DHk09GmH.cjs.map +0 -1
  260. package/dist/DatePicker-BUSi8SWQ.js +0 -193
  261. package/dist/DatePicker-BUSi8SWQ.js.map +0 -1
  262. package/dist/DatePicker-DuBjvS5g.cjs +0 -205
  263. package/dist/DatePicker-DuBjvS5g.cjs.map +0 -1
  264. package/dist/FieldArray-BxmK1NRd.js +0 -494
  265. package/dist/FieldArray-BxmK1NRd.js.map +0 -1
  266. package/dist/FieldArray-DgiQpIdr.cjs +0 -506
  267. package/dist/FieldArray-DgiQpIdr.cjs.map +0 -1
  268. package/dist/FieldCard-BK6SNqFY.js +0 -222
  269. package/dist/FieldCard-BK6SNqFY.js.map +0 -1
  270. package/dist/FieldCard-C-DZ5ARr.cjs +0 -234
  271. package/dist/FieldCard-C-DZ5ARr.cjs.map +0 -1
  272. package/dist/Form-CYlsIABv.cjs +0 -125
  273. package/dist/Form-CYlsIABv.cjs.map +0 -1
  274. package/dist/Form-D3yfDu4L.js +0 -114
  275. package/dist/Form-D3yfDu4L.js.map +0 -1
  276. package/dist/Input-B5RxbkNS.js +0 -96
  277. package/dist/Input-B5RxbkNS.js.map +0 -1
  278. package/dist/Input-DvVViuWH.cjs +0 -108
  279. package/dist/Input-DvVViuWH.cjs.map +0 -1
  280. package/dist/RadioBoxes-BJz-aJp3.js +0 -135
  281. package/dist/RadioBoxes-BJz-aJp3.js.map +0 -1
  282. package/dist/RadioBoxes-CR--FBhQ.cjs +0 -153
  283. package/dist/RadioBoxes-CR--FBhQ.cjs.map +0 -1
  284. package/dist/RadioTabs-Btt582Nl.cjs +0 -133
  285. package/dist/RadioTabs-Btt582Nl.cjs.map +0 -1
  286. package/dist/RadioTabs-CYmzrPBG.js +0 -120
  287. package/dist/RadioTabs-CYmzrPBG.js.map +0 -1
  288. package/dist/Radios-DZxhrX96.js +0 -73
  289. package/dist/Radios-DZxhrX96.js.map +0 -1
  290. package/dist/Radios-Jg9mwE0B.cjs +0 -85
  291. package/dist/Radios-Jg9mwE0B.cjs.map +0 -1
  292. package/dist/Select-CZwuEAB5.cjs +0 -296
  293. package/dist/Select-CZwuEAB5.cjs.map +0 -1
  294. package/dist/Select-CgeqhZIC.js +0 -283
  295. package/dist/Select-CgeqhZIC.js.map +0 -1
  296. package/dist/Slider-Bpxt-Qgj.cjs +0 -120
  297. package/dist/Slider-Bpxt-Qgj.cjs.map +0 -1
  298. package/dist/Slider-DRfSw0uE.js +0 -108
  299. package/dist/Slider-DRfSw0uE.js.map +0 -1
  300. package/dist/SubmitButton-D-wn1PJV.cjs +0 -43
  301. package/dist/SubmitButton-D-wn1PJV.cjs.map +0 -1
  302. package/dist/SubmitButton-D6aU7IgC.js +0 -31
  303. package/dist/SubmitButton-D6aU7IgC.js.map +0 -1
  304. package/dist/Switch-D9DNrqmj.js +0 -81
  305. package/dist/Switch-D9DNrqmj.js.map +0 -1
  306. package/dist/Switch-hjjy34QB.cjs +0 -93
  307. package/dist/Switch-hjjy34QB.cjs.map +0 -1
  308. package/dist/SwitchBox-BU1XieaZ.js +0 -153
  309. package/dist/SwitchBox-BU1XieaZ.js.map +0 -1
  310. package/dist/SwitchBox-Dl-F5y2m.cjs +0 -171
  311. package/dist/SwitchBox-Dl-F5y2m.cjs.map +0 -1
  312. package/dist/TextArea-CMXm-kTK.cjs +0 -78
  313. package/dist/TextArea-CMXm-kTK.cjs.map +0 -1
  314. package/dist/TextArea-DAg_K-QP.js +0 -66
  315. package/dist/TextArea-DAg_K-QP.js.map +0 -1
  316. package/dist/Time-CDptQ3CK.js +0 -213
  317. package/dist/Time-CDptQ3CK.js.map +0 -1
  318. package/dist/Time-WKgbji5k.cjs +0 -219
  319. package/dist/Time-WKgbji5k.cjs.map +0 -1
  320. package/dist/index-54OZEaUU.d.ts +0 -43
  321. package/dist/index-54OZEaUU.d.ts.map +0 -1
  322. package/dist/index-7UT2Ki5e.d.cts +0 -113
  323. package/dist/index-7UT2Ki5e.d.cts.map +0 -1
  324. package/dist/index-9_3XTDJC.d.cts +0 -174
  325. package/dist/index-9_3XTDJC.d.cts.map +0 -1
  326. package/dist/index-B5SfdA5O.d.cts +0 -99
  327. package/dist/index-B5SfdA5O.d.cts.map +0 -1
  328. package/dist/index-B61zRzeS.d.cts +0 -101
  329. package/dist/index-B61zRzeS.d.cts.map +0 -1
  330. package/dist/index-B7gQppgQ.d.ts +0 -116
  331. package/dist/index-B7gQppgQ.d.ts.map +0 -1
  332. package/dist/index-BDFJDKmz.d.ts +0 -166
  333. package/dist/index-BDFJDKmz.d.ts.map +0 -1
  334. package/dist/index-BPaSE_7b.d.ts +0 -179
  335. package/dist/index-BPaSE_7b.d.ts.map +0 -1
  336. package/dist/index-BSjcTo7A.d.ts +0 -147
  337. package/dist/index-BSjcTo7A.d.ts.map +0 -1
  338. package/dist/index-BmMspnsJ.d.cts +0 -137
  339. package/dist/index-BmMspnsJ.d.cts.map +0 -1
  340. package/dist/index-BqxDWhNr.d.cts +0 -22
  341. package/dist/index-BqxDWhNr.d.cts.map +0 -1
  342. package/dist/index-Bzs7_gnk.d.cts +0 -116
  343. package/dist/index-Bzs7_gnk.d.cts.map +0 -1
  344. package/dist/index-C3-TV4Up.d.cts +0 -43
  345. package/dist/index-C3-TV4Up.d.cts.map +0 -1
  346. package/dist/index-C4GJH8Xv.d.ts +0 -290
  347. package/dist/index-C4GJH8Xv.d.ts.map +0 -1
  348. package/dist/index-CE8fnXuQ.d.ts +0 -167
  349. package/dist/index-CE8fnXuQ.d.ts.map +0 -1
  350. package/dist/index-CEJxjf5R.d.ts +0 -22
  351. package/dist/index-CEJxjf5R.d.ts.map +0 -1
  352. package/dist/index-CHQKk_fN2.d.ts +0 -14
  353. package/dist/index-CHQKk_fN2.d.ts.map +0 -1
  354. package/dist/index-CIiOXrrY.d.ts +0 -99
  355. package/dist/index-CIiOXrrY.d.ts.map +0 -1
  356. package/dist/index-CV7wqRev.d.ts +0 -38
  357. package/dist/index-CV7wqRev.d.ts.map +0 -1
  358. package/dist/index-CXvUaeCL.d.cts +0 -14
  359. package/dist/index-CXvUaeCL.d.cts.map +0 -1
  360. package/dist/index-C_zjtsGM.d.ts +0 -113
  361. package/dist/index-C_zjtsGM.d.ts.map +0 -1
  362. package/dist/index-CbPJiRK2.d.ts +0 -83
  363. package/dist/index-CbPJiRK2.d.ts.map +0 -1
  364. package/dist/index-CvP3tbVV.d.ts +0 -137
  365. package/dist/index-CvP3tbVV.d.ts.map +0 -1
  366. package/dist/index-Cwb7sTO0.d.ts +0 -154
  367. package/dist/index-Cwb7sTO0.d.ts.map +0 -1
  368. package/dist/index-CxY9VWv5.d.cts +0 -154
  369. package/dist/index-CxY9VWv5.d.cts.map +0 -1
  370. package/dist/index-D8udSkgA.d.cts +0 -167
  371. package/dist/index-D8udSkgA.d.cts.map +0 -1
  372. package/dist/index-DBsF7xsq.d.cts +0 -147
  373. package/dist/index-DBsF7xsq.d.cts.map +0 -1
  374. package/dist/index-DNADTCoc.d.cts +0 -290
  375. package/dist/index-DNADTCoc.d.cts.map +0 -1
  376. package/dist/index-DRg0anjB.d.cts +0 -179
  377. package/dist/index-DRg0anjB.d.cts.map +0 -1
  378. package/dist/index-DUmNI6cE.d.cts +0 -83
  379. package/dist/index-DUmNI6cE.d.cts.map +0 -1
  380. package/dist/index-Db0WD4d1.d.cts +0 -166
  381. package/dist/index-Db0WD4d1.d.cts.map +0 -1
  382. package/dist/index-DpXSZCZe.d.cts +0 -38
  383. package/dist/index-DpXSZCZe.d.cts.map +0 -1
  384. package/dist/index-GxTY7aAc.d.ts +0 -174
  385. package/dist/index-GxTY7aAc.d.ts.map +0 -1
  386. package/dist/index-P30z4VRT.d.cts +0 -22
  387. package/dist/index-P30z4VRT.d.cts.map +0 -1
  388. package/dist/index-PMCqBX0t.d.ts +0 -101
  389. package/dist/index-PMCqBX0t.d.ts.map +0 -1
  390. package/dist/index-PWRw2bPH.d.ts +0 -22
  391. package/dist/index-PWRw2bPH.d.ts.map +0 -1
  392. package/dist/index-QgVr4iWX.d.cts +0 -122
  393. package/dist/index-QgVr4iWX.d.cts.map +0 -1
  394. package/dist/index-dgho7gpc.d.ts +0 -122
  395. package/dist/index-dgho7gpc.d.ts.map +0 -1
  396. package/dist/index.cjs +0 -85
  397. package/dist/index.cjs.map +0 -1
  398. package/dist/index.d.cts +0 -31
  399. package/dist/index.d.ts +0 -31
  400. package/dist/index.js +0 -36
  401. package/dist/index.js.map +0 -1
  402. package/dist/useClientValidation-BRfhqRom.cjs +0 -190
  403. package/dist/useClientValidation-BRfhqRom.cjs.map +0 -1
  404. package/dist/useClientValidation-C2dLJnDI.d.cts +0 -148
  405. package/dist/useClientValidation-C2dLJnDI.d.cts.map +0 -1
  406. package/dist/useClientValidation-DpLdzIAb.js +0 -178
  407. package/dist/useClientValidation-DpLdzIAb.js.map +0 -1
  408. package/dist/useClientValidation-qRq2_spX.d.ts +0 -148
  409. package/dist/useClientValidation-qRq2_spX.d.ts.map +0 -1
  410. package/dist/useInputValueDebounce-CfQDiomI.d.cts +0 -66
  411. package/dist/useInputValueDebounce-CfQDiomI.d.cts.map +0 -1
  412. package/dist/useInputValueDebounce-DZgzL7GQ.d.ts +0 -66
  413. package/dist/useInputValueDebounce-DZgzL7GQ.d.ts.map +0 -1
  414. package/dist/useUniformField-CmAYcGER.d.cts +0 -98
  415. package/dist/useUniformField-CmAYcGER.d.cts.map +0 -1
  416. package/dist/useUniformField-DJDpQzRo.d.ts +0 -98
  417. package/dist/useUniformField-DJDpQzRo.d.ts.map +0 -1
  418. package/dist/useUniformFieldArray-D3fdzwzD.d.cts +0 -79
  419. package/dist/useUniformFieldArray-D3fdzwzD.d.cts.map +0 -1
  420. package/dist/useUniformFieldArray-zGcIhwhF.d.ts +0 -79
  421. package/dist/useUniformFieldArray-zGcIhwhF.d.ts.map +0 -1
  422. package/dist/useWatchFormReset-BSd6jMxU.d.cts +0 -38
  423. package/dist/useWatchFormReset-BSd6jMxU.d.cts.map +0 -1
  424. package/dist/useWatchFormReset-C7YJ-I3N.d.ts +0 -38
  425. package/dist/useWatchFormReset-C7YJ-I3N.d.ts.map +0 -1
  426. package/dist/useWatchUserChange-C1xWHtFG.cjs +0 -90
  427. package/dist/useWatchUserChange-C1xWHtFG.cjs.map +0 -1
  428. package/dist/useWatchUserChange-CpyZz2i7.d.ts +0 -80
  429. package/dist/useWatchUserChange-CpyZz2i7.d.ts.map +0 -1
  430. package/dist/useWatchUserChange-DSAboNCs.d.cts +0 -80
  431. package/dist/useWatchUserChange-DSAboNCs.d.cts.map +0 -1
  432. package/dist/useWatchUserChange-DSQGsl1R.js +0 -84
  433. package/dist/useWatchUserChange-DSQGsl1R.js.map +0 -1
  434. /package/dist/{index-BLwMeReG.d.ts → index-BKZ67WMa.d.cts} +0 -0
  435. /package/dist/{index-C2gUMYkE.d.cts → index-BKZ67WMa.d.ts} +0 -0
  436. /package/dist/{index-CJgP-E0M.d.cts → index-BVVgDSdq.d.cts} +0 -0
  437. /package/dist/{index-Cg9utiy0.d.ts → index-BVVgDSdq.d.ts} +0 -0
  438. /package/dist/{index-CspKFJM1.d.cts → index-DmtQKWjk.d.cts} +0 -0
  439. /package/dist/{index-h64gcVNJ.d.ts → index-DmtQKWjk.d.ts} +0 -0
  440. /package/dist/{useInput-CVm3tP78.js → useInput-C0aJaAGe.js} +0 -0
  441. /package/dist/{useInput-BdH8oftG.d.ts → useInput-ClpHDPdr.d.cts} +0 -0
  442. /package/dist/{useInput-DZOmMKcp.d.cts → useInput-ClpHDPdr.d.ts} +0 -0
@@ -1,213 +0,0 @@
1
- import { useUniformField } from "./hooks/useUniformField/index.js";
2
- import { tv, variantsToClassNames } from "@fuf-stack/pixel-utils";
3
- import { jsx } from "react/jsx-runtime";
4
- import { getLocalTimeZone, parseAbsolute, parseAbsoluteToLocal, parseDateTime, parseZonedDateTime } from "@internationalized/date";
5
- import { TimeInput } from "@heroui/date-input";
6
- //#region src/Time/timeHelpers.ts
7
- /** Cast unknown input to the TimeInput value union type. */
8
- const asTimeValue = (value) => {
9
- return value;
10
- };
11
- /** Check whether a value already looks like an @internationalized/date value. */
12
- const isTimeValueLike = (value) => {
13
- if (!value || typeof value !== "object") return false;
14
- return "hour" in value || "calendar" in value;
15
- };
16
- /** Check if the incoming string represents a plain time (e.g. 09:30 or 09:30:45). */
17
- const isTimeOnlyString = (value) => {
18
- return /^\d{2}:\d{2}(?::\d{2}(?:\.\d{1,3})?)?$/.test(value);
19
- };
20
- /** Check if the incoming string is a UTC time-only value (e.g. 09:30Z). */
21
- const isUtcTimeOnlyString = (value) => {
22
- return /^\d{2}:\d{2}(?::\d{2}(?:\.\d{1,3})?)?Z$/.test(value);
23
- };
24
- /** Zero-pad integer segments for time serialization. */
25
- const pad = (value) => {
26
- return String(value).padStart(2, "0");
27
- };
28
- /** Convert an absolute ISO string into UTC time-only store format. */
29
- const toUtcTimeString = (absoluteIsoString, granularity) => {
30
- const utcDate = new Date(absoluteIsoString);
31
- if (Number.isNaN(utcDate.getTime())) return null;
32
- const hour = pad(utcDate.getUTCHours());
33
- if (granularity === "hour") return `${hour}:00Z`;
34
- return `${hour}:${pad(utcDate.getUTCMinutes())}Z`;
35
- };
36
- /** True when an input already carries timezone/offset information. */
37
- const hasExplicitTimeZone = (value) => {
38
- if (value.includes("[") && value.includes("]")) return true;
39
- return /(?:[zZ]|[+-]\d{2}:\d{2})$/.test(value);
40
- };
41
- /** True for date-time strings without timezone/offset. */
42
- const isNaiveDateTimeString = (value) => {
43
- return /^\d{4}-\d{2}-\d{2}T/.test(value) && !hasExplicitTimeZone(value);
44
- };
45
- /** Safely run a parser and return `null` on parsing errors. */
46
- const tryParse = (parser) => {
47
- try {
48
- return asTimeValue(parser());
49
- } catch {
50
- return null;
51
- }
52
- };
53
- /**
54
- * Parse a form value into a HeroUI TimeInput compatible `TimeValue`.
55
- *
56
- * Supports existing `TimeValue` objects, native `Date` instances, plain time
57
- * strings (`HH:mm[:ss]`), absolute ISO date-time strings, zoned date-time
58
- * strings, and local date-time strings.
59
- *
60
- * Time-only strings are interpreted in the active timezone and normalized to a
61
- * `ZonedDateTime` (using a fixed reference date) so timezone abbreviations can
62
- * remain visible in the UI.
63
- */
64
- const parseTimeValue = (value, timeZone) => {
65
- if (value == null || value === "") return null;
66
- if (isTimeValueLike(value)) return asTimeValue(value);
67
- if (value instanceof Date) return asTimeValue(timeZone ? parseAbsolute(value.toISOString(), timeZone) : parseAbsoluteToLocal(value.toISOString()));
68
- if (typeof value !== "string") return null;
69
- const normalizedValue = value.trim();
70
- if (normalizedValue === "") return null;
71
- if (isTimeOnlyString(normalizedValue)) return tryParse(() => {
72
- const [hourValue, minuteValue, secondValue] = normalizedValue.split(":").map(Number);
73
- const resolvedTimeZone = resolveTimeFieldTimeZone(timeZone);
74
- return parseZonedDateTime(`1970-01-01T${pad(hourValue)}:${pad(minuteValue)}:${pad(secondValue ?? 0)}[${resolvedTimeZone}]`);
75
- });
76
- if (isUtcTimeOnlyString(normalizedValue)) return tryParse(() => {
77
- const resolvedTimeZone = resolveTimeFieldTimeZone(timeZone);
78
- return parseAbsolute(`1970-01-01T${normalizedValue}`, resolvedTimeZone);
79
- });
80
- return [
81
- ...timeZone && isNaiveDateTimeString(normalizedValue) ? [() => {
82
- return parseZonedDateTime(`${normalizedValue}[${timeZone}]`);
83
- }] : [],
84
- () => {
85
- return timeZone ? parseAbsolute(normalizedValue, timeZone) : parseAbsoluteToLocal(normalizedValue);
86
- },
87
- () => {
88
- return parseZonedDateTime(normalizedValue);
89
- },
90
- () => {
91
- return parseDateTime(normalizedValue);
92
- }
93
- ].map((parser) => {
94
- return tryParse(parser);
95
- }).find((parsedValue) => {
96
- return parsedValue != null;
97
- }) ?? null;
98
- };
99
- /** Resolve the timezone used for parsing and string conversion. */
100
- const resolveTimeFieldTimeZone = (timeZone) => {
101
- return timeZone ?? getLocalTimeZone();
102
- };
103
- /**
104
- * Build default placeholder value for TimeInput.
105
- *
106
- * Uses a fixed reference time to keep snapshots deterministic.
107
- */
108
- const getTimeFieldPlaceholderValue = (timeZone) => {
109
- return asTimeValue(parseZonedDateTime(`1970-01-01T00:00:00[${resolveTimeFieldTimeZone(timeZone)}]`));
110
- };
111
- /**
112
- * Convert a TimeValue into a UTC time-only string for form state.
113
- *
114
- * The stored format is `HH:mmZ` (or `HH:00Z` when granularity is `hour`).
115
- */
116
- const timeValueToString = (value, timeZone, granularity = "minute") => {
117
- if (value == null) return null;
118
- const maybeWithAbsoluteString = value;
119
- if (typeof maybeWithAbsoluteString.toAbsoluteString === "function") return toUtcTimeString(maybeWithAbsoluteString.toAbsoluteString(), granularity);
120
- const maybeWithToDate = value;
121
- if (typeof maybeWithToDate.toDate === "function") return toUtcTimeString(maybeWithToDate.toDate(timeZone).toISOString(), granularity);
122
- const maybeTime = value;
123
- if (typeof maybeTime.hour === "number" && typeof maybeTime.minute === "number") return toUtcTimeString(parseZonedDateTime(`1970-01-01T${pad(maybeTime.hour)}:${pad(maybeTime.minute)}:${pad(maybeTime.second ?? 0)}[${timeZone}]`).toAbsoluteString(), granularity);
124
- return null;
125
- };
126
- //#endregion
127
- //#region src/Time/Time.tsx
128
- const timeVariants = tv({ slots: {
129
- /** wrapper around the whole time input */
130
- base: "",
131
- /** helper wrapper for error/description */
132
- helperWrapper: ["p-0"],
133
- /** the segmented input element */
134
- input: "",
135
- /** inner wrapper around segments and optional content */
136
- innerWrapper: "",
137
- /** outer input wrapper */
138
- inputWrapper: "bg-content1 focus-within:border-focus",
139
- /** field label */
140
- label: "",
141
- /** individual segment */
142
- segment: ""
143
- } });
144
- /**
145
- * Time component based on [HeroUI TimeInput](https://v2.heroui.com/docs/components/time-input)
146
- */
147
- const Time = ({ className: _className = void 0, granularity = "minute", hideTimeZone = false, hourAsNumber = false, hourCycle = void 0, name, timeZone = void 0, valueType = "string", ...uniformFieldProps }) => {
148
- const { ariaLabel, disabled, errorMessage, field: { onBlur, onChange, value }, invalid, label, required, testId } = useUniformField({
149
- name,
150
- ...uniformFieldProps
151
- });
152
- const classNames = variantsToClassNames(timeVariants(), _className, "base");
153
- const resolvedTimeZone = resolveTimeFieldTimeZone(timeZone);
154
- const effectiveGranularity = hourAsNumber ? "hour" : granularity;
155
- const parsedValue = parseTimeValue(hourAsNumber && typeof value === "number" ? `${String(Math.max(0, Math.min(23, value))).padStart(2, "0")}:00Z` : value, timeZone);
156
- const placeholderValue = getTimeFieldPlaceholderValue(timeZone);
157
- const handleChange = (nextValue) => {
158
- if (nextValue == null) {
159
- onChange(null);
160
- return;
161
- }
162
- if (hourAsNumber) {
163
- const serializedValue = timeValueToString(nextValue, resolvedTimeZone, "hour");
164
- if (!serializedValue) {
165
- onChange(null);
166
- return;
167
- }
168
- const [hoursSegment] = serializedValue.split(":");
169
- const parsedHours = Number(hoursSegment);
170
- onChange(Number.isNaN(parsedHours) ? null : parsedHours);
171
- return;
172
- }
173
- if (valueType === "timeValue") {
174
- onChange(nextValue);
175
- return;
176
- }
177
- onChange(timeValueToString(nextValue, resolvedTimeZone, effectiveGranularity) ?? String(nextValue));
178
- };
179
- return /* @__PURE__ */ jsx(TimeInput, {
180
- "aria-label": label ? void 0 : ariaLabel,
181
- classNames: {
182
- base: classNames.base,
183
- helperWrapper: classNames.helperWrapper,
184
- innerWrapper: classNames.innerWrapper,
185
- input: classNames.input,
186
- inputWrapper: classNames.inputWrapper,
187
- label: classNames.label,
188
- segment: classNames.segment
189
- },
190
- "data-testid": testId,
191
- errorMessage,
192
- granularity: effectiveGranularity,
193
- hideTimeZone,
194
- hourCycle,
195
- id: testId,
196
- isDisabled: disabled,
197
- isInvalid: invalid,
198
- isRequired: required,
199
- label,
200
- labelPlacement: "outside",
201
- name,
202
- onBlur,
203
- onChange: handleChange,
204
- placeholderValue: placeholderValue ?? void 0,
205
- radius: "sm",
206
- value: parsedValue ?? void 0,
207
- variant: "bordered"
208
- });
209
- };
210
- //#endregion
211
- export { Time as t };
212
-
213
- //# sourceMappingURL=Time-CDptQ3CK.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Time-CDptQ3CK.js","names":["HeroTimeInput"],"sources":["../src/Time/timeHelpers.ts","../src/Time/Time.tsx"],"sourcesContent":["import type { TimeInput as HeroTimeInput } from '@heroui/date-input';\nimport type { ComponentProps } from 'react';\n\nimport {\n getLocalTimeZone,\n parseAbsolute,\n parseAbsoluteToLocal,\n parseDateTime,\n parseZonedDateTime,\n} from '@internationalized/date';\n\n/** Value type accepted by HeroUI TimeInput */\nexport type TimeValue = ComponentProps<typeof HeroTimeInput>['value'];\n\n/** Cast unknown input to the TimeInput value union type. */\nconst asTimeValue = (value: unknown): TimeValue => {\n return value as TimeValue;\n};\n\n/** Check whether a value already looks like an @internationalized/date value. */\nconst isTimeValueLike = (value: unknown): value is object => {\n if (!value || typeof value !== 'object') {\n return false;\n }\n\n return 'hour' in value || 'calendar' in value;\n};\n\n/** Check if the incoming string represents a plain time (e.g. 09:30 or 09:30:45). */\nconst isTimeOnlyString = (value: string): boolean => {\n return /^\\d{2}:\\d{2}(?::\\d{2}(?:\\.\\d{1,3})?)?$/.test(value);\n};\n\n/** Check if the incoming string is a UTC time-only value (e.g. 09:30Z). */\nconst isUtcTimeOnlyString = (value: string): boolean => {\n return /^\\d{2}:\\d{2}(?::\\d{2}(?:\\.\\d{1,3})?)?Z$/.test(value);\n};\n\n/** Zero-pad integer segments for time serialization. */\nconst pad = (value: number): string => {\n return String(value).padStart(2, '0');\n};\n\n/** Convert an absolute ISO string into UTC time-only store format. */\nconst toUtcTimeString = (\n absoluteIsoString: string,\n granularity: 'hour' | 'minute',\n): string | null => {\n const utcDate = new Date(absoluteIsoString);\n if (Number.isNaN(utcDate.getTime())) {\n return null;\n }\n\n const hour = pad(utcDate.getUTCHours());\n if (granularity === 'hour') {\n return `${hour}:00Z`;\n }\n\n return `${hour}:${pad(utcDate.getUTCMinutes())}Z`;\n};\n\n/** True when an input already carries timezone/offset information. */\nconst hasExplicitTimeZone = (value: string): boolean => {\n if (value.includes('[') && value.includes(']')) {\n return true;\n }\n\n return /(?:[zZ]|[+-]\\d{2}:\\d{2})$/.test(value);\n};\n\n/** True for date-time strings without timezone/offset. */\nconst isNaiveDateTimeString = (value: string): boolean => {\n return /^\\d{4}-\\d{2}-\\d{2}T/.test(value) && !hasExplicitTimeZone(value);\n};\n\n/** Safely run a parser and return `null` on parsing errors. */\nconst tryParse = (parser: () => unknown): TimeValue => {\n try {\n return asTimeValue(parser());\n } catch {\n return null;\n }\n};\n\n/**\n * Parse a form value into a HeroUI TimeInput compatible `TimeValue`.\n *\n * Supports existing `TimeValue` objects, native `Date` instances, plain time\n * strings (`HH:mm[:ss]`), absolute ISO date-time strings, zoned date-time\n * strings, and local date-time strings.\n *\n * Time-only strings are interpreted in the active timezone and normalized to a\n * `ZonedDateTime` (using a fixed reference date) so timezone abbreviations can\n * remain visible in the UI.\n */\nexport const parseTimeValue = (\n value: unknown,\n timeZone?: string,\n): TimeValue => {\n if (value == null || value === '') {\n return null;\n }\n\n if (isTimeValueLike(value)) {\n return asTimeValue(value);\n }\n\n if (value instanceof Date) {\n return asTimeValue(\n timeZone\n ? parseAbsolute(value.toISOString(), timeZone)\n : parseAbsoluteToLocal(value.toISOString()),\n );\n }\n\n if (typeof value !== 'string') {\n return null;\n }\n\n const normalizedValue = value.trim();\n if (normalizedValue === '') {\n return null;\n }\n\n if (isTimeOnlyString(normalizedValue)) {\n return tryParse(() => {\n const [hourValue, minuteValue, secondValue] = normalizedValue\n .split(':')\n .map(Number);\n const resolvedTimeZone = resolveTimeFieldTimeZone(timeZone);\n const hour = pad(hourValue);\n const minute = pad(minuteValue);\n const second = pad(secondValue ?? 0);\n\n return parseZonedDateTime(\n `1970-01-01T${hour}:${minute}:${second}[${resolvedTimeZone}]`,\n );\n });\n }\n\n if (isUtcTimeOnlyString(normalizedValue)) {\n return tryParse(() => {\n const resolvedTimeZone = resolveTimeFieldTimeZone(timeZone);\n return parseAbsolute(`1970-01-01T${normalizedValue}`, resolvedTimeZone);\n });\n }\n\n const parsers: (() => unknown)[] = [\n ...(timeZone && isNaiveDateTimeString(normalizedValue)\n ? [\n () => {\n return parseZonedDateTime(`${normalizedValue}[${timeZone}]`);\n },\n ]\n : []),\n () => {\n return timeZone\n ? parseAbsolute(normalizedValue, timeZone)\n : parseAbsoluteToLocal(normalizedValue);\n },\n () => {\n return parseZonedDateTime(normalizedValue);\n },\n () => {\n return parseDateTime(normalizedValue);\n },\n ];\n\n return (\n parsers\n .map((parser) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return tryParse(parser);\n })\n .find((parsedValue) => {\n return parsedValue != null;\n }) ?? null\n );\n};\n\n/** Resolve the timezone used for parsing and string conversion. */\nexport const resolveTimeFieldTimeZone = (timeZone?: string): string => {\n return timeZone ?? getLocalTimeZone();\n};\n\n/**\n * Build default placeholder value for TimeInput.\n *\n * Uses a fixed reference time to keep snapshots deterministic.\n */\nexport const getTimeFieldPlaceholderValue = (timeZone?: string): TimeValue => {\n const resolvedTimeZone = resolveTimeFieldTimeZone(timeZone);\n return asTimeValue(\n parseZonedDateTime(`1970-01-01T00:00:00[${resolvedTimeZone}]`),\n );\n};\n\n/**\n * Convert a TimeValue into a UTC time-only string for form state.\n *\n * The stored format is `HH:mmZ` (or `HH:00Z` when granularity is `hour`).\n */\nexport const timeValueToString = (\n value: TimeValue,\n timeZone: string,\n granularity: 'hour' | 'minute' = 'minute',\n): string | null => {\n if (value == null) {\n return null;\n }\n\n const maybeWithAbsoluteString = value as { toAbsoluteString?: () => string };\n if (typeof maybeWithAbsoluteString.toAbsoluteString === 'function') {\n return toUtcTimeString(\n maybeWithAbsoluteString.toAbsoluteString(),\n granularity,\n );\n }\n\n const maybeWithToDate = value as { toDate?: (zone: string) => Date };\n if (typeof maybeWithToDate.toDate === 'function') {\n return toUtcTimeString(\n maybeWithToDate.toDate(timeZone).toISOString(),\n granularity,\n );\n }\n\n const maybeTime = value as {\n hour?: number;\n minute?: number;\n second?: number;\n };\n if (\n typeof maybeTime.hour === 'number' &&\n typeof maybeTime.minute === 'number'\n ) {\n const hour = pad(maybeTime.hour);\n const minute = pad(maybeTime.minute);\n const second = pad(maybeTime.second ?? 0);\n return toUtcTimeString(\n parseZonedDateTime(\n `1970-01-01T${hour}:${minute}:${second}[${timeZone}]`,\n ).toAbsoluteString(),\n granularity,\n );\n }\n\n return null;\n};\n","import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { ReactNode } from 'react';\nimport type { TimeValue } from './timeHelpers';\n\nimport { TimeInput as HeroTimeInput } from '@heroui/date-input';\n\nimport { tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../hooks/useUniformField';\nimport {\n getTimeFieldPlaceholderValue,\n parseTimeValue,\n resolveTimeFieldTimeZone,\n timeValueToString,\n} from './timeHelpers';\n\nexport const timeVariants = tv({\n slots: {\n /** wrapper around the whole time input */\n base: '',\n /** helper wrapper for error/description */\n helperWrapper: [\n // set padding to 0 for error message exit animation\n 'p-0',\n ],\n /** the segmented input element */\n input: '',\n /** inner wrapper around segments and optional content */\n innerWrapper: '',\n /** outer input wrapper */\n inputWrapper: 'bg-content1 focus-within:border-focus',\n /** field label */\n label: '',\n /** individual segment */\n segment: '',\n },\n});\n\ntype VariantProps = TVProps<typeof timeVariants>;\ntype ClassName = TVClassName<typeof timeVariants>;\n\nexport interface TimeProps 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 /** input is disabled */\n disabled?: boolean;\n /** smallest visible unit in the segmented time input */\n granularity?: 'hour' | 'minute';\n /** hide timezone abbreviation for zoned values */\n hideTimeZone?: boolean;\n /** force hour granularity and store UTC hour as number (0-23) */\n hourAsNumber?: boolean;\n /** hour cycle formatting */\n hourCycle?: 12 | 24;\n /** form field label */\n label?: ReactNode;\n /** form field name */\n name: string;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /**\n * Optional timezone used for parsing date-time strings and serializing values.\n * When omitted, local timezone is used.\n */\n timeZone?: string;\n /** value format stored in form state (`string` stores UTC minute values, e.g. `10:15Z`) */\n valueType?: 'string' | 'timeValue';\n}\n\n/**\n * Time component based on [HeroUI TimeInput](https://v2.heroui.com/docs/components/time-input)\n */\nconst Time = ({\n className: _className = undefined,\n granularity = 'minute',\n hideTimeZone = false,\n hourAsNumber = false,\n hourCycle = undefined,\n name,\n timeZone = undefined,\n valueType = 'string',\n ...uniformFieldProps\n}: TimeProps) => {\n const {\n ariaLabel,\n disabled,\n errorMessage,\n field: { onBlur, onChange, value },\n invalid,\n label,\n required,\n testId,\n } = useUniformField({ name, ...uniformFieldProps });\n\n // classNames from slots\n const variants = timeVariants();\n const classNames = variantsToClassNames(variants, _className, 'base');\n const resolvedTimeZone = resolveTimeFieldTimeZone(timeZone);\n const effectiveGranularity = hourAsNumber ? 'hour' : granularity;\n\n // `hourAsNumber` stores 0-23; convert this into a parseable UTC time for display.\n const normalizedFieldValue =\n hourAsNumber && typeof value === 'number'\n ? `${String(Math.max(0, Math.min(23, value))).padStart(2, '0')}:00Z`\n : value;\n\n // Normalize incoming form value into HeroUI TimeInput value shape.\n const parsedValue = parseTimeValue(normalizedFieldValue, timeZone);\n const placeholderValue = getTimeFieldPlaceholderValue(timeZone);\n\n // Normalize TimeInput output into the configured storage format.\n const handleChange = (nextValue: TimeValue) => {\n if (nextValue == null) {\n onChange(null);\n return;\n }\n\n if (hourAsNumber) {\n const serializedValue = timeValueToString(\n nextValue,\n resolvedTimeZone,\n 'hour',\n );\n\n if (!serializedValue) {\n onChange(null);\n return;\n }\n\n const [hoursSegment] = serializedValue.split(':');\n const parsedHours = Number(hoursSegment);\n onChange(Number.isNaN(parsedHours) ? null : parsedHours);\n return;\n }\n\n if (valueType === 'timeValue') {\n onChange(nextValue);\n return;\n }\n\n onChange(\n timeValueToString(nextValue, resolvedTimeZone, effectiveGranularity) ??\n String(nextValue),\n );\n };\n\n return (\n <HeroTimeInput\n aria-label={label ? undefined : ariaLabel}\n classNames={{\n base: classNames.base,\n helperWrapper: classNames.helperWrapper,\n innerWrapper: classNames.innerWrapper,\n input: classNames.input,\n inputWrapper: classNames.inputWrapper,\n label: classNames.label,\n segment: classNames.segment,\n }}\n data-testid={testId}\n errorMessage={errorMessage}\n granularity={effectiveGranularity}\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n id={testId}\n isDisabled={disabled}\n isInvalid={invalid}\n isRequired={required}\n label={label}\n labelPlacement=\"outside\"\n name={name}\n onBlur={onBlur}\n onChange={handleChange}\n placeholderValue={placeholderValue ?? undefined}\n radius=\"sm\"\n value={parsedValue ?? undefined}\n variant=\"bordered\"\n />\n );\n};\n\nexport default Time;\n"],"mappings":";;;;;;;AAeA,MAAM,eAAe,UAA8B;CACjD,OAAO;AACT;;AAGA,MAAM,mBAAmB,UAAoC;CAC3D,IAAI,CAAC,SAAS,OAAO,UAAU,UAC7B,OAAO;CAGT,OAAO,UAAU,SAAS,cAAc;AAC1C;;AAGA,MAAM,oBAAoB,UAA2B;CACnD,OAAO,yCAAyC,KAAK,KAAK;AAC5D;;AAGA,MAAM,uBAAuB,UAA2B;CACtD,OAAO,0CAA0C,KAAK,KAAK;AAC7D;;AAGA,MAAM,OAAO,UAA0B;CACrC,OAAO,OAAO,KAAK,EAAE,SAAS,GAAG,GAAG;AACtC;;AAGA,MAAM,mBACJ,mBACA,gBACkB;CAClB,MAAM,UAAU,IAAI,KAAK,iBAAiB;CAC1C,IAAI,OAAO,MAAM,QAAQ,QAAQ,CAAC,GAChC,OAAO;CAGT,MAAM,OAAO,IAAI,QAAQ,YAAY,CAAC;CACtC,IAAI,gBAAgB,QAClB,OAAO,GAAG,K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EACtB;EACA,eAAa;EACC;EACd,aAAa;EACC;EACH;EACX,IAAI;EACJ,YAAY;EACZ,WAAW;EACX,YAAY;EACL;EACP,gBAAe;EACT;EACE;EACR,UAAU;EACV,kBAAkB,oBAAoB,KAAA;EACtC,QAAO;EACP,OAAO,eAAe,KAAA;EACtB,SAAQ;CACT,CAAA;AAEL"}
@@ -1,219 +0,0 @@
1
- require("./FormContext-DsmS_mkO.cjs");
2
- const require_hooks_useUniformField_index = require("./hooks/useUniformField/index.cjs");
3
- let _fuf_stack_pixel_utils = require("@fuf-stack/pixel-utils");
4
- let react_jsx_runtime = require("react/jsx-runtime");
5
- let _internationalized_date = require("@internationalized/date");
6
- let _heroui_date_input = require("@heroui/date-input");
7
- //#region src/Time/timeHelpers.ts
8
- /** Cast unknown input to the TimeInput value union type. */
9
- const asTimeValue = (value) => {
10
- return value;
11
- };
12
- /** Check whether a value already looks like an @internationalized/date value. */
13
- const isTimeValueLike = (value) => {
14
- if (!value || typeof value !== "object") return false;
15
- return "hour" in value || "calendar" in value;
16
- };
17
- /** Check if the incoming string represents a plain time (e.g. 09:30 or 09:30:45). */
18
- const isTimeOnlyString = (value) => {
19
- return /^\d{2}:\d{2}(?::\d{2}(?:\.\d{1,3})?)?$/.test(value);
20
- };
21
- /** Check if the incoming string is a UTC time-only value (e.g. 09:30Z). */
22
- const isUtcTimeOnlyString = (value) => {
23
- return /^\d{2}:\d{2}(?::\d{2}(?:\.\d{1,3})?)?Z$/.test(value);
24
- };
25
- /** Zero-pad integer segments for time serialization. */
26
- const pad = (value) => {
27
- return String(value).padStart(2, "0");
28
- };
29
- /** Convert an absolute ISO string into UTC time-only store format. */
30
- const toUtcTimeString = (absoluteIsoString, granularity) => {
31
- const utcDate = new Date(absoluteIsoString);
32
- if (Number.isNaN(utcDate.getTime())) return null;
33
- const hour = pad(utcDate.getUTCHours());
34
- if (granularity === "hour") return `${hour}:00Z`;
35
- return `${hour}:${pad(utcDate.getUTCMinutes())}Z`;
36
- };
37
- /** True when an input already carries timezone/offset information. */
38
- const hasExplicitTimeZone = (value) => {
39
- if (value.includes("[") && value.includes("]")) return true;
40
- return /(?:[zZ]|[+-]\d{2}:\d{2})$/.test(value);
41
- };
42
- /** True for date-time strings without timezone/offset. */
43
- const isNaiveDateTimeString = (value) => {
44
- return /^\d{4}-\d{2}-\d{2}T/.test(value) && !hasExplicitTimeZone(value);
45
- };
46
- /** Safely run a parser and return `null` on parsing errors. */
47
- const tryParse = (parser) => {
48
- try {
49
- return asTimeValue(parser());
50
- } catch {
51
- return null;
52
- }
53
- };
54
- /**
55
- * Parse a form value into a HeroUI TimeInput compatible `TimeValue`.
56
- *
57
- * Supports existing `TimeValue` objects, native `Date` instances, plain time
58
- * strings (`HH:mm[:ss]`), absolute ISO date-time strings, zoned date-time
59
- * strings, and local date-time strings.
60
- *
61
- * Time-only strings are interpreted in the active timezone and normalized to a
62
- * `ZonedDateTime` (using a fixed reference date) so timezone abbreviations can
63
- * remain visible in the UI.
64
- */
65
- const parseTimeValue = (value, timeZone) => {
66
- if (value == null || value === "") return null;
67
- if (isTimeValueLike(value)) return asTimeValue(value);
68
- if (value instanceof Date) return asTimeValue(timeZone ? (0, _internationalized_date.parseAbsolute)(value.toISOString(), timeZone) : (0, _internationalized_date.parseAbsoluteToLocal)(value.toISOString()));
69
- if (typeof value !== "string") return null;
70
- const normalizedValue = value.trim();
71
- if (normalizedValue === "") return null;
72
- if (isTimeOnlyString(normalizedValue)) return tryParse(() => {
73
- const [hourValue, minuteValue, secondValue] = normalizedValue.split(":").map(Number);
74
- const resolvedTimeZone = resolveTimeFieldTimeZone(timeZone);
75
- return (0, _internationalized_date.parseZonedDateTime)(`1970-01-01T${pad(hourValue)}:${pad(minuteValue)}:${pad(secondValue ?? 0)}[${resolvedTimeZone}]`);
76
- });
77
- if (isUtcTimeOnlyString(normalizedValue)) return tryParse(() => {
78
- const resolvedTimeZone = resolveTimeFieldTimeZone(timeZone);
79
- return (0, _internationalized_date.parseAbsolute)(`1970-01-01T${normalizedValue}`, resolvedTimeZone);
80
- });
81
- return [
82
- ...timeZone && isNaiveDateTimeString(normalizedValue) ? [() => {
83
- return (0, _internationalized_date.parseZonedDateTime)(`${normalizedValue}[${timeZone}]`);
84
- }] : [],
85
- () => {
86
- return timeZone ? (0, _internationalized_date.parseAbsolute)(normalizedValue, timeZone) : (0, _internationalized_date.parseAbsoluteToLocal)(normalizedValue);
87
- },
88
- () => {
89
- return (0, _internationalized_date.parseZonedDateTime)(normalizedValue);
90
- },
91
- () => {
92
- return (0, _internationalized_date.parseDateTime)(normalizedValue);
93
- }
94
- ].map((parser) => {
95
- return tryParse(parser);
96
- }).find((parsedValue) => {
97
- return parsedValue != null;
98
- }) ?? null;
99
- };
100
- /** Resolve the timezone used for parsing and string conversion. */
101
- const resolveTimeFieldTimeZone = (timeZone) => {
102
- return timeZone ?? (0, _internationalized_date.getLocalTimeZone)();
103
- };
104
- /**
105
- * Build default placeholder value for TimeInput.
106
- *
107
- * Uses a fixed reference time to keep snapshots deterministic.
108
- */
109
- const getTimeFieldPlaceholderValue = (timeZone) => {
110
- return asTimeValue((0, _internationalized_date.parseZonedDateTime)(`1970-01-01T00:00:00[${resolveTimeFieldTimeZone(timeZone)}]`));
111
- };
112
- /**
113
- * Convert a TimeValue into a UTC time-only string for form state.
114
- *
115
- * The stored format is `HH:mmZ` (or `HH:00Z` when granularity is `hour`).
116
- */
117
- const timeValueToString = (value, timeZone, granularity = "minute") => {
118
- if (value == null) return null;
119
- const maybeWithAbsoluteString = value;
120
- if (typeof maybeWithAbsoluteString.toAbsoluteString === "function") return toUtcTimeString(maybeWithAbsoluteString.toAbsoluteString(), granularity);
121
- const maybeWithToDate = value;
122
- if (typeof maybeWithToDate.toDate === "function") return toUtcTimeString(maybeWithToDate.toDate(timeZone).toISOString(), granularity);
123
- const maybeTime = value;
124
- if (typeof maybeTime.hour === "number" && typeof maybeTime.minute === "number") return toUtcTimeString((0, _internationalized_date.parseZonedDateTime)(`1970-01-01T${pad(maybeTime.hour)}:${pad(maybeTime.minute)}:${pad(maybeTime.second ?? 0)}[${timeZone}]`).toAbsoluteString(), granularity);
125
- return null;
126
- };
127
- //#endregion
128
- //#region src/Time/Time.tsx
129
- const timeVariants = (0, _fuf_stack_pixel_utils.tv)({ slots: {
130
- /** wrapper around the whole time input */
131
- base: "",
132
- /** helper wrapper for error/description */
133
- helperWrapper: ["p-0"],
134
- /** the segmented input element */
135
- input: "",
136
- /** inner wrapper around segments and optional content */
137
- innerWrapper: "",
138
- /** outer input wrapper */
139
- inputWrapper: "bg-content1 focus-within:border-focus",
140
- /** field label */
141
- label: "",
142
- /** individual segment */
143
- segment: ""
144
- } });
145
- /**
146
- * Time component based on [HeroUI TimeInput](https://v2.heroui.com/docs/components/time-input)
147
- */
148
- const Time = ({ className: _className = void 0, granularity = "minute", hideTimeZone = false, hourAsNumber = false, hourCycle = void 0, name, timeZone = void 0, valueType = "string", ...uniformFieldProps }) => {
149
- const { ariaLabel, disabled, errorMessage, field: { onBlur, onChange, value }, invalid, label, required, testId } = require_hooks_useUniformField_index.useUniformField({
150
- name,
151
- ...uniformFieldProps
152
- });
153
- const classNames = (0, _fuf_stack_pixel_utils.variantsToClassNames)(timeVariants(), _className, "base");
154
- const resolvedTimeZone = resolveTimeFieldTimeZone(timeZone);
155
- const effectiveGranularity = hourAsNumber ? "hour" : granularity;
156
- const parsedValue = parseTimeValue(hourAsNumber && typeof value === "number" ? `${String(Math.max(0, Math.min(23, value))).padStart(2, "0")}:00Z` : value, timeZone);
157
- const placeholderValue = getTimeFieldPlaceholderValue(timeZone);
158
- const handleChange = (nextValue) => {
159
- if (nextValue == null) {
160
- onChange(null);
161
- return;
162
- }
163
- if (hourAsNumber) {
164
- const serializedValue = timeValueToString(nextValue, resolvedTimeZone, "hour");
165
- if (!serializedValue) {
166
- onChange(null);
167
- return;
168
- }
169
- const [hoursSegment] = serializedValue.split(":");
170
- const parsedHours = Number(hoursSegment);
171
- onChange(Number.isNaN(parsedHours) ? null : parsedHours);
172
- return;
173
- }
174
- if (valueType === "timeValue") {
175
- onChange(nextValue);
176
- return;
177
- }
178
- onChange(timeValueToString(nextValue, resolvedTimeZone, effectiveGranularity) ?? String(nextValue));
179
- };
180
- return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_heroui_date_input.TimeInput, {
181
- "aria-label": label ? void 0 : ariaLabel,
182
- classNames: {
183
- base: classNames.base,
184
- helperWrapper: classNames.helperWrapper,
185
- innerWrapper: classNames.innerWrapper,
186
- input: classNames.input,
187
- inputWrapper: classNames.inputWrapper,
188
- label: classNames.label,
189
- segment: classNames.segment
190
- },
191
- "data-testid": testId,
192
- errorMessage,
193
- granularity: effectiveGranularity,
194
- hideTimeZone,
195
- hourCycle,
196
- id: testId,
197
- isDisabled: disabled,
198
- isInvalid: invalid,
199
- isRequired: required,
200
- label,
201
- labelPlacement: "outside",
202
- name,
203
- onBlur,
204
- onChange: handleChange,
205
- placeholderValue: placeholderValue ?? void 0,
206
- radius: "sm",
207
- value: parsedValue ?? void 0,
208
- variant: "bordered"
209
- });
210
- };
211
- //#endregion
212
- Object.defineProperty(exports, "Time", {
213
- enumerable: true,
214
- get: function() {
215
- return Time;
216
- }
217
- });
218
-
219
- //# sourceMappingURL=Time-WKgbji5k.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Time-WKgbji5k.cjs","names":["useUniformField","HeroTimeInput"],"sources":["../src/Time/timeHelpers.ts","../src/Time/Time.tsx"],"sourcesContent":["import type { TimeInput as HeroTimeInput } from '@heroui/date-input';\nimport type { ComponentProps } from 'react';\n\nimport {\n getLocalTimeZone,\n parseAbsolute,\n parseAbsoluteToLocal,\n parseDateTime,\n parseZonedDateTime,\n} from '@internationalized/date';\n\n/** Value type accepted by HeroUI TimeInput */\nexport type TimeValue = ComponentProps<typeof HeroTimeInput>['value'];\n\n/** Cast unknown input to the TimeInput value union type. */\nconst asTimeValue = (value: unknown): TimeValue => {\n return value as TimeValue;\n};\n\n/** Check whether a value already looks like an @internationalized/date value. */\nconst isTimeValueLike = (value: unknown): value is object => {\n if (!value || typeof value !== 'object') {\n return false;\n }\n\n return 'hour' in value || 'calendar' in value;\n};\n\n/** Check if the incoming string represents a plain time (e.g. 09:30 or 09:30:45). */\nconst isTimeOnlyString = (value: string): boolean => {\n return /^\\d{2}:\\d{2}(?::\\d{2}(?:\\.\\d{1,3})?)?$/.test(value);\n};\n\n/** Check if the incoming string is a UTC time-only value (e.g. 09:30Z). */\nconst isUtcTimeOnlyString = (value: string): boolean => {\n return /^\\d{2}:\\d{2}(?::\\d{2}(?:\\.\\d{1,3})?)?Z$/.test(value);\n};\n\n/** Zero-pad integer segments for time serialization. */\nconst pad = (value: number): string => {\n return String(value).padStart(2, '0');\n};\n\n/** Convert an absolute ISO string into UTC time-only store format. */\nconst toUtcTimeString = (\n absoluteIsoString: string,\n granularity: 'hour' | 'minute',\n): string | null => {\n const utcDate = new Date(absoluteIsoString);\n if (Number.isNaN(utcDate.getTime())) {\n return null;\n }\n\n const hour = pad(utcDate.getUTCHours());\n if (granularity === 'hour') {\n return `${hour}:00Z`;\n }\n\n return `${hour}:${pad(utcDate.getUTCMinutes())}Z`;\n};\n\n/** True when an input already carries timezone/offset information. */\nconst hasExplicitTimeZone = (value: string): boolean => {\n if (value.includes('[') && value.includes(']')) {\n return true;\n }\n\n return /(?:[zZ]|[+-]\\d{2}:\\d{2})$/.test(value);\n};\n\n/** True for date-time strings without timezone/offset. */\nconst isNaiveDateTimeString = (value: string): boolean => {\n return /^\\d{4}-\\d{2}-\\d{2}T/.test(value) && !hasExplicitTimeZone(value);\n};\n\n/** Safely run a parser and return `null` on parsing errors. */\nconst tryParse = (parser: () => unknown): TimeValue => {\n try {\n return asTimeValue(parser());\n } catch {\n return null;\n }\n};\n\n/**\n * Parse a form value into a HeroUI TimeInput compatible `TimeValue`.\n *\n * Supports existing `TimeValue` objects, native `Date` instances, plain time\n * strings (`HH:mm[:ss]`), absolute ISO date-time strings, zoned date-time\n * strings, and local date-time strings.\n *\n * Time-only strings are interpreted in the active timezone and normalized to a\n * `ZonedDateTime` (using a fixed reference date) so timezone abbreviations can\n * remain visible in the UI.\n */\nexport const parseTimeValue = (\n value: unknown,\n timeZone?: string,\n): TimeValue => {\n if (value == null || value === '') {\n return null;\n }\n\n if (isTimeValueLike(value)) {\n return asTimeValue(value);\n }\n\n if (value instanceof Date) {\n return asTimeValue(\n timeZone\n ? parseAbsolute(value.toISOString(), timeZone)\n : parseAbsoluteToLocal(value.toISOString()),\n );\n }\n\n if (typeof value !== 'string') {\n return null;\n }\n\n const normalizedValue = value.trim();\n if (normalizedValue === '') {\n return null;\n }\n\n if (isTimeOnlyString(normalizedValue)) {\n return tryParse(() => {\n const [hourValue, minuteValue, secondValue] = normalizedValue\n .split(':')\n .map(Number);\n const resolvedTimeZone = resolveTimeFieldTimeZone(timeZone);\n const hour = pad(hourValue);\n const minute = pad(minuteValue);\n const second = pad(secondValue ?? 0);\n\n return parseZonedDateTime(\n `1970-01-01T${hour}:${minute}:${second}[${resolvedTimeZone}]`,\n );\n });\n }\n\n if (isUtcTimeOnlyString(normalizedValue)) {\n return tryParse(() => {\n const resolvedTimeZone = resolveTimeFieldTimeZone(timeZone);\n return parseAbsolute(`1970-01-01T${normalizedValue}`, resolvedTimeZone);\n });\n }\n\n const parsers: (() => unknown)[] = [\n ...(timeZone && isNaiveDateTimeString(normalizedValue)\n ? [\n () => {\n return parseZonedDateTime(`${normalizedValue}[${timeZone}]`);\n },\n ]\n : []),\n () => {\n return timeZone\n ? parseAbsolute(normalizedValue, timeZone)\n : parseAbsoluteToLocal(normalizedValue);\n },\n () => {\n return parseZonedDateTime(normalizedValue);\n },\n () => {\n return parseDateTime(normalizedValue);\n },\n ];\n\n return (\n parsers\n .map((parser) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return\n return tryParse(parser);\n })\n .find((parsedValue) => {\n return parsedValue != null;\n }) ?? null\n );\n};\n\n/** Resolve the timezone used for parsing and string conversion. */\nexport const resolveTimeFieldTimeZone = (timeZone?: string): string => {\n return timeZone ?? getLocalTimeZone();\n};\n\n/**\n * Build default placeholder value for TimeInput.\n *\n * Uses a fixed reference time to keep snapshots deterministic.\n */\nexport const getTimeFieldPlaceholderValue = (timeZone?: string): TimeValue => {\n const resolvedTimeZone = resolveTimeFieldTimeZone(timeZone);\n return asTimeValue(\n parseZonedDateTime(`1970-01-01T00:00:00[${resolvedTimeZone}]`),\n );\n};\n\n/**\n * Convert a TimeValue into a UTC time-only string for form state.\n *\n * The stored format is `HH:mmZ` (or `HH:00Z` when granularity is `hour`).\n */\nexport const timeValueToString = (\n value: TimeValue,\n timeZone: string,\n granularity: 'hour' | 'minute' = 'minute',\n): string | null => {\n if (value == null) {\n return null;\n }\n\n const maybeWithAbsoluteString = value as { toAbsoluteString?: () => string };\n if (typeof maybeWithAbsoluteString.toAbsoluteString === 'function') {\n return toUtcTimeString(\n maybeWithAbsoluteString.toAbsoluteString(),\n granularity,\n );\n }\n\n const maybeWithToDate = value as { toDate?: (zone: string) => Date };\n if (typeof maybeWithToDate.toDate === 'function') {\n return toUtcTimeString(\n maybeWithToDate.toDate(timeZone).toISOString(),\n granularity,\n );\n }\n\n const maybeTime = value as {\n hour?: number;\n minute?: number;\n second?: number;\n };\n if (\n typeof maybeTime.hour === 'number' &&\n typeof maybeTime.minute === 'number'\n ) {\n const hour = pad(maybeTime.hour);\n const minute = pad(maybeTime.minute);\n const second = pad(maybeTime.second ?? 0);\n return toUtcTimeString(\n parseZonedDateTime(\n `1970-01-01T${hour}:${minute}:${second}[${timeZone}]`,\n ).toAbsoluteString(),\n granularity,\n );\n }\n\n return null;\n};\n","import type { TVClassName, TVProps } from '@fuf-stack/pixel-utils';\nimport type { ReactNode } from 'react';\nimport type { TimeValue } from './timeHelpers';\n\nimport { TimeInput as HeroTimeInput } from '@heroui/date-input';\n\nimport { tv, variantsToClassNames } from '@fuf-stack/pixel-utils';\n\nimport { useUniformField } from '../hooks/useUniformField';\nimport {\n getTimeFieldPlaceholderValue,\n parseTimeValue,\n resolveTimeFieldTimeZone,\n timeValueToString,\n} from './timeHelpers';\n\nexport const timeVariants = tv({\n slots: {\n /** wrapper around the whole time input */\n base: '',\n /** helper wrapper for error/description */\n helperWrapper: [\n // set padding to 0 for error message exit animation\n 'p-0',\n ],\n /** the segmented input element */\n input: '',\n /** inner wrapper around segments and optional content */\n innerWrapper: '',\n /** outer input wrapper */\n inputWrapper: 'bg-content1 focus-within:border-focus',\n /** field label */\n label: '',\n /** individual segment */\n segment: '',\n },\n});\n\ntype VariantProps = TVProps<typeof timeVariants>;\ntype ClassName = TVClassName<typeof timeVariants>;\n\nexport interface TimeProps 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 /** input is disabled */\n disabled?: boolean;\n /** smallest visible unit in the segmented time input */\n granularity?: 'hour' | 'minute';\n /** hide timezone abbreviation for zoned values */\n hideTimeZone?: boolean;\n /** force hour granularity and store UTC hour as number (0-23) */\n hourAsNumber?: boolean;\n /** hour cycle formatting */\n hourCycle?: 12 | 24;\n /** form field label */\n label?: ReactNode;\n /** form field name */\n name: string;\n /** HTML data-testid attribute used in e2e tests */\n testId?: string;\n /**\n * Optional timezone used for parsing date-time strings and serializing values.\n * When omitted, local timezone is used.\n */\n timeZone?: string;\n /** value format stored in form state (`string` stores UTC minute values, e.g. `10:15Z`) */\n valueType?: 'string' | 'timeValue';\n}\n\n/**\n * Time component based on [HeroUI TimeInput](https://v2.heroui.com/docs/components/time-input)\n */\nconst Time = ({\n className: _className = undefined,\n granularity = 'minute',\n hideTimeZone = false,\n hourAsNumber = false,\n hourCycle = undefined,\n name,\n timeZone = undefined,\n valueType = 'string',\n ...uniformFieldProps\n}: TimeProps) => {\n const {\n ariaLabel,\n disabled,\n errorMessage,\n field: { onBlur, onChange, value },\n invalid,\n label,\n required,\n testId,\n } = useUniformField({ name, ...uniformFieldProps });\n\n // classNames from slots\n const variants = timeVariants();\n const classNames = variantsToClassNames(variants, _className, 'base');\n const resolvedTimeZone = resolveTimeFieldTimeZone(timeZone);\n const effectiveGranularity = hourAsNumber ? 'hour' : granularity;\n\n // `hourAsNumber` stores 0-23; convert this into a parseable UTC time for display.\n const normalizedFieldValue =\n hourAsNumber && typeof value === 'number'\n ? `${String(Math.max(0, Math.min(23, value))).padStart(2, '0')}:00Z`\n : value;\n\n // Normalize incoming form value into HeroUI TimeInput value shape.\n const parsedValue = parseTimeValue(normalizedFieldValue, timeZone);\n const placeholderValue = getTimeFieldPlaceholderValue(timeZone);\n\n // Normalize TimeInput output into the configured storage format.\n const handleChange = (nextValue: TimeValue) => {\n if (nextValue == null) {\n onChange(null);\n return;\n }\n\n if (hourAsNumber) {\n const serializedValue = timeValueToString(\n nextValue,\n resolvedTimeZone,\n 'hour',\n );\n\n if (!serializedValue) {\n onChange(null);\n return;\n }\n\n const [hoursSegment] = serializedValue.split(':');\n const parsedHours = Number(hoursSegment);\n onChange(Number.isNaN(parsedHours) ? null : parsedHours);\n return;\n }\n\n if (valueType === 'timeValue') {\n onChange(nextValue);\n return;\n }\n\n onChange(\n timeValueToString(nextValue, resolvedTimeZone, effectiveGranularity) ??\n String(nextValue),\n );\n };\n\n return (\n <HeroTimeInput\n aria-label={label ? undefined : ariaLabel}\n classNames={{\n base: classNames.base,\n helperWrapper: classNames.helperWrapper,\n innerWrapper: classNames.innerWrapper,\n input: classNames.input,\n inputWrapper: classNames.inputWrapper,\n label: classNames.label,\n segment: classNames.segment,\n }}\n data-testid={testId}\n errorMessage={errorMessage}\n granularity={effectiveGranularity}\n hideTimeZone={hideTimeZone}\n hourCycle={hourCycle}\n id={testId}\n isDisabled={disabled}\n isInvalid={invalid}\n isRequired={required}\n label={label}\n labelPlacement=\"outside\"\n name={name}\n onBlur={onBlur}\n onChange={handleChange}\n placeholderValue={placeholderValue ?? undefined}\n radius=\"sm\"\n value={parsedValue ?? undefined}\n variant=\"bordered\"\n />\n );\n};\n\nex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U,WAC7B,GAAG,OAAO,KAAK,IAAI,GAAG,KAAK,IAAI,IAAI,KAAK,CAAC,CAAC,EAAE,SAAS,GAAG,GAAG,EAAE,QAC7D,OAGmD,QAAQ;CACjE,MAAM,mBAAmB,6BAA6B,QAAQ;CAG9D,MAAM,gBAAgB,cAAyB;EAC7C,IAAI,aAAa,MAAM;GACrB,SAAS,IAAI;GACb;EACF;EAEA,IAAI,cAAc;GAChB,MAAM,kBAAkB,kBACtB,WACA,kBACA,MACF;GAEA,IAAI,CAAC,iBAAiB;IACpB,SAAS,IAAI;IACb;GACF;GAEA,MAAM,CAAC,gBAAgB,gBAAgB,MAAM,GAAG;GAChD,MAAM,cAAc,OAAO,YAAY;GACvC,SAAS,OAAO,MAAM,WAAW,IAAI,OAAO,WAAW;GACvD;EACF;EAEA,IAAI,cAAc,aAAa;GAC7B,SAAS,SAAS;GAClB;EACF;EAEA,SACE,kBAAkB,WAAW,kBAAkB,oBAAoB,KACjE,OAAO,SAAS,CACpB;CACF;CAEA,OACE,iBAAA,GAAA,kBAAA,KAACC,mBAAAA,WAAD;EACE,cAAY,QAAQ,KAAA,IAAY;EAChC,YAAY;GACV,MAAM,WAAW;GACjB,eAAe,WAAW;GAC1B,cAAc,WAAW;GACzB,OAAO,WAAW;GAClB,cAAc,WAAW;GACzB,OAAO,WAAW;GAClB,SAAS,WAAW;EACtB;EACA,eAAa;EACC;EACd,aAAa;EACC;EACH;EACX,IAAI;EACJ,YAAY;EACZ,WAAW;EACX,YAAY;EACL;EACP,gBAAe;EACT;EACE;EACR,UAAU;EACV,kBAAkB,oBAAoB,KAAA;EACtC,QAAO;EACP,OAAO,eAAe,KAAA;EACtB,SAAQ;CACT,CAAA;AAEL"}
@@ -1,43 +0,0 @@
1
- import { t as DebugModeSettings } from "./FormContext-i66vM5f1.js";
2
- import { ReactNode } from "react";
3
- import { FieldValues, SubmitHandler } from "react-hook-form";
4
- import { VetoInstance } from "@fuf-stack/veto";
5
-
6
- //#region src/Form/Form.d.ts
7
- interface FormProps {
8
- /** form children */
9
- children: ReactNode | ReactNode[];
10
- /** CSS class name */
11
- className?: string | string[];
12
- /** settings for from debug mode */
13
- debug?: DebugModeSettings;
14
- /** initial form values */
15
- initialValues?: FieldValues;
16
- /** name of the form */
17
- name?: string;
18
- /** form submit handler */
19
- onSubmit: SubmitHandler<FieldValues>;
20
- /** HTML data-testid attribute used in e2e tests */
21
- testId?: string;
22
- /** veto validation schema */
23
- validation?: VetoInstance;
24
- /** when the validation should be triggered */
25
- validationTrigger?: 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all';
26
- }
27
- /**
28
- * Form component that has to wrap every uniform
29
- */
30
- declare const Form: ({
31
- children,
32
- className,
33
- debug,
34
- initialValues,
35
- name,
36
- onSubmit,
37
- testId,
38
- validation,
39
- validationTrigger
40
- }: FormProps) => import("react/jsx-runtime").JSX.Element;
41
- //#endregion
42
- export { FormProps as n, Form as t };
43
- //# sourceMappingURL=index-54OZEaUU.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index-54OZEaUU.d.ts","names":[],"sources":["../src/Form/Form.tsx"],"mappings":";;;;;;UAYiB,SAAA;;EAEf,QAAA,EAAU,SAAA,GAAY,SAAA;EAFE;EAIxB,SAAA;EAFU;EAIV,KAAA,GAAQ,iBAAA;EAAA;EAER,aAAA,GAAgB,WAAA;EAIQ;EAFxB,IAAA;EAMa;EAJb,QAAA,EAAU,aAAA,CAAc,WAAA;EAIC;EAFzB,MAAA;EAZU;EAcV,UAAA,GAAa,YAAA;EAZb;EAcA,iBAAA;AAAA;;;;cAMI,IAAA;EAAQ,QAAA;EAAA,SAAA;EAAA,KAAA;EAAA,aAAA;EAAA,IAAA;EAAA,QAAA;EAAA,MAAA;EAAA,UAAA;EAAA;AAAA,GAUX,SAAA,iCAAS,GAAA,CAAA,OAAA"}