@techzyapp/ui-library 1.0.42 → 1.0.44

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 (652) hide show
  1. package/README.md +15 -14
  2. package/dist/{Accordion-B4vdZXIu.cjs → Accordion-CFyeLfPT.cjs} +2 -2
  3. package/dist/{Accordion-B4vdZXIu.cjs.map → Accordion-CFyeLfPT.cjs.map} +1 -1
  4. package/dist/{Accordion-DhFZ25KV.js → Accordion-DOrTQJB9.js} +2 -2
  5. package/dist/{Accordion-DhFZ25KV.js.map → Accordion-DOrTQJB9.js.map} +1 -1
  6. package/dist/AdminRoot-9KE3ll-D.js +101 -0
  7. package/dist/AdminRoot-9KE3ll-D.js.map +1 -0
  8. package/dist/AdminRoot-BMzHo0n7.cjs +2 -0
  9. package/dist/AdminRoot-BMzHo0n7.cjs.map +1 -0
  10. package/dist/Alert-BFfzpPNd.js +70 -0
  11. package/dist/{Alert-D6oBxBdP.js.map → Alert-BFfzpPNd.js.map} +1 -1
  12. package/dist/Alert-DS8TzpIS.cjs +2 -0
  13. package/dist/{Alert-C8BBxL_7.cjs.map → Alert-DS8TzpIS.cjs.map} +1 -1
  14. package/dist/{AuthLayout-q8pbCGdt.js → AuthLayout-BI1wLuDl.js} +2 -2
  15. package/dist/{AuthLayout-q8pbCGdt.js.map → AuthLayout-BI1wLuDl.js.map} +1 -1
  16. package/dist/{AuthLayout-exuNQicH.cjs → AuthLayout-Bzlsvicf.cjs} +2 -2
  17. package/dist/{AuthLayout-exuNQicH.cjs.map → AuthLayout-Bzlsvicf.cjs.map} +1 -1
  18. package/dist/{Avatar-l48Ice6t.cjs → Avatar-BBqX1732.cjs} +2 -2
  19. package/dist/{Avatar-l48Ice6t.cjs.map → Avatar-BBqX1732.cjs.map} +1 -1
  20. package/dist/{Avatar-ClcmN0ba.js → Avatar-CaYyv5wk.js} +2 -2
  21. package/dist/{Avatar-ClcmN0ba.js.map → Avatar-CaYyv5wk.js.map} +1 -1
  22. package/dist/{AvatarGroup-l-KV3wdl.js → AvatarGroup-6fhm-van.js} +2 -2
  23. package/dist/{AvatarGroup-l-KV3wdl.js.map → AvatarGroup-6fhm-van.js.map} +1 -1
  24. package/dist/{AvatarGroup-CuvFX4di.cjs → AvatarGroup-DrkzAt1-.cjs} +2 -2
  25. package/dist/{AvatarGroup-CuvFX4di.cjs.map → AvatarGroup-DrkzAt1-.cjs.map} +1 -1
  26. package/dist/Breadcrumbs-CloqFpp1.js +34 -0
  27. package/dist/{Breadcrumbs-cXET6OM5.js.map → Breadcrumbs-CloqFpp1.js.map} +1 -1
  28. package/dist/Breadcrumbs-N2-sZWW5.cjs +2 -0
  29. package/dist/{Breadcrumbs-B-olYVdw.cjs.map → Breadcrumbs-N2-sZWW5.cjs.map} +1 -1
  30. package/dist/Button-5LQtDA9d.js +72 -0
  31. package/dist/{Button-0ZgdNjX-.js.map → Button-5LQtDA9d.js.map} +1 -1
  32. package/dist/Button-Bxztlybi.cjs +2 -0
  33. package/dist/{Button-CwrDiZek.cjs.map → Button-Bxztlybi.cjs.map} +1 -1
  34. package/dist/{Calendar-CxzdnzdK.js → Calendar-BIKo_aus.js} +5 -5
  35. package/dist/{Calendar-CxzdnzdK.js.map → Calendar-BIKo_aus.js.map} +1 -1
  36. package/dist/{Calendar-d3CX5UJp.cjs → Calendar-CsBgaKZ-.cjs} +2 -2
  37. package/dist/{Calendar-d3CX5UJp.cjs.map → Calendar-CsBgaKZ-.cjs.map} +1 -1
  38. package/dist/{Card-CxnUoWsi.cjs → Card-Csn3FaMl.cjs} +2 -2
  39. package/dist/{Card-CxnUoWsi.cjs.map → Card-Csn3FaMl.cjs.map} +1 -1
  40. package/dist/{Card-CjqStov5.js → Card-DMwQ7rMk.js} +4 -4
  41. package/dist/{Card-CjqStov5.js.map → Card-DMwQ7rMk.js.map} +1 -1
  42. package/dist/Chip-BdCZ44I8.cjs +2 -0
  43. package/dist/{Chip-BkU3yx6G.cjs.map → Chip-BdCZ44I8.cjs.map} +1 -1
  44. package/dist/Chip-C7IkFuM1.js +92 -0
  45. package/dist/{Chip-CzJjbaKx.js.map → Chip-C7IkFuM1.js.map} +1 -1
  46. package/dist/ChoiceCardGroup-Cj_YFj6C.cjs +2 -0
  47. package/dist/{ChoiceCardGroup-C7Eengyd.cjs.map → ChoiceCardGroup-Cj_YFj6C.cjs.map} +1 -1
  48. package/dist/ChoiceCardGroup-D37XREKV.js +180 -0
  49. package/dist/{ChoiceCardGroup-q0yN-TeQ.js.map → ChoiceCardGroup-D37XREKV.js.map} +1 -1
  50. package/dist/CodeBlock-BnXxxqAW.cjs +2 -0
  51. package/dist/{CodeBlock-DRBQ_S5t.cjs.map → CodeBlock-BnXxxqAW.cjs.map} +1 -1
  52. package/dist/CodeBlock-C10JN6DR.js +96 -0
  53. package/dist/{CodeBlock-BHcvQrs9.js.map → CodeBlock-C10JN6DR.js.map} +1 -1
  54. package/dist/{ColorPicker-BzCEMN7B.cjs → ColorPicker-CVddGc-n.cjs} +2 -2
  55. package/dist/{ColorPicker-BzCEMN7B.cjs.map → ColorPicker-CVddGc-n.cjs.map} +1 -1
  56. package/dist/{ColorPicker-BQKFdTNr.js → ColorPicker-z8_-77LO.js} +3 -3
  57. package/dist/{ColorPicker-BQKFdTNr.js.map → ColorPicker-z8_-77LO.js.map} +1 -1
  58. package/dist/{ColorPickerPanel-kl2jUix-.cjs → ColorPickerPanel-DJY6-EqO.cjs} +2 -2
  59. package/dist/{ColorPickerPanel-kl2jUix-.cjs.map → ColorPickerPanel-DJY6-EqO.cjs.map} +1 -1
  60. package/dist/{ColorPickerPanel-DKTKC9KH.js → ColorPickerPanel-y4A2LLLf.js} +3 -3
  61. package/dist/{ColorPickerPanel-DKTKC9KH.js.map → ColorPickerPanel-y4A2LLLf.js.map} +1 -1
  62. package/dist/{ColorRamp-n7muILK3.cjs → ColorRamp-DvRsdOWy.cjs} +2 -2
  63. package/dist/{ColorRamp-n7muILK3.cjs.map → ColorRamp-DvRsdOWy.cjs.map} +1 -1
  64. package/dist/{ColorRamp-yfMyJCyx.js → ColorRamp-Dvit8yoP.js} +2 -2
  65. package/dist/{ColorRamp-yfMyJCyx.js.map → ColorRamp-Dvit8yoP.js.map} +1 -1
  66. package/dist/{ConfigProvider-D61cpCz-.js → ConfigProvider-CYgmMH4j.js} +133 -126
  67. package/dist/ConfigProvider-CYgmMH4j.js.map +1 -0
  68. package/dist/ConfigProvider-Cf-awvZs.cjs +2 -0
  69. package/dist/ConfigProvider-Cf-awvZs.cjs.map +1 -0
  70. package/dist/{CopyButton-DlSi82gv.cjs → CopyButton-BOp7waEt.cjs} +2 -2
  71. package/dist/{CopyButton-DlSi82gv.cjs.map → CopyButton-BOp7waEt.cjs.map} +1 -1
  72. package/dist/{CopyButton-ecxn-ghi.js → CopyButton-_iMBE4q_.js} +4 -4
  73. package/dist/{CopyButton-ecxn-ghi.js.map → CopyButton-_iMBE4q_.js.map} +1 -1
  74. package/dist/DashedButton-BX8hfY1x.cjs +2 -0
  75. package/dist/{DashedButton-Dw7xHgIp.cjs.map → DashedButton-BX8hfY1x.cjs.map} +1 -1
  76. package/dist/DashedButton-wcmXTYBw.js +58 -0
  77. package/dist/{DashedButton-csz6Jt_K.js.map → DashedButton-wcmXTYBw.js.map} +1 -1
  78. package/dist/{DatePicker-BjZ_P21i.cjs → DatePicker-UQwpH-rw.cjs} +2 -2
  79. package/dist/{DatePicker-BjZ_P21i.cjs.map → DatePicker-UQwpH-rw.cjs.map} +1 -1
  80. package/dist/{DatePicker-CAGpJbDi.js → DatePicker-X5hZVSW6.js} +6 -6
  81. package/dist/{DatePicker-CAGpJbDi.js.map → DatePicker-X5hZVSW6.js.map} +1 -1
  82. package/dist/DatePicker.module-BaQyKOUM.cjs +2 -0
  83. package/dist/{DatePicker.module-BDtTsg8M.cjs.map → DatePicker.module-BaQyKOUM.cjs.map} +1 -1
  84. package/dist/DatePicker.module-DoywSvLu.js +138 -0
  85. package/dist/{DatePicker.module-CMMQyEhG.js.map → DatePicker.module-DoywSvLu.js.map} +1 -1
  86. package/dist/{DateTimePicker-BJmF0Su6.js → DateTimePicker-Ch1kUHEb.js} +9 -9
  87. package/dist/{DateTimePicker-BJmF0Su6.js.map → DateTimePicker-Ch1kUHEb.js.map} +1 -1
  88. package/dist/{DateTimePicker-DZqWQeUL.cjs → DateTimePicker-ClTZGMON.cjs} +2 -2
  89. package/dist/{DateTimePicker-DZqWQeUL.cjs.map → DateTimePicker-ClTZGMON.cjs.map} +1 -1
  90. package/dist/{DescriptionList-Knq5eCiY.js → DescriptionList-Cque-iYk.js} +69 -69
  91. package/dist/{DescriptionList-Knq5eCiY.js.map → DescriptionList-Cque-iYk.js.map} +1 -1
  92. package/dist/DescriptionList-IVAvgpEL.cjs +2 -0
  93. package/dist/{DescriptionList-CvPDn-kh.cjs.map → DescriptionList-IVAvgpEL.cjs.map} +1 -1
  94. package/dist/Dropdown-C_y9_dVn.cjs +2 -0
  95. package/dist/Dropdown-C_y9_dVn.cjs.map +1 -0
  96. package/dist/Dropdown-D-D_Z1Jo.js +154 -0
  97. package/dist/Dropdown-D-D_Z1Jo.js.map +1 -0
  98. package/dist/{EmptyState-CX1g47y_.cjs → EmptyState-C84B-E8a.cjs} +2 -2
  99. package/dist/{EmptyState-CX1g47y_.cjs.map → EmptyState-C84B-E8a.cjs.map} +1 -1
  100. package/dist/{EmptyState-Dqtpmtje.js → EmptyState-Yts_p-jZ.js} +3 -3
  101. package/dist/{EmptyState-Dqtpmtje.js.map → EmptyState-Yts_p-jZ.js.map} +1 -1
  102. package/dist/{ErrorBoundary-Dos7VLb-.js → ErrorBoundary-BgMOPle0.js} +3 -3
  103. package/dist/{ErrorBoundary-Dos7VLb-.js.map → ErrorBoundary-BgMOPle0.js.map} +1 -1
  104. package/dist/{ErrorBoundary-B8KwWXXp.cjs → ErrorBoundary-DtYswKp3.cjs} +2 -2
  105. package/dist/{ErrorBoundary-B8KwWXXp.cjs.map → ErrorBoundary-DtYswKp3.cjs.map} +1 -1
  106. package/dist/{ErrorState-CwCqd2PU.cjs → ErrorState-Aa8LVjkl.cjs} +2 -2
  107. package/dist/{ErrorState-CwCqd2PU.cjs.map → ErrorState-Aa8LVjkl.cjs.map} +1 -1
  108. package/dist/{ErrorState-KhzrGIJ-.js → ErrorState-BE9Rcmht.js} +8 -8
  109. package/dist/{ErrorState-KhzrGIJ-.js.map → ErrorState-BE9Rcmht.js.map} +1 -1
  110. package/dist/FileCard-Chfx0QdF.cjs +2 -0
  111. package/dist/{FileCard-DEc10T2G.cjs.map → FileCard-Chfx0QdF.cjs.map} +1 -1
  112. package/dist/{FileCard-SSuFS13E.js → FileCard-m3i_8yKR.js} +33 -33
  113. package/dist/{FileCard-SSuFS13E.js.map → FileCard-m3i_8yKR.js.map} +1 -1
  114. package/dist/FileUploader-B27Y4rak.js +706 -0
  115. package/dist/FileUploader-B27Y4rak.js.map +1 -0
  116. package/dist/FileUploader-DkvFO0N_.cjs +2 -0
  117. package/dist/FileUploader-DkvFO0N_.cjs.map +1 -0
  118. package/dist/{Flag-B1ZvZVXi.cjs → Flag-BvZB3295.cjs} +2 -2
  119. package/dist/{Flag-B1ZvZVXi.cjs.map → Flag-BvZB3295.cjs.map} +1 -1
  120. package/dist/{Flag-BEIqYQZg.js → Flag-C1HwnZXJ.js} +2 -2
  121. package/dist/{Flag-BEIqYQZg.js.map → Flag-C1HwnZXJ.js.map} +1 -1
  122. package/dist/{FullscreenToggle-I_In47BB.js → FullscreenToggle-B4ynXdCP.js} +4 -4
  123. package/dist/{FullscreenToggle-I_In47BB.js.map → FullscreenToggle-B4ynXdCP.js.map} +1 -1
  124. package/dist/{FullscreenToggle-Po769CoC.cjs → FullscreenToggle-CEFZQ5OC.cjs} +2 -2
  125. package/dist/{FullscreenToggle-Po769CoC.cjs.map → FullscreenToggle-CEFZQ5OC.cjs.map} +1 -1
  126. package/dist/Icon-B7DJn8Tw.js +5418 -0
  127. package/dist/Icon-B7DJn8Tw.js.map +1 -0
  128. package/dist/Icon-CBg21lKA.cjs +2 -0
  129. package/dist/Icon-CBg21lKA.cjs.map +1 -0
  130. package/dist/IconButton-EaExCXRq.js +68 -0
  131. package/dist/{IconButton-D9MCwRK_.js.map → IconButton-EaExCXRq.js.map} +1 -1
  132. package/dist/IconButton-wW1o4HHw.cjs +2 -0
  133. package/dist/{IconButton-CxSXEYce.cjs.map → IconButton-wW1o4HHw.cjs.map} +1 -1
  134. package/dist/ImageEditor-DTFQZ6ON.js +2709 -0
  135. package/dist/ImageEditor-DTFQZ6ON.js.map +1 -0
  136. package/dist/ImageEditor-D_HKfDbx.cjs +60 -0
  137. package/dist/ImageEditor-D_HKfDbx.cjs.map +1 -0
  138. package/dist/Link-BZjolIAF.js +48 -0
  139. package/dist/{Link-BQlvsu9V.js.map → Link-BZjolIAF.js.map} +1 -1
  140. package/dist/Link-CtttVM6w.cjs +2 -0
  141. package/dist/{Link-GZT51mKx.cjs.map → Link-CtttVM6w.cjs.map} +1 -1
  142. package/dist/{List-CKoNx21F.cjs → List-CLUXeaXS.cjs} +2 -2
  143. package/dist/{List-CKoNx21F.cjs.map → List-CLUXeaXS.cjs.map} +1 -1
  144. package/dist/{List-2Y3ktTcF.js → List-DS91CZUt.js} +2 -2
  145. package/dist/{List-2Y3ktTcF.js.map → List-DS91CZUt.js.map} +1 -1
  146. package/dist/ListItem-CguNjf-u.cjs +2 -0
  147. package/dist/{ListItem-DkCYXucd.cjs.map → ListItem-CguNjf-u.cjs.map} +1 -1
  148. package/dist/ListItem-Ezmdk7q-.js +76 -0
  149. package/dist/{ListItem-2Lr5_NRY.js.map → ListItem-Ezmdk7q-.js.map} +1 -1
  150. package/dist/{Loader-5zp2MPm5.cjs → Loader-DNR2_YHm.cjs} +2 -2
  151. package/dist/{Loader-5zp2MPm5.cjs.map → Loader-DNR2_YHm.cjs.map} +1 -1
  152. package/dist/{Loader-Bluu6z0-.js → Loader-D_Foo6Hj.js} +2 -2
  153. package/dist/{Loader-Bluu6z0-.js.map → Loader-D_Foo6Hj.js.map} +1 -1
  154. package/dist/{LocationPicker-CGHXTIml.cjs → LocationPicker-CdO37PKg.cjs} +2 -2
  155. package/dist/{LocationPicker-CGHXTIml.cjs.map → LocationPicker-CdO37PKg.cjs.map} +1 -1
  156. package/dist/{LocationPicker-hULpHBVG.js → LocationPicker-DGbnbTW9.js} +8 -8
  157. package/dist/{LocationPicker-hULpHBVG.js.map → LocationPicker-DGbnbTW9.js.map} +1 -1
  158. package/dist/Modal-1rIBMvKH.js +154 -0
  159. package/dist/Modal-1rIBMvKH.js.map +1 -0
  160. package/dist/Modal-Du-uVpYw.cjs +2 -0
  161. package/dist/Modal-Du-uVpYw.cjs.map +1 -0
  162. package/dist/MultiSelect-BoqunsM9.js +219 -0
  163. package/dist/{MultiSelect-CHLMpim4.js.map → MultiSelect-BoqunsM9.js.map} +1 -1
  164. package/dist/MultiSelect-lAAaD0uL.cjs +2 -0
  165. package/dist/{MultiSelect-BdPvjiTj.cjs.map → MultiSelect-lAAaD0uL.cjs.map} +1 -1
  166. package/dist/{NumberField-C-FZ-uRI.cjs → NumberField-CyUA6eob.cjs} +2 -2
  167. package/dist/{NumberField-C-FZ-uRI.cjs.map → NumberField-CyUA6eob.cjs.map} +1 -1
  168. package/dist/{NumberField-BlpFmetF.js → NumberField-DHFGNQjZ.js} +4 -4
  169. package/dist/{NumberField-BlpFmetF.js.map → NumberField-DHFGNQjZ.js.map} +1 -1
  170. package/dist/OtpField-CIy5OtXI.cjs +2 -0
  171. package/dist/{OtpField-Drjy2wwq.cjs.map → OtpField-CIy5OtXI.cjs.map} +1 -1
  172. package/dist/{OtpField-D4-r7I0A.js → OtpField-pL9nj4AW.js} +61 -61
  173. package/dist/{OtpField-D4-r7I0A.js.map → OtpField-pL9nj4AW.js.map} +1 -1
  174. package/dist/Overlay-CywFQfjm.cjs +2 -0
  175. package/dist/Overlay-CywFQfjm.cjs.map +1 -0
  176. package/dist/Overlay-DiL0ZARH.js +60 -0
  177. package/dist/Overlay-DiL0ZARH.js.map +1 -0
  178. package/dist/{PageError-DyDj1wQZ.js → PageError-C5SO0mVJ.js} +5 -5
  179. package/dist/{PageError-DyDj1wQZ.js.map → PageError-C5SO0mVJ.js.map} +1 -1
  180. package/dist/{PageError-DXUOkE14.cjs → PageError-DbokLmOY.cjs} +2 -2
  181. package/dist/{PageError-DXUOkE14.cjs.map → PageError-DbokLmOY.cjs.map} +1 -1
  182. package/dist/{PageLayout-CoG0AaUs.cjs → PageLayout-B7ZDiNq8.cjs} +2 -2
  183. package/dist/{PageLayout-CoG0AaUs.cjs.map → PageLayout-B7ZDiNq8.cjs.map} +1 -1
  184. package/dist/{PageLayout-nsJa8CbT.js → PageLayout-Du-D6Pd4.js} +5 -5
  185. package/dist/{PageLayout-nsJa8CbT.js.map → PageLayout-Du-D6Pd4.js.map} +1 -1
  186. package/dist/{PageNotFound-BNNwMkwE.js → PageNotFound-DSkoMfed.js} +5 -5
  187. package/dist/{PageNotFound-BNNwMkwE.js.map → PageNotFound-DSkoMfed.js.map} +1 -1
  188. package/dist/{PageNotFound-CGSxT_n9.cjs → PageNotFound-DfNwdtgJ.cjs} +2 -2
  189. package/dist/{PageNotFound-CGSxT_n9.cjs.map → PageNotFound-DfNwdtgJ.cjs.map} +1 -1
  190. package/dist/Pagination-BH8ACaAC.js +139 -0
  191. package/dist/{Pagination-tuWRnGwR.js.map → Pagination-BH8ACaAC.js.map} +1 -1
  192. package/dist/Pagination-DO2Os4an.cjs +2 -0
  193. package/dist/{Pagination-CZtewveA.cjs.map → Pagination-DO2Os4an.cjs.map} +1 -1
  194. package/dist/{PaletteField-CTPl3D43.js → PaletteField-BFb0PQ-S.js} +3 -3
  195. package/dist/{PaletteField-CTPl3D43.js.map → PaletteField-BFb0PQ-S.js.map} +1 -1
  196. package/dist/{PaletteField-PDcu2vUp.cjs → PaletteField-BfvcJvGM.cjs} +2 -2
  197. package/dist/{PaletteField-PDcu2vUp.cjs.map → PaletteField-BfvcJvGM.cjs.map} +1 -1
  198. package/dist/PhoneField-C-wOm7g5.cjs +2 -0
  199. package/dist/{PhoneField-BPYg5ZHW.cjs.map → PhoneField-C-wOm7g5.cjs.map} +1 -1
  200. package/dist/{PhoneField-pdWDCszb.js → PhoneField-DFhGWgbK.js} +106 -106
  201. package/dist/{PhoneField-pdWDCszb.js.map → PhoneField-DFhGWgbK.js.map} +1 -1
  202. package/dist/{Popconfirm-cNpJmkuR.cjs → Popconfirm-_53vtMI0.cjs} +2 -2
  203. package/dist/{Popconfirm-cNpJmkuR.cjs.map → Popconfirm-_53vtMI0.cjs.map} +1 -1
  204. package/dist/{Popconfirm-CMVzLaC_.js → Popconfirm-o5da44ra.js} +4 -4
  205. package/dist/{Popconfirm-CMVzLaC_.js.map → Popconfirm-o5da44ra.js.map} +1 -1
  206. package/dist/{Progress-x12Rkh06.cjs → Progress-BSinoQ8t.cjs} +2 -2
  207. package/dist/{Progress-x12Rkh06.cjs.map → Progress-BSinoQ8t.cjs.map} +1 -1
  208. package/dist/{Progress-BNEFGn-O.js → Progress-CHzNwegP.js} +2 -2
  209. package/dist/{Progress-BNEFGn-O.js.map → Progress-CHzNwegP.js.map} +1 -1
  210. package/dist/{QrCode-CrNJZV_8.js → QrCode-C3hAfNP6.js} +2 -2
  211. package/dist/{QrCode-CrNJZV_8.js.map → QrCode-C3hAfNP6.js.map} +1 -1
  212. package/dist/{QrCode-TcQQE0h7.cjs → QrCode-tNNnsbHM.cjs} +2 -2
  213. package/dist/{QrCode-TcQQE0h7.cjs.map → QrCode-tNNnsbHM.cjs.map} +1 -1
  214. package/dist/{RemoveDialog-ARFp1UJM.js → RemoveDialog-CXy-PY-G.js} +6 -6
  215. package/dist/{RemoveDialog-ARFp1UJM.js.map → RemoveDialog-CXy-PY-G.js.map} +1 -1
  216. package/dist/{RemoveDialog-IWOAQFNK.cjs → RemoveDialog-Hi_gV-8A.cjs} +2 -2
  217. package/dist/{RemoveDialog-IWOAQFNK.cjs.map → RemoveDialog-Hi_gV-8A.cjs.map} +1 -1
  218. package/dist/RichTextEditor-BhVE1q4U.cjs +2 -0
  219. package/dist/RichTextEditor-BhVE1q4U.cjs.map +1 -0
  220. package/dist/RichTextEditor-DQz9jGD3.js +1011 -0
  221. package/dist/RichTextEditor-DQz9jGD3.js.map +1 -0
  222. package/dist/{RootLayout-CZ2GQ8XA.js → RootLayout-CjT5uHlt.js} +21 -21
  223. package/dist/RootLayout-CjT5uHlt.js.map +1 -0
  224. package/dist/{RootLayout-DStUP263.cjs → RootLayout-iSGY4MsS.cjs} +2 -2
  225. package/dist/RootLayout-iSGY4MsS.cjs.map +1 -0
  226. package/dist/Select-DVoL547R.cjs +2 -0
  227. package/dist/{Select-C2DIfuoB.cjs.map → Select-DVoL547R.cjs.map} +1 -1
  228. package/dist/{Select-KGsA8PbI.js → Select-DuLDLnnb.js} +47 -47
  229. package/dist/{Select-KGsA8PbI.js.map → Select-DuLDLnnb.js.map} +1 -1
  230. package/dist/Sidebar-DRQo4zAF.cjs +2 -0
  231. package/dist/{Sidebar-wK1_xaY_.cjs.map → Sidebar-DRQo4zAF.cjs.map} +1 -1
  232. package/dist/{Sidebar-_pcwxdd8.js → Sidebar-DvQmuBNK.js} +59 -59
  233. package/dist/{Sidebar-_pcwxdd8.js.map → Sidebar-DvQmuBNK.js.map} +1 -1
  234. package/dist/{Slider-Cpc5_dPl.js → Slider-D-QjclQJ.js} +2 -2
  235. package/dist/{Slider-Cpc5_dPl.js.map → Slider-D-QjclQJ.js.map} +1 -1
  236. package/dist/{Slider-CXAz9SUY.cjs → Slider-DxnCQRSH.cjs} +2 -2
  237. package/dist/{Slider-CXAz9SUY.cjs.map → Slider-DxnCQRSH.cjs.map} +1 -1
  238. package/dist/{SpeedDial-BT_boD06.cjs → SpeedDial-37OMwj9C.cjs} +2 -2
  239. package/dist/{SpeedDial-BT_boD06.cjs.map → SpeedDial-37OMwj9C.cjs.map} +1 -1
  240. package/dist/{SpeedDial-SMMfes9f.js → SpeedDial-BBQ9y6lm.js} +3 -3
  241. package/dist/{SpeedDial-SMMfes9f.js.map → SpeedDial-BBQ9y6lm.js.map} +1 -1
  242. package/dist/Stepper-CU5Y0kfj.js +168 -0
  243. package/dist/{Stepper-CR0Mlkq7.js.map → Stepper-CU5Y0kfj.js.map} +1 -1
  244. package/dist/Stepper-WqkfGPnQ.cjs +2 -0
  245. package/dist/{Stepper-BmA_DjTS.cjs.map → Stepper-WqkfGPnQ.cjs.map} +1 -1
  246. package/dist/{SwatchPicker-0gnOvv7U.cjs → SwatchPicker-DCjE0T80.cjs} +2 -2
  247. package/dist/{SwatchPicker-0gnOvv7U.cjs.map → SwatchPicker-DCjE0T80.cjs.map} +1 -1
  248. package/dist/{SwatchPicker-BZHRELA-.js → SwatchPicker-DS4WY2eM.js} +2 -2
  249. package/dist/{SwatchPicker-BZHRELA-.js.map → SwatchPicker-DS4WY2eM.js.map} +1 -1
  250. package/dist/{Table-D-F68lcm.js → Table-BECUUZtf.js} +346 -346
  251. package/dist/Table-BECUUZtf.js.map +1 -0
  252. package/dist/Table-BnlvrRMr.cjs +2 -0
  253. package/dist/Table-BnlvrRMr.cjs.map +1 -0
  254. package/dist/Tabs-BXAHddi7.js +193 -0
  255. package/dist/{Tabs-DP0aZ5TB.js.map → Tabs-BXAHddi7.js.map} +1 -1
  256. package/dist/Tabs-DiL1vNW3.cjs +2 -0
  257. package/dist/{Tabs-Cgp6D1WP.cjs.map → Tabs-DiL1vNW3.cjs.map} +1 -1
  258. package/dist/{TagsField-9nKu6ZW4.cjs → TagsField-BsV_6dff.cjs} +2 -2
  259. package/dist/{TagsField-9nKu6ZW4.cjs.map → TagsField-BsV_6dff.cjs.map} +1 -1
  260. package/dist/{TagsField-CcY9MTMw.js → TagsField-C1SgykAj.js} +5 -5
  261. package/dist/{TagsField-CcY9MTMw.js.map → TagsField-C1SgykAj.js.map} +1 -1
  262. package/dist/{TextField-C5MgCQIV.cjs → TextField-DUv689u2.cjs} +2 -2
  263. package/dist/{TextField-C5MgCQIV.cjs.map → TextField-DUv689u2.cjs.map} +1 -1
  264. package/dist/{TextField-0WvJsHhA.js → TextField-oZI7thoU.js} +4 -4
  265. package/dist/{TextField-0WvJsHhA.js.map → TextField-oZI7thoU.js.map} +1 -1
  266. package/dist/{ThemeToggle-DmCePuTy.js → ThemeToggle-5uHCUsX7.js} +4 -4
  267. package/dist/{ThemeToggle-DmCePuTy.js.map → ThemeToggle-5uHCUsX7.js.map} +1 -1
  268. package/dist/{ThemeToggle-BvcCxRpF.cjs → ThemeToggle-xn3roH0u.cjs} +2 -2
  269. package/dist/{ThemeToggle-BvcCxRpF.cjs.map → ThemeToggle-xn3roH0u.cjs.map} +1 -1
  270. package/dist/TimeColumns-By23LHZw.cjs +2 -0
  271. package/dist/{TimeColumns-Q-vsHFZU.cjs.map → TimeColumns-By23LHZw.cjs.map} +1 -1
  272. package/dist/TimeColumns-lO33mhX7.js +147 -0
  273. package/dist/{TimeColumns-WJRHQuFv.js.map → TimeColumns-lO33mhX7.js.map} +1 -1
  274. package/dist/{TimePicker-CvbQFzBf.cjs → TimePicker-BHFNH8LR.cjs} +2 -2
  275. package/dist/{TimePicker-CvbQFzBf.cjs.map → TimePicker-BHFNH8LR.cjs.map} +1 -1
  276. package/dist/{TimePicker-DJDuSxAg.js → TimePicker-Dl5p833O.js} +7 -7
  277. package/dist/{TimePicker-DJDuSxAg.js.map → TimePicker-Dl5p833O.js.map} +1 -1
  278. package/dist/Timeline-DOojNvLG.cjs +2 -0
  279. package/dist/Timeline-DOojNvLG.cjs.map +1 -0
  280. package/dist/Timeline-Dg03dwTN.js +87 -0
  281. package/dist/Timeline-Dg03dwTN.js.map +1 -0
  282. package/dist/Toaster-BPBFZiTr.js +64 -0
  283. package/dist/Toaster-BPBFZiTr.js.map +1 -0
  284. package/dist/Toaster-D4T89N1S.cjs +2 -0
  285. package/dist/Toaster-D4T89N1S.cjs.map +1 -0
  286. package/dist/ToggleButtonGroup-CGNRLxjg.cjs +2 -0
  287. package/dist/{ToggleButtonGroup-Ci_DFvdt.cjs.map → ToggleButtonGroup-CGNRLxjg.cjs.map} +1 -1
  288. package/dist/{ToggleButtonGroup-Mdskkjdh.js → ToggleButtonGroup-K6ZcrTZT.js} +37 -37
  289. package/dist/{ToggleButtonGroup-Mdskkjdh.js.map → ToggleButtonGroup-K6ZcrTZT.js.map} +1 -1
  290. package/dist/{TranslatedFields-DKXznBtD.js → TranslatedFields-Clsr84XC.js} +13 -13
  291. package/dist/{TranslatedFields-DKXznBtD.js.map → TranslatedFields-Clsr84XC.js.map} +1 -1
  292. package/dist/{TranslatedFields-CuK5KKzE.cjs → TranslatedFields-LdeJeHEp.cjs} +2 -2
  293. package/dist/{TranslatedFields-CuK5KKzE.cjs.map → TranslatedFields-LdeJeHEp.cjs.map} +1 -1
  294. package/dist/{UserCard-DbudGMvG.cjs → UserCard-CQOiWppq.cjs} +2 -2
  295. package/dist/{UserCard-DbudGMvG.cjs.map → UserCard-CQOiWppq.cjs.map} +1 -1
  296. package/dist/{UserCard-UG_Cwe-Y.js → UserCard-Cr75RwZb.js} +5 -5
  297. package/dist/{UserCard-UG_Cwe-Y.js.map → UserCard-Cr75RwZb.js.map} +1 -1
  298. package/dist/app/AdminRoot.d.cts +11 -3
  299. package/dist/app/AdminRoot.d.ts +11 -3
  300. package/dist/chunks/icons/{25-knEB8mSp.js → 25-BMMPtr_E.js} +4 -5
  301. package/dist/chunks/icons/{25-Dho_3EHD.cjs → 25-uATZNfXE.cjs} +1 -1
  302. package/dist/chunks/icons/{2b-CQJdcF1h.js → 2b-Brkug4c-.js} +10 -11
  303. package/dist/chunks/icons/{2b-C2_97u16.cjs → 2b-CIVRGp1R.cjs} +1 -1
  304. package/dist/chunks/icons/57-BLoIUlhF.js +27 -0
  305. package/dist/chunks/icons/57-D4zLdDZ1.cjs +1 -0
  306. package/dist/chunks/icons/{75-DqLkMUyj.cjs → 75-C2eJ2Tvr.cjs} +1 -1
  307. package/dist/chunks/icons/{75-D5RQw6IJ.js → 75-D16WojvG.js} +6 -7
  308. package/dist/chunks/icons/{7c-DpnA_JOJ.js → 7c-0j5Sno5_.js} +6 -7
  309. package/dist/chunks/icons/{7c-DEaFwltT.cjs → 7c-LUfAyp72.cjs} +1 -1
  310. package/dist/chunks/icons/8a-BJ_LOjmW.js +26 -0
  311. package/dist/chunks/icons/8a-CYkhOibI.cjs +1 -0
  312. package/dist/chunks/icons/97-Bx7FkkGJ.js +12 -0
  313. package/dist/chunks/icons/97-D7pUHrOX.cjs +1 -0
  314. package/dist/chunks/icons/{b7-BtHkI92Y.js → b7-DmmkevXf.js} +17 -18
  315. package/dist/chunks/icons/{b7-B-dB5jrV.cjs → b7-rI1GpsxW.cjs} +1 -1
  316. package/dist/chunks/icons/b8-De0yKEKv.js +28 -0
  317. package/dist/chunks/icons/b8-eR814BVJ.cjs +1 -0
  318. package/dist/chunks/icons/{b9-Bw942fE3.js → b9-CJO6ZdSw.js} +10 -11
  319. package/dist/chunks/icons/{b9-Be-J4RIp.cjs → b9-DZdWz9qg.cjs} +1 -1
  320. package/dist/chunks/icons/d5-BAPeb6B0.cjs +1 -0
  321. package/dist/chunks/icons/d5-BJJanOLe.js +21 -0
  322. package/dist/chunks/icons/d8--vRkIVal.js +19 -0
  323. package/dist/chunks/icons/d8-BfMys92X.cjs +1 -0
  324. package/dist/chunks/icons/dd-CARhkHmU.js +21 -0
  325. package/dist/chunks/icons/dd-D61yllMP.cjs +1 -0
  326. package/dist/components/Accordion/index.cjs +1 -1
  327. package/dist/components/Accordion/index.js +1 -1
  328. package/dist/components/Alert/index.cjs +1 -1
  329. package/dist/components/Alert/index.js +1 -1
  330. package/dist/components/AuthLayout/index.cjs +1 -1
  331. package/dist/components/AuthLayout/index.js +1 -1
  332. package/dist/components/Avatar/index.cjs +1 -1
  333. package/dist/components/Avatar/index.js +2 -2
  334. package/dist/components/Breadcrumbs/index.cjs +1 -1
  335. package/dist/components/Breadcrumbs/index.js +1 -1
  336. package/dist/components/Button/index.cjs +1 -1
  337. package/dist/components/Button/index.js +1 -1
  338. package/dist/components/Card/index.cjs +1 -1
  339. package/dist/components/Card/index.js +1 -1
  340. package/dist/components/Chip/index.cjs +1 -1
  341. package/dist/components/Chip/index.js +1 -1
  342. package/dist/components/ChoiceCard/index.cjs +1 -1
  343. package/dist/components/ChoiceCard/index.js +1 -1
  344. package/dist/components/CodeBlock/index.cjs +1 -1
  345. package/dist/components/CodeBlock/index.js +1 -1
  346. package/dist/components/ColorPicker/index.cjs +1 -1
  347. package/dist/components/ColorPicker/index.js +1 -1
  348. package/dist/components/ColorRamp/index.cjs +1 -1
  349. package/dist/components/ColorRamp/index.js +1 -1
  350. package/dist/components/CopyButton/index.cjs +1 -1
  351. package/dist/components/CopyButton/index.js +1 -1
  352. package/dist/components/DashedButton/index.cjs +1 -1
  353. package/dist/components/DashedButton/index.js +1 -1
  354. package/dist/components/DatePicker/index.cjs +1 -1
  355. package/dist/components/DatePicker/index.js +1 -1
  356. package/dist/components/DateTimePicker/index.cjs +1 -1
  357. package/dist/components/DateTimePicker/index.js +1 -1
  358. package/dist/components/DescriptionList/index.cjs +1 -1
  359. package/dist/components/DescriptionList/index.js +1 -1
  360. package/dist/components/Dropdown/index.cjs +1 -1
  361. package/dist/components/Dropdown/index.js +1 -1
  362. package/dist/components/EmptyState/index.cjs +1 -1
  363. package/dist/components/EmptyState/index.js +1 -1
  364. package/dist/components/ErrorState/ErrorBoundary.d.cts +1 -1
  365. package/dist/components/ErrorState/ErrorBoundary.d.ts +1 -1
  366. package/dist/components/ErrorState/index.cjs +1 -1
  367. package/dist/components/ErrorState/index.js +2 -2
  368. package/dist/components/FileCard/index.cjs +1 -1
  369. package/dist/components/FileCard/index.js +1 -1
  370. package/dist/components/FileUploader/FileUploader.d.cts +33 -5
  371. package/dist/components/FileUploader/FileUploader.d.ts +33 -5
  372. package/dist/components/FileUploader/FileUploaderEditDialog.d.cts +8 -18
  373. package/dist/components/FileUploader/FileUploaderEditDialog.d.ts +8 -18
  374. package/dist/components/FileUploader/index.cjs +1 -1
  375. package/dist/components/FileUploader/index.js +1 -1
  376. package/dist/components/Flag/index.cjs +1 -1
  377. package/dist/components/Flag/index.js +1 -1
  378. package/dist/components/FullscreenToggle/index.cjs +1 -1
  379. package/dist/components/FullscreenToggle/index.js +1 -1
  380. package/dist/components/Icon/index.cjs +1 -1
  381. package/dist/components/Icon/index.js +1 -1
  382. package/dist/components/IconButton/index.cjs +1 -1
  383. package/dist/components/IconButton/index.js +1 -1
  384. package/dist/components/ImageEditor/CropShapeMenu.d.cts +17 -0
  385. package/dist/components/ImageEditor/CropShapeMenu.d.ts +17 -0
  386. package/dist/components/ImageEditor/EditorStage.d.cts +27 -0
  387. package/dist/components/ImageEditor/EditorStage.d.ts +27 -0
  388. package/dist/components/ImageEditor/FilterStrip.d.cts +14 -0
  389. package/dist/components/ImageEditor/FilterStrip.d.ts +14 -0
  390. package/dist/components/ImageEditor/ImageEditor.d.cts +30 -0
  391. package/dist/components/ImageEditor/ImageEditor.d.ts +30 -0
  392. package/dist/components/ImageEditor/ResizePanel.d.cts +19 -0
  393. package/dist/components/ImageEditor/ResizePanel.d.ts +19 -0
  394. package/dist/components/ImageEditor/RulerSlider.d.cts +37 -0
  395. package/dist/components/ImageEditor/RulerSlider.d.ts +37 -0
  396. package/dist/components/ImageEditor/core/affine.d.cts +11 -0
  397. package/dist/components/ImageEditor/core/affine.d.ts +11 -0
  398. package/dist/components/ImageEditor/core/editor.d.cts +69 -0
  399. package/dist/components/ImageEditor/core/editor.d.ts +69 -0
  400. package/dist/components/ImageEditor/core/geometry.d.cts +112 -0
  401. package/dist/components/ImageEditor/core/geometry.d.ts +112 -0
  402. package/dist/components/ImageEditor/core/load.d.cts +26 -0
  403. package/dist/components/ImageEditor/core/load.d.ts +26 -0
  404. package/dist/components/ImageEditor/core/matrix.d.cts +55 -0
  405. package/dist/components/ImageEditor/core/matrix.d.ts +55 -0
  406. package/dist/components/ImageEditor/core/pixels.d.cts +24 -0
  407. package/dist/components/ImageEditor/core/pixels.d.ts +24 -0
  408. package/dist/components/ImageEditor/core/redact.d.cts +37 -0
  409. package/dist/components/ImageEditor/core/redact.d.ts +37 -0
  410. package/dist/components/ImageEditor/core/render.d.cts +19 -0
  411. package/dist/components/ImageEditor/core/render.d.ts +19 -0
  412. package/dist/components/ImageEditor/core/scene.d.cts +47 -0
  413. package/dist/components/ImageEditor/core/scene.d.ts +47 -0
  414. package/dist/components/ImageEditor/core/spring.d.cts +17 -0
  415. package/dist/components/ImageEditor/core/spring.d.ts +17 -0
  416. package/dist/components/ImageEditor/core/types.d.cts +104 -0
  417. package/dist/components/ImageEditor/core/types.d.ts +104 -0
  418. package/dist/components/ImageEditor/core/webgl.d.cts +55 -0
  419. package/dist/components/ImageEditor/core/webgl.d.ts +55 -0
  420. package/dist/components/ImageEditor/index.cjs +2 -0
  421. package/dist/components/ImageEditor/index.cjs.map +1 -0
  422. package/dist/components/ImageEditor/index.d.cts +6 -0
  423. package/dist/components/ImageEditor/index.d.ts +6 -0
  424. package/dist/components/ImageEditor/index.js +9 -0
  425. package/dist/components/ImageEditor/index.js.map +1 -0
  426. package/dist/components/Link/index.cjs +1 -1
  427. package/dist/components/Link/index.js +1 -1
  428. package/dist/components/List/index.cjs +1 -1
  429. package/dist/components/List/index.js +2 -2
  430. package/dist/components/Loader/index.cjs +1 -1
  431. package/dist/components/Loader/index.js +1 -1
  432. package/dist/components/LocationPicker/index.cjs +1 -1
  433. package/dist/components/LocationPicker/index.js +1 -1
  434. package/dist/components/Modal/index.cjs +1 -1
  435. package/dist/components/Modal/index.js +1 -1
  436. package/dist/components/MultiSelect/index.cjs +1 -1
  437. package/dist/components/MultiSelect/index.js +1 -1
  438. package/dist/components/NumberField/index.cjs +1 -1
  439. package/dist/components/NumberField/index.js +1 -1
  440. package/dist/components/OtpField/index.cjs +1 -1
  441. package/dist/components/OtpField/index.js +1 -1
  442. package/dist/components/PageError/index.cjs +1 -1
  443. package/dist/components/PageError/index.js +1 -1
  444. package/dist/components/PageLayout/index.cjs +1 -1
  445. package/dist/components/PageLayout/index.js +1 -1
  446. package/dist/components/PageNotFound/index.cjs +1 -1
  447. package/dist/components/PageNotFound/index.js +1 -1
  448. package/dist/components/Pagination/index.cjs +1 -1
  449. package/dist/components/Pagination/index.js +1 -1
  450. package/dist/components/PaletteField/index.cjs +1 -1
  451. package/dist/components/PaletteField/index.js +1 -1
  452. package/dist/components/PhoneField/index.cjs +1 -1
  453. package/dist/components/PhoneField/index.js +1 -1
  454. package/dist/components/Popconfirm/index.cjs +1 -1
  455. package/dist/components/Popconfirm/index.js +1 -1
  456. package/dist/components/Progress/index.cjs +1 -1
  457. package/dist/components/Progress/index.js +1 -1
  458. package/dist/components/QrCode/index.cjs +1 -1
  459. package/dist/components/QrCode/index.js +1 -1
  460. package/dist/components/RemoveDialog/index.cjs +1 -1
  461. package/dist/components/RemoveDialog/index.js +1 -1
  462. package/dist/components/RichTextEditor/RichTextEditor.d.cts +3 -2
  463. package/dist/components/RichTextEditor/RichTextEditor.d.ts +3 -2
  464. package/dist/components/RichTextEditor/index.cjs +1 -1
  465. package/dist/components/RichTextEditor/index.js +1 -1
  466. package/dist/components/RichTextEditor/nodes/ImageNode.d.cts +8 -5
  467. package/dist/components/RichTextEditor/nodes/ImageNode.d.ts +8 -5
  468. package/dist/components/RichTextEditor/nodes/VideoNode.d.cts +4 -4
  469. package/dist/components/RichTextEditor/nodes/VideoNode.d.ts +4 -4
  470. package/dist/components/RootLayout/RootLayout.d.cts +3 -2
  471. package/dist/components/RootLayout/RootLayout.d.ts +3 -2
  472. package/dist/components/RootLayout/index.cjs +1 -1
  473. package/dist/components/RootLayout/index.js +1 -1
  474. package/dist/components/Select/index.cjs +1 -1
  475. package/dist/components/Select/index.js +1 -1
  476. package/dist/components/Sidebar/index.cjs +1 -1
  477. package/dist/components/Sidebar/index.js +1 -1
  478. package/dist/components/Slider/index.cjs +1 -1
  479. package/dist/components/Slider/index.js +1 -1
  480. package/dist/components/SpeedDial/index.cjs +1 -1
  481. package/dist/components/SpeedDial/index.js +1 -1
  482. package/dist/components/Stepper/index.cjs +1 -1
  483. package/dist/components/Stepper/index.js +1 -1
  484. package/dist/components/SwatchPicker/index.cjs +1 -1
  485. package/dist/components/SwatchPicker/index.js +1 -1
  486. package/dist/components/Table/index.cjs +1 -1
  487. package/dist/components/Table/index.js +1 -1
  488. package/dist/components/Tabs/index.cjs +1 -1
  489. package/dist/components/Tabs/index.js +1 -1
  490. package/dist/components/TagsField/index.cjs +1 -1
  491. package/dist/components/TagsField/index.js +1 -1
  492. package/dist/components/TextField/index.cjs +1 -1
  493. package/dist/components/TextField/index.js +1 -1
  494. package/dist/components/ThemeToggle/index.cjs +1 -1
  495. package/dist/components/ThemeToggle/index.js +1 -1
  496. package/dist/components/TimePicker/index.cjs +1 -1
  497. package/dist/components/TimePicker/index.js +1 -1
  498. package/dist/components/Timeline/Timeline.d.cts +16 -4
  499. package/dist/components/Timeline/Timeline.d.ts +16 -4
  500. package/dist/components/Timeline/TimelineItem.d.cts +12 -6
  501. package/dist/components/Timeline/TimelineItem.d.ts +12 -6
  502. package/dist/components/Timeline/index.cjs +1 -1
  503. package/dist/components/Timeline/index.d.cts +1 -1
  504. package/dist/components/Timeline/index.d.ts +1 -1
  505. package/dist/components/Timeline/index.js +1 -1
  506. package/dist/components/Timeline/timelineContext.d.cts +3 -2
  507. package/dist/components/Timeline/timelineContext.d.ts +3 -2
  508. package/dist/components/Toast/Toaster.d.cts +10 -4
  509. package/dist/components/Toast/Toaster.d.ts +10 -4
  510. package/dist/components/Toast/index.cjs +1 -1
  511. package/dist/components/Toast/index.js +1 -1
  512. package/dist/components/ToggleButton/index.cjs +1 -1
  513. package/dist/components/ToggleButton/index.js +1 -1
  514. package/dist/components/TranslatedFields/index.cjs +1 -1
  515. package/dist/components/TranslatedFields/index.js +1 -1
  516. package/dist/components/UserCard/index.cjs +1 -1
  517. package/dist/components/UserCard/index.js +1 -1
  518. package/dist/components/index.d.cts +1 -0
  519. package/dist/components/index.d.ts +1 -0
  520. package/dist/entries/app.cjs +1 -1
  521. package/dist/entries/app.js +1 -1
  522. package/dist/entries/components.cjs +1 -1
  523. package/dist/entries/components.js +164 -159
  524. package/dist/entries/components.js.map +1 -1
  525. package/dist/entries/i18n.cjs +1 -1
  526. package/dist/entries/i18n.js +2 -2
  527. package/dist/entries/icons.cjs +1 -1
  528. package/dist/entries/icons.js +1 -1
  529. package/dist/entries/theme.cjs +1 -1
  530. package/dist/entries/theme.d.cts +2 -2
  531. package/dist/entries/theme.d.ts +2 -2
  532. package/dist/entries/theme.js +14 -13
  533. package/dist/i18n/messages.d.cts +61 -4
  534. package/dist/i18n/messages.d.ts +61 -4
  535. package/dist/icons/names.d.cts +3 -3
  536. package/dist/icons/names.d.ts +3 -3
  537. package/dist/index.cjs +1 -1
  538. package/dist/index.css +1 -1
  539. package/dist/index.js +246 -240
  540. package/dist/index.js.map +1 -1
  541. package/dist/{messages-BiRLMy1E.js → messages-BZYBZ3GR.js} +101 -44
  542. package/dist/messages-BZYBZ3GR.js.map +1 -0
  543. package/dist/{messages-C_fRRCg6.cjs → messages-CTHjpVJq.cjs} +9 -9
  544. package/dist/messages-CTHjpVJq.cjs.map +1 -0
  545. package/dist/theme/ConfigProvider.d.cts +20 -0
  546. package/dist/theme/ConfigProvider.d.ts +20 -0
  547. package/dist/theme/index.d.cts +2 -2
  548. package/dist/theme/index.d.ts +2 -2
  549. package/dist/{useHomeTo-DQj9tVZI.js → useHomeTo-Biyc-Un8.js} +2 -2
  550. package/dist/{useHomeTo-DQj9tVZI.js.map → useHomeTo-Biyc-Un8.js.map} +1 -1
  551. package/dist/{useHomeTo-BaM7kBDh.cjs → useHomeTo-D7wcH6aw.cjs} +2 -2
  552. package/dist/{useHomeTo-BaM7kBDh.cjs.map → useHomeTo-D7wcH6aw.cjs.map} +1 -1
  553. package/dist/{useOptionMenu-BKC1y6oj.cjs → useOptionMenu-B40OOVsO.cjs} +2 -2
  554. package/dist/{useOptionMenu-BKC1y6oj.cjs.map → useOptionMenu-B40OOVsO.cjs.map} +1 -1
  555. package/dist/{useOptionMenu-Dom1-bqm.js → useOptionMenu-BTt8t9SM.js} +6 -6
  556. package/dist/{useOptionMenu-Dom1-bqm.js.map → useOptionMenu-BTt8t9SM.js.map} +1 -1
  557. package/package.json +1 -6
  558. package/dist/AdminRoot-DufZpgdm.js +0 -100
  559. package/dist/AdminRoot-DufZpgdm.js.map +0 -1
  560. package/dist/AdminRoot-DwJ5jdXr.cjs +0 -2
  561. package/dist/AdminRoot-DwJ5jdXr.cjs.map +0 -1
  562. package/dist/Alert-C8BBxL_7.cjs +0 -2
  563. package/dist/Alert-D6oBxBdP.js +0 -70
  564. package/dist/Breadcrumbs-B-olYVdw.cjs +0 -2
  565. package/dist/Breadcrumbs-cXET6OM5.js +0 -34
  566. package/dist/Button-0ZgdNjX-.js +0 -72
  567. package/dist/Button-CwrDiZek.cjs +0 -2
  568. package/dist/Chip-BkU3yx6G.cjs +0 -2
  569. package/dist/Chip-CzJjbaKx.js +0 -92
  570. package/dist/ChoiceCardGroup-C7Eengyd.cjs +0 -2
  571. package/dist/ChoiceCardGroup-q0yN-TeQ.js +0 -180
  572. package/dist/CodeBlock-BHcvQrs9.js +0 -96
  573. package/dist/CodeBlock-DRBQ_S5t.cjs +0 -2
  574. package/dist/ConfigProvider-BaiTKZKC.cjs +0 -2
  575. package/dist/ConfigProvider-BaiTKZKC.cjs.map +0 -1
  576. package/dist/ConfigProvider-D61cpCz-.js.map +0 -1
  577. package/dist/DashedButton-Dw7xHgIp.cjs +0 -2
  578. package/dist/DashedButton-csz6Jt_K.js +0 -58
  579. package/dist/DatePicker.module-BDtTsg8M.cjs +0 -2
  580. package/dist/DatePicker.module-CMMQyEhG.js +0 -138
  581. package/dist/DescriptionList-CvPDn-kh.cjs +0 -2
  582. package/dist/Dropdown-CMjURWYd.cjs +0 -2
  583. package/dist/Dropdown-CMjURWYd.cjs.map +0 -1
  584. package/dist/Dropdown-CnDBlB02.js +0 -146
  585. package/dist/Dropdown-CnDBlB02.js.map +0 -1
  586. package/dist/FileCard-DEc10T2G.cjs +0 -2
  587. package/dist/FileUploader-D58_6kDA.cjs +0 -2
  588. package/dist/FileUploader-D58_6kDA.cjs.map +0 -1
  589. package/dist/FileUploader-DfYOBFa4.js +0 -707
  590. package/dist/FileUploader-DfYOBFa4.js.map +0 -1
  591. package/dist/Icon-B6lz-V0A.cjs +0 -2
  592. package/dist/Icon-B6lz-V0A.cjs.map +0 -1
  593. package/dist/Icon-D5TxgfCc.js +0 -5404
  594. package/dist/Icon-D5TxgfCc.js.map +0 -1
  595. package/dist/IconButton-CxSXEYce.cjs +0 -2
  596. package/dist/IconButton-D9MCwRK_.js +0 -68
  597. package/dist/Link-BQlvsu9V.js +0 -48
  598. package/dist/Link-GZT51mKx.cjs +0 -2
  599. package/dist/ListItem-2Lr5_NRY.js +0 -76
  600. package/dist/ListItem-DkCYXucd.cjs +0 -2
  601. package/dist/Modal-C6Zgwz_6.js +0 -206
  602. package/dist/Modal-C6Zgwz_6.js.map +0 -1
  603. package/dist/Modal-D9_OG53G.cjs +0 -2
  604. package/dist/Modal-D9_OG53G.cjs.map +0 -1
  605. package/dist/MultiSelect-BdPvjiTj.cjs +0 -2
  606. package/dist/MultiSelect-CHLMpim4.js +0 -219
  607. package/dist/OtpField-Drjy2wwq.cjs +0 -2
  608. package/dist/Pagination-CZtewveA.cjs +0 -2
  609. package/dist/Pagination-tuWRnGwR.js +0 -139
  610. package/dist/PhoneField-BPYg5ZHW.cjs +0 -2
  611. package/dist/RichTextEditor-C9jT2cLl.cjs +0 -2
  612. package/dist/RichTextEditor-C9jT2cLl.cjs.map +0 -1
  613. package/dist/RichTextEditor-DrwJUEYz.js +0 -916
  614. package/dist/RichTextEditor-DrwJUEYz.js.map +0 -1
  615. package/dist/RootLayout-CZ2GQ8XA.js.map +0 -1
  616. package/dist/RootLayout-DStUP263.cjs.map +0 -1
  617. package/dist/Select-C2DIfuoB.cjs +0 -2
  618. package/dist/Sidebar-wK1_xaY_.cjs +0 -2
  619. package/dist/Stepper-BmA_DjTS.cjs +0 -2
  620. package/dist/Stepper-CR0Mlkq7.js +0 -168
  621. package/dist/Table-BkjY1Lwt.cjs +0 -2
  622. package/dist/Table-BkjY1Lwt.cjs.map +0 -1
  623. package/dist/Table-D-F68lcm.js.map +0 -1
  624. package/dist/Tabs-Cgp6D1WP.cjs +0 -2
  625. package/dist/Tabs-DP0aZ5TB.js +0 -193
  626. package/dist/TimeColumns-Q-vsHFZU.cjs +0 -2
  627. package/dist/TimeColumns-WJRHQuFv.js +0 -147
  628. package/dist/Timeline-Cb1krSlo.js +0 -70
  629. package/dist/Timeline-Cb1krSlo.js.map +0 -1
  630. package/dist/Timeline-CmluHBIT.cjs +0 -2
  631. package/dist/Timeline-CmluHBIT.cjs.map +0 -1
  632. package/dist/Toaster-Bb5YEN5j.js +0 -63
  633. package/dist/Toaster-Bb5YEN5j.js.map +0 -1
  634. package/dist/Toaster-Dy1AonLa.cjs +0 -2
  635. package/dist/Toaster-Dy1AonLa.cjs.map +0 -1
  636. package/dist/ToggleButtonGroup-Ci_DFvdt.cjs +0 -2
  637. package/dist/chunks/icons/57-Bxh2lSz-.cjs +0 -1
  638. package/dist/chunks/icons/57-CkmrDM9A.js +0 -28
  639. package/dist/chunks/icons/8a-CThAqelS.js +0 -27
  640. package/dist/chunks/icons/8a-DRBAtpxY.cjs +0 -1
  641. package/dist/chunks/icons/97-J9NBhX2o.js +0 -14
  642. package/dist/chunks/icons/97-r2YXIQ_T.cjs +0 -1
  643. package/dist/chunks/icons/b8-CyIivk3C.cjs +0 -1
  644. package/dist/chunks/icons/b8-DcK0w8WM.js +0 -29
  645. package/dist/chunks/icons/d5-3fWtNlXW.js +0 -20
  646. package/dist/chunks/icons/d5-CoG_Hfw9.cjs +0 -1
  647. package/dist/chunks/icons/d8-DsebfeMy.cjs +0 -1
  648. package/dist/chunks/icons/d8-DtOvDDrr.js +0 -20
  649. package/dist/chunks/icons/dd-BXVES9Ib.js +0 -22
  650. package/dist/chunks/icons/dd-beaqCKss.cjs +0 -1
  651. package/dist/messages-BiRLMy1E.js.map +0 -1
  652. package/dist/messages-C_fRRCg6.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"NumberField-C-FZ-uRI.cjs","sources":["../src/components/NumberField/NumberField.tsx"],"sourcesContent":["import {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n type ChangeEvent,\n type CSSProperties,\n type FocusEvent,\n type InputHTMLAttributes,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { useFormContext } from '../../form/formContext'\nimport { useT } from '../../theme'\nimport { Icon } from '../Icon'\nimport { IconButton } from '../IconButton'\nimport { Typography } from '../Typography'\n// shared field chrome (label/control/helper) AND the `.control .iconButton` styling for the steppers\nimport fieldStyles from '../TextField/TextField.module.css'\n\nexport type NumberFieldSize = 'sm' | 'md' | 'lg'\n\n/** Allowed while typing — digits, an optional leading `-`, and one decimal point. */\nconst NUMERIC_RE = /^-?\\d*\\.?\\d*$/\n\n/** Parses the display string to a number, treating empty / in-progress input (`\"\"`, `\"-\"`, `\".\"`) as null. */\nfunction parseValue(raw: string): number | null {\n if (raw === '' || raw === '-' || raw === '.' || raw === '-.') return null\n const n = Number(raw)\n return Number.isNaN(n) ? null : n\n}\n\nfunction clampValue(n: number, min?: number, max?: number): number {\n if (min != null && n < min) return min\n if (max != null && n > max) return max\n return n\n}\n\n/** Kills binary float drift from repeated stepping (e.g. 0.1 + 0.2). */\nfunction roundStep(n: number): number {\n return Math.round(n * 1e6) / 1e6\n}\n\n/** Groups the integer part with `separator` for display (e.g. 32345345 → \"32.345.345\"). */\nfunction groupThousands(value: number, separator: string): string {\n const [intPart, decPart] = String(value).split('.')\n const sign = intPart.startsWith('-') ? '-' : ''\n const digits = sign ? intPart.slice(1) : intPart\n const grouped = digits.replace(/\\B(?=(\\d{3})+(?!\\d))/g, separator)\n return decPart != null ? `${sign}${grouped}.${decPart}` : `${sign}${grouped}`\n}\n\n/** Counts the \"significant\" (non-separator) chars — used to keep the caret stable across regrouping. */\nfunction countExcept(s: string, sep: string): number {\n let n = 0\n for (const c of s) if (c !== sep) n++\n return n\n}\n\n/** Index just after the `n`-th non-separator char in `str` (where the caret should land after regrouping). */\nfunction positionAfterExcept(str: string, sep: string, n: number): number {\n if (n <= 0) return 0\n let count = 0\n for (let i = 0; i < str.length; i++) {\n if (str[i] !== sep) {\n count += 1\n if (count === n) return i + 1\n }\n }\n return str.length\n}\n\nexport interface NumberFieldProps extends Omit<\n InputHTMLAttributes<HTMLInputElement>,\n 'size' | 'value' | 'defaultValue' | 'onChange' | 'type' | 'min' | 'max' | 'step' | 'prefix'\n> {\n /** Label rendered above the field. */\n label?: ReactNode\n /** Preset size — drives the control height, font size and padding. */\n size?: NumberFieldSize\n /** Marks the field invalid: red border/focus ring + the `helperText` in the error color. */\n error?: boolean\n /** Helper / validation text under the field. Adopts the error color while `error`. */\n helperText?: ReactNode\n /** Adds a red asterisk after the label. */\n required?: boolean\n /** Stretches the field to fill its container width. Defaults to `true`. */\n fullWidth?: boolean\n /** Controlled numeric value (`null` = empty). */\n value?: number | null\n /** Initial value for uncontrolled use (`null` = empty). Defaults to `null`. */\n defaultValue?: number | null\n /** Fires with the parsed numeric value (or `null` when the field is empty). */\n onChange?: (value: number | null) => void\n /** Minimum value — clamps on blur and on the stepper, and disables `−` at the floor. Defaults to `0`; pass a negative `min` to allow negatives. */\n min?: number\n /** Maximum value — clamps on blur and on the stepper, and disables `+` at the ceiling. */\n max?: number\n /** Amount the `+`/`−` buttons add or subtract. Defaults to `1`. */\n step?: number\n /** Hides the `+`/`−` stepper buttons (keyboard entry only). */\n hideStepper?: boolean\n /**\n * Thousands-group separator shown **live** as you type, e.g. `\".\"` displays `32345345` as\n * `32.345.345` (or `\",\"`). The caret is preserved across regrouping; the `value`/`onChange`/form\n * value stay a plain `number`. Best for integers — with `\".\"` decimals aren't supported (the dot is\n * the group separator).\n */\n thousandSeparator?: string\n}\n\n/**\n * A numeric input with `+`/`−` stepper buttons. Supports `min`/`max` clamping, a `step` amount,\n * controlled (`value` + `onChange`) or uncontrolled (`defaultValue`) use, optional live thousands\n * grouping, and — like `TextField` — binds to a surrounding `<Form>` by `name` (its form value is a\n * real `number`, validated by the Zod schema). `onChange` emits a `number` or `null` (empty). Shares\n * `TextField`'s field chrome, so label, sizing, error and focus styling are identical.\n */\nexport const NumberField = forwardRef<HTMLInputElement, NumberFieldProps>(function NumberField(\n {\n label,\n size = 'md',\n error,\n helperText,\n required = false,\n fullWidth = true,\n value,\n defaultValue = null,\n onChange,\n min = 0,\n max,\n step = 1,\n hideStepper = false,\n thousandSeparator,\n name,\n onBlur,\n disabled = false,\n id: idProp,\n className,\n style,\n ...props\n },\n ref,\n) {\n const t = useT()\n const reactId = useId()\n const id = idProp ?? reactId\n const helperId = `${id}-helper`\n\n // Auto-bind to a surrounding <Form> by `name`. The form stores a real number; we use field() for\n // touched/error/helper and read/write the numeric value through values/setValue.\n const form = useFormContext()\n const isFormBound = Boolean(form && name)\n const bound = form && name ? form.field(name) : undefined\n\n const externalValue: number | null | undefined =\n value !== undefined\n ? value\n : isFormBound\n ? ((form!.values[name!] as number | null | undefined) ?? null)\n : undefined\n const isControlled = externalValue !== undefined\n const [internal, setInternal] = useState<number | null>(defaultValue)\n const numValue: number | null = isControlled ? externalValue! : internal\n\n // number <-> display string, applying live thousands grouping when `thousandSeparator` is set.\n const toDisplay = (v: number | null): string =>\n v == null ? '' : thousandSeparator != null ? groupThousands(v, thousandSeparator) : String(v)\n const fromDisplay = (raw: string): number | null =>\n parseValue(thousandSeparator != null ? raw.split(thousandSeparator).join('') : raw)\n\n // The display string mirrors `numValue` but tolerates in-progress input (\"-\", \"1.\" …).\n const [text, setText] = useState<string>(() => toDisplay(numValue))\n useEffect(() => {\n if (fromDisplay(text) !== numValue) setText(toDisplay(numValue))\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [numValue]) // re-sync only when the value changes from the outside (stepper, form, reset)\n\n // Caret restoration after regrouping (the formatted string length changes as separators move).\n const innerRef = useRef<HTMLInputElement>(null)\n const pendingCaret = useRef<number | null>(null)\n const setInputRef = useCallback(\n (node: HTMLInputElement | null) => {\n innerRef.current = node\n if (typeof ref === 'function') ref(node)\n else if (ref) ref.current = node\n },\n [ref],\n )\n useLayoutEffect(() => {\n const pos = pendingCaret.current\n if (pos == null) return\n pendingCaret.current = null\n innerRef.current?.setSelectionRange(pos, pos)\n })\n\n const resolvedError = error ?? bound?.error ?? false\n const resolvedHelperText = helperText ?? bound?.helperText\n\n const commit = (next: number | null) => {\n if (!isControlled) setInternal(next)\n if (isFormBound) form!.setValue(name!, next)\n onChange?.(next)\n }\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n const el = event.target\n const raw = el.value\n\n if (thousandSeparator == null) {\n if (raw !== '' && !NUMERIC_RE.test(raw)) return // reject non-numeric keystrokes\n setText(raw)\n commit(parseValue(raw))\n return\n }\n\n // Live grouping: strip separators, validate, regroup, and remember where the caret should land.\n const sep = thousandSeparator\n const cleaned = raw.split(sep).join('')\n if (cleaned !== '' && !NUMERIC_RE.test(cleaned)) return\n const caret = el.selectionStart ?? raw.length\n const significantBefore = countExcept(raw.slice(0, caret), sep)\n const next = parseValue(cleaned)\n const formatted = next == null ? cleaned : groupThousands(next, sep)\n setText(formatted)\n commit(next)\n pendingCaret.current = positionAfterExcept(formatted, sep, significantBefore)\n }\n\n const handleBlur = (event: FocusEvent<HTMLInputElement>) => {\n if (numValue != null) {\n const clamped = clampValue(numValue, min, max)\n if (clamped !== numValue) commit(clamped)\n }\n bound?.onBlur(event)\n onBlur?.(event)\n }\n\n const stepBy = (direction: 1 | -1) => {\n const base = numValue ?? min ?? 0\n commit(clampValue(roundStep(base + direction * step), min, max))\n }\n\n const atMax = max != null && numValue != null && numValue >= max\n const atMin = min != null && numValue != null && numValue <= min\n\n return (\n <div\n className={clsx(\n fieldStyles.field,\n fieldStyles[size],\n fullWidth && fieldStyles.fullWidth,\n resolvedError && fieldStyles.error,\n disabled && fieldStyles.disabled,\n className,\n )}\n style={style as CSSProperties}\n >\n {label != null && (\n <label htmlFor={id} className={fieldStyles.label}>\n <Typography as=\"span\" variant=\"bodySmall\" color=\"muted\">\n {label}\n </Typography>\n {required && (\n <span className={fieldStyles.required} aria-hidden=\"true\">\n *\n </span>\n )}\n </label>\n )}\n\n <div className={clsx(fieldStyles.control, !hideStepper && fieldStyles.hasRightAdornment)}>\n <input\n ref={setInputRef}\n id={id}\n name={name}\n type=\"text\"\n inputMode=\"decimal\"\n className={fieldStyles.input}\n value={text}\n onChange={handleChange}\n onBlur={handleBlur}\n disabled={disabled}\n aria-invalid={resolvedError || undefined}\n aria-describedby={resolvedHelperText != null ? helperId : undefined}\n {...props}\n />\n {!hideStepper && (\n <>\n {/* Filled icon buttons, sized via the shared `.control .iconButton` rule (flush square,\n stretched to the control height, scaled). The minus glyph is nudged for optical centering. */}\n <IconButton\n variant=\"filled\"\n color=\"primary\"\n className={fieldStyles.iconButton}\n style={{ marginRight: -2 }}\n disabled={disabled || atMin}\n aria-label={t('numberField.decrease')}\n onMouseDown={(event) => event.preventDefault()}\n onClick={() => stepBy(-1)}\n >\n <Icon name=\"Minus\" />\n </IconButton>\n <IconButton\n variant=\"filled\"\n color=\"primary\"\n className={fieldStyles.iconButton}\n disabled={disabled || atMax}\n aria-label={t('numberField.increase')}\n onMouseDown={(event) => event.preventDefault()}\n onClick={() => stepBy(1)}\n >\n <Icon name=\"Add\" />\n </IconButton>\n </>\n )}\n </div>\n\n {resolvedHelperText != null && (\n <Typography\n as=\"span\"\n id={helperId}\n variant=\"bodySmall\"\n color={resolvedError ? 'error' : 'muted'}\n className={fieldStyles.helper}\n >\n {resolvedHelperText}\n </Typography>\n )}\n </div>\n )\n})\n"],"names":["NUMERIC_RE","parseValue","raw","n","clampValue","min","max","roundStep","groupThousands","value","separator","intPart","decPart","sign","grouped","countExcept","s","sep","c","positionAfterExcept","str","count","i","NumberField","forwardRef","label","size","error","helperText","required","fullWidth","defaultValue","onChange","step","hideStepper","thousandSeparator","name","onBlur","disabled","idProp","className","style","props","ref","t","useT","reactId","useId","id","helperId","form","useFormContext","isFormBound","bound","externalValue","isControlled","internal","setInternal","useState","numValue","toDisplay","v","fromDisplay","text","setText","useEffect","innerRef","useRef","pendingCaret","setInputRef","useCallback","node","useLayoutEffect","pos","_a","resolvedError","resolvedHelperText","commit","next","handleChange","event","el","cleaned","caret","significantBefore","formatted","handleBlur","clamped","stepBy","direction","atMax","atMin","jsxs","clsx","fieldStyles","jsx","Typography","Fragment","IconButton","Icon"],"mappings":"wUA0BMA,EAAa,gBAGnB,SAASC,EAAWC,EAA4B,CAC9C,GAAIA,IAAQ,IAAMA,IAAQ,KAAOA,IAAQ,KAAOA,IAAQ,KAAM,OAAO,KACrE,MAAMC,EAAI,OAAOD,CAAG,EACpB,OAAO,OAAO,MAAMC,CAAC,EAAI,KAAOA,CAClC,CAEA,SAASC,EAAWD,EAAWE,EAAcC,EAAsB,CACjE,OAAID,GAAO,MAAQF,EAAIE,EAAYA,EAC/BC,GAAO,MAAQH,EAAIG,EAAYA,EAC5BH,CACT,CAGA,SAASI,GAAUJ,EAAmB,CACpC,OAAO,KAAK,MAAMA,EAAI,GAAG,EAAI,GAC/B,CAGA,SAASK,EAAeC,EAAeC,EAA2B,CAChE,KAAM,CAACC,EAASC,CAAO,EAAI,OAAOH,CAAK,EAAE,MAAM,GAAG,EAC5CI,EAAOF,EAAQ,WAAW,GAAG,EAAI,IAAM,GAEvCG,GADSD,EAAOF,EAAQ,MAAM,CAAC,EAAIA,GAClB,QAAQ,wBAAyBD,CAAS,EACjE,OAAOE,GAAW,KAAO,GAAGC,CAAI,GAAGC,CAAO,IAAIF,CAAO,GAAK,GAAGC,CAAI,GAAGC,CAAO,EAC7E,CAGA,SAASC,GAAYC,EAAWC,EAAqB,CACnD,IAAI,EAAI,EACR,UAAWC,KAAKF,EAAOE,IAAMD,GAAK,IAClC,OAAO,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"NumberField-CyUA6eob.cjs","sources":["../src/components/NumberField/NumberField.tsx"],"sourcesContent":["import {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n type ChangeEvent,\n type CSSProperties,\n type FocusEvent,\n type InputHTMLAttributes,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { useFormContext } from '../../form/formContext'\nimport { useT } from '../../theme'\nimport { Icon } from '../Icon'\nimport { IconButton } from '../IconButton'\nimport { Typography } from '../Typography'\n// shared field chrome (label/control/helper) AND the `.control .iconButton` styling for the steppers\nimport fieldStyles from '../TextField/TextField.module.css'\n\nexport type NumberFieldSize = 'sm' | 'md' | 'lg'\n\n/** Allowed while typing — digits, an optional leading `-`, and one decimal point. */\nconst NUMERIC_RE = /^-?\\d*\\.?\\d*$/\n\n/** Parses the display string to a number, treating empty / in-progress input (`\"\"`, `\"-\"`, `\".\"`) as null. */\nfunction parseValue(raw: string): number | null {\n if (raw === '' || raw === '-' || raw === '.' || raw === '-.') return null\n const n = Number(raw)\n return Number.isNaN(n) ? null : n\n}\n\nfunction clampValue(n: number, min?: number, max?: number): number {\n if (min != null && n < min) return min\n if (max != null && n > max) return max\n return n\n}\n\n/** Kills binary float drift from repeated stepping (e.g. 0.1 + 0.2). */\nfunction roundStep(n: number): number {\n return Math.round(n * 1e6) / 1e6\n}\n\n/** Groups the integer part with `separator` for display (e.g. 32345345 → \"32.345.345\"). */\nfunction groupThousands(value: number, separator: string): string {\n const [intPart, decPart] = String(value).split('.')\n const sign = intPart.startsWith('-') ? '-' : ''\n const digits = sign ? intPart.slice(1) : intPart\n const grouped = digits.replace(/\\B(?=(\\d{3})+(?!\\d))/g, separator)\n return decPart != null ? `${sign}${grouped}.${decPart}` : `${sign}${grouped}`\n}\n\n/** Counts the \"significant\" (non-separator) chars — used to keep the caret stable across regrouping. */\nfunction countExcept(s: string, sep: string): number {\n let n = 0\n for (const c of s) if (c !== sep) n++\n return n\n}\n\n/** Index just after the `n`-th non-separator char in `str` (where the caret should land after regrouping). */\nfunction positionAfterExcept(str: string, sep: string, n: number): number {\n if (n <= 0) return 0\n let count = 0\n for (let i = 0; i < str.length; i++) {\n if (str[i] !== sep) {\n count += 1\n if (count === n) return i + 1\n }\n }\n return str.length\n}\n\nexport interface NumberFieldProps extends Omit<\n InputHTMLAttributes<HTMLInputElement>,\n 'size' | 'value' | 'defaultValue' | 'onChange' | 'type' | 'min' | 'max' | 'step' | 'prefix'\n> {\n /** Label rendered above the field. */\n label?: ReactNode\n /** Preset size — drives the control height, font size and padding. */\n size?: NumberFieldSize\n /** Marks the field invalid: red border/focus ring + the `helperText` in the error color. */\n error?: boolean\n /** Helper / validation text under the field. Adopts the error color while `error`. */\n helperText?: ReactNode\n /** Adds a red asterisk after the label. */\n required?: boolean\n /** Stretches the field to fill its container width. Defaults to `true`. */\n fullWidth?: boolean\n /** Controlled numeric value (`null` = empty). */\n value?: number | null\n /** Initial value for uncontrolled use (`null` = empty). Defaults to `null`. */\n defaultValue?: number | null\n /** Fires with the parsed numeric value (or `null` when the field is empty). */\n onChange?: (value: number | null) => void\n /** Minimum value — clamps on blur and on the stepper, and disables `−` at the floor. Defaults to `0`; pass a negative `min` to allow negatives. */\n min?: number\n /** Maximum value — clamps on blur and on the stepper, and disables `+` at the ceiling. */\n max?: number\n /** Amount the `+`/`−` buttons add or subtract. Defaults to `1`. */\n step?: number\n /** Hides the `+`/`−` stepper buttons (keyboard entry only). */\n hideStepper?: boolean\n /**\n * Thousands-group separator shown **live** as you type, e.g. `\".\"` displays `32345345` as\n * `32.345.345` (or `\",\"`). The caret is preserved across regrouping; the `value`/`onChange`/form\n * value stay a plain `number`. Best for integers — with `\".\"` decimals aren't supported (the dot is\n * the group separator).\n */\n thousandSeparator?: string\n}\n\n/**\n * A numeric input with `+`/`−` stepper buttons. Supports `min`/`max` clamping, a `step` amount,\n * controlled (`value` + `onChange`) or uncontrolled (`defaultValue`) use, optional live thousands\n * grouping, and — like `TextField` — binds to a surrounding `<Form>` by `name` (its form value is a\n * real `number`, validated by the Zod schema). `onChange` emits a `number` or `null` (empty). Shares\n * `TextField`'s field chrome, so label, sizing, error and focus styling are identical.\n */\nexport const NumberField = forwardRef<HTMLInputElement, NumberFieldProps>(function NumberField(\n {\n label,\n size = 'md',\n error,\n helperText,\n required = false,\n fullWidth = true,\n value,\n defaultValue = null,\n onChange,\n min = 0,\n max,\n step = 1,\n hideStepper = false,\n thousandSeparator,\n name,\n onBlur,\n disabled = false,\n id: idProp,\n className,\n style,\n ...props\n },\n ref,\n) {\n const t = useT()\n const reactId = useId()\n const id = idProp ?? reactId\n const helperId = `${id}-helper`\n\n // Auto-bind to a surrounding <Form> by `name`. The form stores a real number; we use field() for\n // touched/error/helper and read/write the numeric value through values/setValue.\n const form = useFormContext()\n const isFormBound = Boolean(form && name)\n const bound = form && name ? form.field(name) : undefined\n\n const externalValue: number | null | undefined =\n value !== undefined\n ? value\n : isFormBound\n ? ((form!.values[name!] as number | null | undefined) ?? null)\n : undefined\n const isControlled = externalValue !== undefined\n const [internal, setInternal] = useState<number | null>(defaultValue)\n const numValue: number | null = isControlled ? externalValue! : internal\n\n // number <-> display string, applying live thousands grouping when `thousandSeparator` is set.\n const toDisplay = (v: number | null): string =>\n v == null ? '' : thousandSeparator != null ? groupThousands(v, thousandSeparator) : String(v)\n const fromDisplay = (raw: string): number | null =>\n parseValue(thousandSeparator != null ? raw.split(thousandSeparator).join('') : raw)\n\n // The display string mirrors `numValue` but tolerates in-progress input (\"-\", \"1.\" …).\n const [text, setText] = useState<string>(() => toDisplay(numValue))\n useEffect(() => {\n if (fromDisplay(text) !== numValue) setText(toDisplay(numValue))\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [numValue]) // re-sync only when the value changes from the outside (stepper, form, reset)\n\n // Caret restoration after regrouping (the formatted string length changes as separators move).\n const innerRef = useRef<HTMLInputElement>(null)\n const pendingCaret = useRef<number | null>(null)\n const setInputRef = useCallback(\n (node: HTMLInputElement | null) => {\n innerRef.current = node\n if (typeof ref === 'function') ref(node)\n else if (ref) ref.current = node\n },\n [ref],\n )\n useLayoutEffect(() => {\n const pos = pendingCaret.current\n if (pos == null) return\n pendingCaret.current = null\n innerRef.current?.setSelectionRange(pos, pos)\n })\n\n const resolvedError = error ?? bound?.error ?? false\n const resolvedHelperText = helperText ?? bound?.helperText\n\n const commit = (next: number | null) => {\n if (!isControlled) setInternal(next)\n if (isFormBound) form!.setValue(name!, next)\n onChange?.(next)\n }\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n const el = event.target\n const raw = el.value\n\n if (thousandSeparator == null) {\n if (raw !== '' && !NUMERIC_RE.test(raw)) return // reject non-numeric keystrokes\n setText(raw)\n commit(parseValue(raw))\n return\n }\n\n // Live grouping: strip separators, validate, regroup, and remember where the caret should land.\n const sep = thousandSeparator\n const cleaned = raw.split(sep).join('')\n if (cleaned !== '' && !NUMERIC_RE.test(cleaned)) return\n const caret = el.selectionStart ?? raw.length\n const significantBefore = countExcept(raw.slice(0, caret), sep)\n const next = parseValue(cleaned)\n const formatted = next == null ? cleaned : groupThousands(next, sep)\n setText(formatted)\n commit(next)\n pendingCaret.current = positionAfterExcept(formatted, sep, significantBefore)\n }\n\n const handleBlur = (event: FocusEvent<HTMLInputElement>) => {\n if (numValue != null) {\n const clamped = clampValue(numValue, min, max)\n if (clamped !== numValue) commit(clamped)\n }\n bound?.onBlur(event)\n onBlur?.(event)\n }\n\n const stepBy = (direction: 1 | -1) => {\n const base = numValue ?? min ?? 0\n commit(clampValue(roundStep(base + direction * step), min, max))\n }\n\n const atMax = max != null && numValue != null && numValue >= max\n const atMin = min != null && numValue != null && numValue <= min\n\n return (\n <div\n className={clsx(\n fieldStyles.field,\n fieldStyles[size],\n fullWidth && fieldStyles.fullWidth,\n resolvedError && fieldStyles.error,\n disabled && fieldStyles.disabled,\n className,\n )}\n style={style as CSSProperties}\n >\n {label != null && (\n <label htmlFor={id} className={fieldStyles.label}>\n <Typography as=\"span\" variant=\"bodySmall\" color=\"muted\">\n {label}\n </Typography>\n {required && (\n <span className={fieldStyles.required} aria-hidden=\"true\">\n *\n </span>\n )}\n </label>\n )}\n\n <div className={clsx(fieldStyles.control, !hideStepper && fieldStyles.hasRightAdornment)}>\n <input\n ref={setInputRef}\n id={id}\n name={name}\n type=\"text\"\n inputMode=\"decimal\"\n className={fieldStyles.input}\n value={text}\n onChange={handleChange}\n onBlur={handleBlur}\n disabled={disabled}\n aria-invalid={resolvedError || undefined}\n aria-describedby={resolvedHelperText != null ? helperId : undefined}\n {...props}\n />\n {!hideStepper && (\n <>\n {/* Filled icon buttons, sized via the shared `.control .iconButton` rule (flush square,\n stretched to the control height, scaled). The minus glyph is nudged for optical centering. */}\n <IconButton\n variant=\"filled\"\n color=\"primary\"\n className={fieldStyles.iconButton}\n style={{ marginRight: -2 }}\n disabled={disabled || atMin}\n aria-label={t('numberField.decrease')}\n onMouseDown={(event) => event.preventDefault()}\n onClick={() => stepBy(-1)}\n >\n <Icon name=\"Minus\" />\n </IconButton>\n <IconButton\n variant=\"filled\"\n color=\"primary\"\n className={fieldStyles.iconButton}\n disabled={disabled || atMax}\n aria-label={t('numberField.increase')}\n onMouseDown={(event) => event.preventDefault()}\n onClick={() => stepBy(1)}\n >\n <Icon name=\"Add\" />\n </IconButton>\n </>\n )}\n </div>\n\n {resolvedHelperText != null && (\n <Typography\n as=\"span\"\n id={helperId}\n variant=\"bodySmall\"\n color={resolvedError ? 'error' : 'muted'}\n className={fieldStyles.helper}\n >\n {resolvedHelperText}\n </Typography>\n )}\n </div>\n )\n})\n"],"names":["NUMERIC_RE","parseValue","raw","n","clampValue","min","max","roundStep","groupThousands","value","separator","intPart","decPart","sign","grouped","countExcept","s","sep","c","positionAfterExcept","str","count","i","NumberField","forwardRef","label","size","error","helperText","required","fullWidth","defaultValue","onChange","step","hideStepper","thousandSeparator","name","onBlur","disabled","idProp","className","style","props","ref","t","useT","reactId","useId","id","helperId","form","useFormContext","isFormBound","bound","externalValue","isControlled","internal","setInternal","useState","numValue","toDisplay","v","fromDisplay","text","setText","useEffect","innerRef","useRef","pendingCaret","setInputRef","useCallback","node","useLayoutEffect","pos","_a","resolvedError","resolvedHelperText","commit","next","handleChange","event","el","cleaned","caret","significantBefore","formatted","handleBlur","clamped","stepBy","direction","atMax","atMin","jsxs","clsx","fieldStyles","jsx","Typography","Fragment","IconButton","Icon"],"mappings":"wUA0BMA,EAAa,gBAGnB,SAASC,EAAWC,EAA4B,CAC9C,GAAIA,IAAQ,IAAMA,IAAQ,KAAOA,IAAQ,KAAOA,IAAQ,KAAM,OAAO,KACrE,MAAMC,EAAI,OAAOD,CAAG,EACpB,OAAO,OAAO,MAAMC,CAAC,EAAI,KAAOA,CAClC,CAEA,SAASC,EAAWD,EAAWE,EAAcC,EAAsB,CACjE,OAAID,GAAO,MAAQF,EAAIE,EAAYA,EAC/BC,GAAO,MAAQH,EAAIG,EAAYA,EAC5BH,CACT,CAGA,SAASI,GAAUJ,EAAmB,CACpC,OAAO,KAAK,MAAMA,EAAI,GAAG,EAAI,GAC/B,CAGA,SAASK,EAAeC,EAAeC,EAA2B,CAChE,KAAM,CAACC,EAASC,CAAO,EAAI,OAAOH,CAAK,EAAE,MAAM,GAAG,EAC5CI,EAAOF,EAAQ,WAAW,GAAG,EAAI,IAAM,GAEvCG,GADSD,EAAOF,EAAQ,MAAM,CAAC,EAAIA,GAClB,QAAQ,wBAAyBD,CAAS,EACjE,OAAOE,GAAW,KAAO,GAAGC,CAAI,GAAGC,CAAO,IAAIF,CAAO,GAAK,GAAGC,CAAI,GAAGC,CAAO,EAC7E,CAGA,SAASC,GAAYC,EAAWC,EAAqB,CACnD,IAAI,EAAI,EACR,UAAWC,KAAKF,EAAOE,IAAMD,GAAK,IAClC,OAAO,CACT,CAGA,SAASE,GAAoBC,EAAaH,EAAa,EAAmB,CACxE,GAAI,GAAK,EAAG,MAAO,GACnB,IAAII,EAAQ,EACZ,QAASC,EAAI,EAAGA,EAAIF,EAAI,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AAArB,EACA,KAAAZ,EACA,KAAK,OACL,UAAU,UACV,UAAW0D,EAAAA,YAAY,MACvB,MAAO/B,EACP,SAAUgB,GACV,OAAQO,GACR,SAAAhD,EACA,eAAcqC,GAAiB,OAC/B,mBAAkBC,GAAsB,KAAO3B,EAAW,OACzD,GAAGP,EAAA,CAAA,EAEL,CAACR,GACA0D,EAAAA,KAAAK,EAAAA,SAAA,CAGE,SAAA,CAAAF,EAAAA,IAACG,EAAAA,WAAA,CACC,QAAQ,SACR,MAAM,UACN,UAAWJ,EAAAA,YAAY,WACvB,MAAO,CAAE,YAAa,EAAA,EACtB,SAAUxD,GAAYqD,GACtB,aAAY/C,EAAE,sBAAsB,EACpC,YAAcoC,GAAUA,EAAM,eAAA,EAC9B,QAAS,IAAMQ,EAAO,EAAE,EAExB,SAAAO,EAAAA,IAACI,EAAAA,KAAA,CAAK,KAAK,OAAA,CAAQ,CAAA,CAAA,EAErBJ,EAAAA,IAACG,EAAAA,WAAA,CACC,QAAQ,SACR,MAAM,UACN,UAAWJ,EAAAA,YAAY,WACvB,SAAUxD,GAAYoD,GACtB,aAAY9C,EAAE,sBAAsB,EACpC,YAAcoC,GAAUA,EAAM,eAAA,EAC9B,QAAS,IAAMQ,EAAO,CAAC,EAEvB,SAAAO,EAAAA,IAACI,EAAAA,KAAA,CAAK,KAAK,KAAA,CAAM,CAAA,CAAA,CACnB,CAAA,CACF,CAAA,EAEJ,EAECvB,GAAsB,MACrBmB,EAAAA,IAACC,EAAAA,WAAA,CACC,GAAG,OACH,GAAI/C,EACJ,QAAQ,YACR,MAAO0B,EAAgB,QAAU,QACjC,UAAWmB,EAAAA,YAAY,OAEtB,SAAAlB,CAAA,CAAA,CACH,CAAA,CAAA,CAIR,CAAC"}
@@ -2,11 +2,11 @@ import { jsxs as x, jsx as a, Fragment as Ne } from "react/jsx-runtime";
2
2
  import { forwardRef as ye, useId as be, useState as J, useEffect as Ie, useRef as K, useCallback as Re, useLayoutEffect as xe } from "react";
3
3
  import { clsx as O } from "clsx";
4
4
  import { u as Fe } from "./formContext-B7ln1Miy.js";
5
- import { b as Q } from "./Icon-D5TxgfCc.js";
6
- import { I as X } from "./IconButton-D9MCwRK_.js";
5
+ import { b as Q } from "./Icon-B7DJn8Tw.js";
6
+ import { I as X } from "./IconButton-EaExCXRq.js";
7
7
  import { T as Y } from "./Typography-ChSuxgkc.js";
8
8
  import { f as r } from "./TextField.module-6gYcR9TL.js";
9
- import { a as Me } from "./ConfigProvider-D61cpCz-.js";
9
+ import { a as Me } from "./ConfigProvider-CYgmMH4j.js";
10
10
  const Z = /^-?\d*\.?\d*$/;
11
11
  function V(t) {
12
12
  if (t === "" || t === "-" || t === "." || t === "-.") return null;
@@ -180,4 +180,4 @@ const We = ye(function({
180
180
  export {
181
181
  We as N
182
182
  };
183
- //# sourceMappingURL=NumberField-BlpFmetF.js.map
183
+ //# sourceMappingURL=NumberField-DHFGNQjZ.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"NumberField-BlpFmetF.js","sources":["../src/components/NumberField/NumberField.tsx"],"sourcesContent":["import {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n type ChangeEvent,\n type CSSProperties,\n type FocusEvent,\n type InputHTMLAttributes,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { useFormContext } from '../../form/formContext'\nimport { useT } from '../../theme'\nimport { Icon } from '../Icon'\nimport { IconButton } from '../IconButton'\nimport { Typography } from '../Typography'\n// shared field chrome (label/control/helper) AND the `.control .iconButton` styling for the steppers\nimport fieldStyles from '../TextField/TextField.module.css'\n\nexport type NumberFieldSize = 'sm' | 'md' | 'lg'\n\n/** Allowed while typing — digits, an optional leading `-`, and one decimal point. */\nconst NUMERIC_RE = /^-?\\d*\\.?\\d*$/\n\n/** Parses the display string to a number, treating empty / in-progress input (`\"\"`, `\"-\"`, `\".\"`) as null. */\nfunction parseValue(raw: string): number | null {\n if (raw === '' || raw === '-' || raw === '.' || raw === '-.') return null\n const n = Number(raw)\n return Number.isNaN(n) ? null : n\n}\n\nfunction clampValue(n: number, min?: number, max?: number): number {\n if (min != null && n < min) return min\n if (max != null && n > max) return max\n return n\n}\n\n/** Kills binary float drift from repeated stepping (e.g. 0.1 + 0.2). */\nfunction roundStep(n: number): number {\n return Math.round(n * 1e6) / 1e6\n}\n\n/** Groups the integer part with `separator` for display (e.g. 32345345 → \"32.345.345\"). */\nfunction groupThousands(value: number, separator: string): string {\n const [intPart, decPart] = String(value).split('.')\n const sign = intPart.startsWith('-') ? '-' : ''\n const digits = sign ? intPart.slice(1) : intPart\n const grouped = digits.replace(/\\B(?=(\\d{3})+(?!\\d))/g, separator)\n return decPart != null ? `${sign}${grouped}.${decPart}` : `${sign}${grouped}`\n}\n\n/** Counts the \"significant\" (non-separator) chars — used to keep the caret stable across regrouping. */\nfunction countExcept(s: string, sep: string): number {\n let n = 0\n for (const c of s) if (c !== sep) n++\n return n\n}\n\n/** Index just after the `n`-th non-separator char in `str` (where the caret should land after regrouping). */\nfunction positionAfterExcept(str: string, sep: string, n: number): number {\n if (n <= 0) return 0\n let count = 0\n for (let i = 0; i < str.length; i++) {\n if (str[i] !== sep) {\n count += 1\n if (count === n) return i + 1\n }\n }\n return str.length\n}\n\nexport interface NumberFieldProps extends Omit<\n InputHTMLAttributes<HTMLInputElement>,\n 'size' | 'value' | 'defaultValue' | 'onChange' | 'type' | 'min' | 'max' | 'step' | 'prefix'\n> {\n /** Label rendered above the field. */\n label?: ReactNode\n /** Preset size — drives the control height, font size and padding. */\n size?: NumberFieldSize\n /** Marks the field invalid: red border/focus ring + the `helperText` in the error color. */\n error?: boolean\n /** Helper / validation text under the field. Adopts the error color while `error`. */\n helperText?: ReactNode\n /** Adds a red asterisk after the label. */\n required?: boolean\n /** Stretches the field to fill its container width. Defaults to `true`. */\n fullWidth?: boolean\n /** Controlled numeric value (`null` = empty). */\n value?: number | null\n /** Initial value for uncontrolled use (`null` = empty). Defaults to `null`. */\n defaultValue?: number | null\n /** Fires with the parsed numeric value (or `null` when the field is empty). */\n onChange?: (value: number | null) => void\n /** Minimum value — clamps on blur and on the stepper, and disables `−` at the floor. Defaults to `0`; pass a negative `min` to allow negatives. */\n min?: number\n /** Maximum value — clamps on blur and on the stepper, and disables `+` at the ceiling. */\n max?: number\n /** Amount the `+`/`−` buttons add or subtract. Defaults to `1`. */\n step?: number\n /** Hides the `+`/`−` stepper buttons (keyboard entry only). */\n hideStepper?: boolean\n /**\n * Thousands-group separator shown **live** as you type, e.g. `\".\"` displays `32345345` as\n * `32.345.345` (or `\",\"`). The caret is preserved across regrouping; the `value`/`onChange`/form\n * value stay a plain `number`. Best for integers — with `\".\"` decimals aren't supported (the dot is\n * the group separator).\n */\n thousandSeparator?: string\n}\n\n/**\n * A numeric input with `+`/`−` stepper buttons. Supports `min`/`max` clamping, a `step` amount,\n * controlled (`value` + `onChange`) or uncontrolled (`defaultValue`) use, optional live thousands\n * grouping, and — like `TextField` — binds to a surrounding `<Form>` by `name` (its form value is a\n * real `number`, validated by the Zod schema). `onChange` emits a `number` or `null` (empty). Shares\n * `TextField`'s field chrome, so label, sizing, error and focus styling are identical.\n */\nexport const NumberField = forwardRef<HTMLInputElement, NumberFieldProps>(function NumberField(\n {\n label,\n size = 'md',\n error,\n helperText,\n required = false,\n fullWidth = true,\n value,\n defaultValue = null,\n onChange,\n min = 0,\n max,\n step = 1,\n hideStepper = false,\n thousandSeparator,\n name,\n onBlur,\n disabled = false,\n id: idProp,\n className,\n style,\n ...props\n },\n ref,\n) {\n const t = useT()\n const reactId = useId()\n const id = idProp ?? reactId\n const helperId = `${id}-helper`\n\n // Auto-bind to a surrounding <Form> by `name`. The form stores a real number; we use field() for\n // touched/error/helper and read/write the numeric value through values/setValue.\n const form = useFormContext()\n const isFormBound = Boolean(form && name)\n const bound = form && name ? form.field(name) : undefined\n\n const externalValue: number | null | undefined =\n value !== undefined\n ? value\n : isFormBound\n ? ((form!.values[name!] as number | null | undefined) ?? null)\n : undefined\n const isControlled = externalValue !== undefined\n const [internal, setInternal] = useState<number | null>(defaultValue)\n const numValue: number | null = isControlled ? externalValue! : internal\n\n // number <-> display string, applying live thousands grouping when `thousandSeparator` is set.\n const toDisplay = (v: number | null): string =>\n v == null ? '' : thousandSeparator != null ? groupThousands(v, thousandSeparator) : String(v)\n const fromDisplay = (raw: string): number | null =>\n parseValue(thousandSeparator != null ? raw.split(thousandSeparator).join('') : raw)\n\n // The display string mirrors `numValue` but tolerates in-progress input (\"-\", \"1.\" …).\n const [text, setText] = useState<string>(() => toDisplay(numValue))\n useEffect(() => {\n if (fromDisplay(text) !== numValue) setText(toDisplay(numValue))\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [numValue]) // re-sync only when the value changes from the outside (stepper, form, reset)\n\n // Caret restoration after regrouping (the formatted string length changes as separators move).\n const innerRef = useRef<HTMLInputElement>(null)\n const pendingCaret = useRef<number | null>(null)\n const setInputRef = useCallback(\n (node: HTMLInputElement | null) => {\n innerRef.current = node\n if (typeof ref === 'function') ref(node)\n else if (ref) ref.current = node\n },\n [ref],\n )\n useLayoutEffect(() => {\n const pos = pendingCaret.current\n if (pos == null) return\n pendingCaret.current = null\n innerRef.current?.setSelectionRange(pos, pos)\n })\n\n const resolvedError = error ?? bound?.error ?? false\n const resolvedHelperText = helperText ?? bound?.helperText\n\n const commit = (next: number | null) => {\n if (!isControlled) setInternal(next)\n if (isFormBound) form!.setValue(name!, next)\n onChange?.(next)\n }\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n const el = event.target\n const raw = el.value\n\n if (thousandSeparator == null) {\n if (raw !== '' && !NUMERIC_RE.test(raw)) return // reject non-numeric keystrokes\n setText(raw)\n commit(parseValue(raw))\n return\n }\n\n // Live grouping: strip separators, validate, regroup, and remember where the caret should land.\n const sep = thousandSeparator\n const cleaned = raw.split(sep).join('')\n if (cleaned !== '' && !NUMERIC_RE.test(cleaned)) return\n const caret = el.selectionStart ?? raw.length\n const significantBefore = countExcept(raw.slice(0, caret), sep)\n const next = parseValue(cleaned)\n const formatted = next == null ? cleaned : groupThousands(next, sep)\n setText(formatted)\n commit(next)\n pendingCaret.current = positionAfterExcept(formatted, sep, significantBefore)\n }\n\n const handleBlur = (event: FocusEvent<HTMLInputElement>) => {\n if (numValue != null) {\n const clamped = clampValue(numValue, min, max)\n if (clamped !== numValue) commit(clamped)\n }\n bound?.onBlur(event)\n onBlur?.(event)\n }\n\n const stepBy = (direction: 1 | -1) => {\n const base = numValue ?? min ?? 0\n commit(clampValue(roundStep(base + direction * step), min, max))\n }\n\n const atMax = max != null && numValue != null && numValue >= max\n const atMin = min != null && numValue != null && numValue <= min\n\n return (\n <div\n className={clsx(\n fieldStyles.field,\n fieldStyles[size],\n fullWidth && fieldStyles.fullWidth,\n resolvedError && fieldStyles.error,\n disabled && fieldStyles.disabled,\n className,\n )}\n style={style as CSSProperties}\n >\n {label != null && (\n <label htmlFor={id} className={fieldStyles.label}>\n <Typography as=\"span\" variant=\"bodySmall\" color=\"muted\">\n {label}\n </Typography>\n {required && (\n <span className={fieldStyles.required} aria-hidden=\"true\">\n *\n </span>\n )}\n </label>\n )}\n\n <div className={clsx(fieldStyles.control, !hideStepper && fieldStyles.hasRightAdornment)}>\n <input\n ref={setInputRef}\n id={id}\n name={name}\n type=\"text\"\n inputMode=\"decimal\"\n className={fieldStyles.input}\n value={text}\n onChange={handleChange}\n onBlur={handleBlur}\n disabled={disabled}\n aria-invalid={resolvedError || undefined}\n aria-describedby={resolvedHelperText != null ? helperId : undefined}\n {...props}\n />\n {!hideStepper && (\n <>\n {/* Filled icon buttons, sized via the shared `.control .iconButton` rule (flush square,\n stretched to the control height, scaled). The minus glyph is nudged for optical centering. */}\n <IconButton\n variant=\"filled\"\n color=\"primary\"\n className={fieldStyles.iconButton}\n style={{ marginRight: -2 }}\n disabled={disabled || atMin}\n aria-label={t('numberField.decrease')}\n onMouseDown={(event) => event.preventDefault()}\n onClick={() => stepBy(-1)}\n >\n <Icon name=\"Minus\" />\n </IconButton>\n <IconButton\n variant=\"filled\"\n color=\"primary\"\n className={fieldStyles.iconButton}\n disabled={disabled || atMax}\n aria-label={t('numberField.increase')}\n onMouseDown={(event) => event.preventDefault()}\n onClick={() => stepBy(1)}\n >\n <Icon name=\"Add\" />\n </IconButton>\n </>\n )}\n </div>\n\n {resolvedHelperText != null && (\n <Typography\n as=\"span\"\n id={helperId}\n variant=\"bodySmall\"\n color={resolvedError ? 'error' : 'muted'}\n className={fieldStyles.helper}\n >\n {resolvedHelperText}\n </Typography>\n )}\n </div>\n )\n})\n"],"names":["NUMERIC_RE","parseValue","raw","clampValue","n","min","max","roundStep","groupThousands","value","separator","intPart","decPart","sign","grouped","countExcept","s","sep","c","positionAfterExcept","str","count","i","NumberField","forwardRef","label","size","error","helperText","required","fullWidth","defaultValue","onChange","step","hideStepper","thousandSeparator","name","onBlur","disabled","idProp","className","style","props","ref","t","useT","reactId","useId","id","helperId","form","useFormContext","isFormBound","bound","externalValue","isControlled","internal","setInternal","useState","numValue","toDisplay","v","fromDisplay","text","setText","useEffect","innerRef","useRef","pendingCaret","setInputRef","useCallback","node","useLayoutEffect","pos","_a","resolvedError","resolvedHelperText","commit","next","handleChange","event","el","cleaned","caret","significantBefore","formatted","handleBlur","clamped","stepBy","direction","atMax","atMin","jsxs","clsx","fieldStyles","jsx","Typography","Fragment","IconButton","Icon"],"mappings":";;;;;;;;;AA0BA,MAAMA,IAAa;AAGnB,SAASC,EAAWC,GAA4B;AAC9C,MAAIA,MAAQ,MAAMA,MAAQ,OAAOA,MAAQ,OAAOA,MAAQ,KAAM,QAAO;AACrE,QAAM,IAAI,OAAOA,CAAG;AACpB,SAAO,OAAO,MAAM,CAAC,IAAI,OAAO;AAClC;AAEA,SAASC,EAAWC,GAAWC,GAAcC,GAAsB;AACjE,SAAID,KAAO,QAAQD,IAAIC,IAAYA,IAC/BC,KAAO,QAAQF,IAAIE,IAAYA,IAC5BF;AACT;AAGA,SAASG,GAAUH,GAAmB;AACpC,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,UAAA;AAAA,YAAA,gBAAAF;AAAA,cAACG;AAAA,cAAA;AAAA,gBACC,SAAQ;AAAA,gBACR,OAAM;AAAA,gBACN,WAAWJ,EAAY;AAAA,gBACvB,OAAO,EAAE,aAAa,GAAA;AAAA,gBACtB,UAAUxD,KAAYqD;AAAA,gBACtB,cAAY/C,EAAE,sBAAsB;AAAA,gBACpC,aAAa,CAACoC,MAAUA,EAAM,eAAA;AAAA,gBAC9B,SAAS,MAAMQ,EAAO,EAAE;AAAA,gBAExB,UAAA,gBAAAO,EAACI,GAAA,EAAK,MAAK,QAAA,CAAQ;AAAA,cAAA;AAAA,YAAA;AAAA,YAErB,gBAAAJ;AAAA,cAACG;AAAA,cAAA;AAAA,gBACC,SAAQ;AAAA,gBACR,OAAM;AAAA,gBACN,WAAWJ,EAAY;AAAA,gBACvB,UAAUxD,KAAYoD;AAAA,gBACtB,cAAY9C,EAAE,sBAAsB;AAAA,gBACpC,aAAa,CAACoC,MAAUA,EAAM,eAAA;AAAA,gBAC9B,SAAS,MAAMQ,EAAO,CAAC;AAAA,gBAEvB,UAAA,gBAAAO,EAACI,GAAA,EAAK,MAAK,MAAA,CAAM;AAAA,cAAA;AAAA,YAAA;AAAA,UACnB,EAAA,CACF;AAAA,QAAA,GAEJ;AAAA,QAECvB,KAAsB,QACrB,gBAAAmB;AAAA,UAACC;AAAA,UAAA;AAAA,YACC,IAAG;AAAA,YACH,IAAI/C;AAAA,YACJ,SAAQ;AAAA,YACR,OAAO0B,IAAgB,UAAU;AAAA,YACjC,WAAWmB,EAAY;AAAA,YAEtB,UAAAlB;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EAAA;AAIR,CAAC;"}
1
+ {"version":3,"file":"NumberField-DHFGNQjZ.js","sources":["../src/components/NumberField/NumberField.tsx"],"sourcesContent":["import {\n forwardRef,\n useCallback,\n useEffect,\n useId,\n useLayoutEffect,\n useRef,\n useState,\n type ChangeEvent,\n type CSSProperties,\n type FocusEvent,\n type InputHTMLAttributes,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { useFormContext } from '../../form/formContext'\nimport { useT } from '../../theme'\nimport { Icon } from '../Icon'\nimport { IconButton } from '../IconButton'\nimport { Typography } from '../Typography'\n// shared field chrome (label/control/helper) AND the `.control .iconButton` styling for the steppers\nimport fieldStyles from '../TextField/TextField.module.css'\n\nexport type NumberFieldSize = 'sm' | 'md' | 'lg'\n\n/** Allowed while typing — digits, an optional leading `-`, and one decimal point. */\nconst NUMERIC_RE = /^-?\\d*\\.?\\d*$/\n\n/** Parses the display string to a number, treating empty / in-progress input (`\"\"`, `\"-\"`, `\".\"`) as null. */\nfunction parseValue(raw: string): number | null {\n if (raw === '' || raw === '-' || raw === '.' || raw === '-.') return null\n const n = Number(raw)\n return Number.isNaN(n) ? null : n\n}\n\nfunction clampValue(n: number, min?: number, max?: number): number {\n if (min != null && n < min) return min\n if (max != null && n > max) return max\n return n\n}\n\n/** Kills binary float drift from repeated stepping (e.g. 0.1 + 0.2). */\nfunction roundStep(n: number): number {\n return Math.round(n * 1e6) / 1e6\n}\n\n/** Groups the integer part with `separator` for display (e.g. 32345345 → \"32.345.345\"). */\nfunction groupThousands(value: number, separator: string): string {\n const [intPart, decPart] = String(value).split('.')\n const sign = intPart.startsWith('-') ? '-' : ''\n const digits = sign ? intPart.slice(1) : intPart\n const grouped = digits.replace(/\\B(?=(\\d{3})+(?!\\d))/g, separator)\n return decPart != null ? `${sign}${grouped}.${decPart}` : `${sign}${grouped}`\n}\n\n/** Counts the \"significant\" (non-separator) chars — used to keep the caret stable across regrouping. */\nfunction countExcept(s: string, sep: string): number {\n let n = 0\n for (const c of s) if (c !== sep) n++\n return n\n}\n\n/** Index just after the `n`-th non-separator char in `str` (where the caret should land after regrouping). */\nfunction positionAfterExcept(str: string, sep: string, n: number): number {\n if (n <= 0) return 0\n let count = 0\n for (let i = 0; i < str.length; i++) {\n if (str[i] !== sep) {\n count += 1\n if (count === n) return i + 1\n }\n }\n return str.length\n}\n\nexport interface NumberFieldProps extends Omit<\n InputHTMLAttributes<HTMLInputElement>,\n 'size' | 'value' | 'defaultValue' | 'onChange' | 'type' | 'min' | 'max' | 'step' | 'prefix'\n> {\n /** Label rendered above the field. */\n label?: ReactNode\n /** Preset size — drives the control height, font size and padding. */\n size?: NumberFieldSize\n /** Marks the field invalid: red border/focus ring + the `helperText` in the error color. */\n error?: boolean\n /** Helper / validation text under the field. Adopts the error color while `error`. */\n helperText?: ReactNode\n /** Adds a red asterisk after the label. */\n required?: boolean\n /** Stretches the field to fill its container width. Defaults to `true`. */\n fullWidth?: boolean\n /** Controlled numeric value (`null` = empty). */\n value?: number | null\n /** Initial value for uncontrolled use (`null` = empty). Defaults to `null`. */\n defaultValue?: number | null\n /** Fires with the parsed numeric value (or `null` when the field is empty). */\n onChange?: (value: number | null) => void\n /** Minimum value — clamps on blur and on the stepper, and disables `−` at the floor. Defaults to `0`; pass a negative `min` to allow negatives. */\n min?: number\n /** Maximum value — clamps on blur and on the stepper, and disables `+` at the ceiling. */\n max?: number\n /** Amount the `+`/`−` buttons add or subtract. Defaults to `1`. */\n step?: number\n /** Hides the `+`/`−` stepper buttons (keyboard entry only). */\n hideStepper?: boolean\n /**\n * Thousands-group separator shown **live** as you type, e.g. `\".\"` displays `32345345` as\n * `32.345.345` (or `\",\"`). The caret is preserved across regrouping; the `value`/`onChange`/form\n * value stay a plain `number`. Best for integers — with `\".\"` decimals aren't supported (the dot is\n * the group separator).\n */\n thousandSeparator?: string\n}\n\n/**\n * A numeric input with `+`/`−` stepper buttons. Supports `min`/`max` clamping, a `step` amount,\n * controlled (`value` + `onChange`) or uncontrolled (`defaultValue`) use, optional live thousands\n * grouping, and — like `TextField` — binds to a surrounding `<Form>` by `name` (its form value is a\n * real `number`, validated by the Zod schema). `onChange` emits a `number` or `null` (empty). Shares\n * `TextField`'s field chrome, so label, sizing, error and focus styling are identical.\n */\nexport const NumberField = forwardRef<HTMLInputElement, NumberFieldProps>(function NumberField(\n {\n label,\n size = 'md',\n error,\n helperText,\n required = false,\n fullWidth = true,\n value,\n defaultValue = null,\n onChange,\n min = 0,\n max,\n step = 1,\n hideStepper = false,\n thousandSeparator,\n name,\n onBlur,\n disabled = false,\n id: idProp,\n className,\n style,\n ...props\n },\n ref,\n) {\n const t = useT()\n const reactId = useId()\n const id = idProp ?? reactId\n const helperId = `${id}-helper`\n\n // Auto-bind to a surrounding <Form> by `name`. The form stores a real number; we use field() for\n // touched/error/helper and read/write the numeric value through values/setValue.\n const form = useFormContext()\n const isFormBound = Boolean(form && name)\n const bound = form && name ? form.field(name) : undefined\n\n const externalValue: number | null | undefined =\n value !== undefined\n ? value\n : isFormBound\n ? ((form!.values[name!] as number | null | undefined) ?? null)\n : undefined\n const isControlled = externalValue !== undefined\n const [internal, setInternal] = useState<number | null>(defaultValue)\n const numValue: number | null = isControlled ? externalValue! : internal\n\n // number <-> display string, applying live thousands grouping when `thousandSeparator` is set.\n const toDisplay = (v: number | null): string =>\n v == null ? '' : thousandSeparator != null ? groupThousands(v, thousandSeparator) : String(v)\n const fromDisplay = (raw: string): number | null =>\n parseValue(thousandSeparator != null ? raw.split(thousandSeparator).join('') : raw)\n\n // The display string mirrors `numValue` but tolerates in-progress input (\"-\", \"1.\" …).\n const [text, setText] = useState<string>(() => toDisplay(numValue))\n useEffect(() => {\n if (fromDisplay(text) !== numValue) setText(toDisplay(numValue))\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [numValue]) // re-sync only when the value changes from the outside (stepper, form, reset)\n\n // Caret restoration after regrouping (the formatted string length changes as separators move).\n const innerRef = useRef<HTMLInputElement>(null)\n const pendingCaret = useRef<number | null>(null)\n const setInputRef = useCallback(\n (node: HTMLInputElement | null) => {\n innerRef.current = node\n if (typeof ref === 'function') ref(node)\n else if (ref) ref.current = node\n },\n [ref],\n )\n useLayoutEffect(() => {\n const pos = pendingCaret.current\n if (pos == null) return\n pendingCaret.current = null\n innerRef.current?.setSelectionRange(pos, pos)\n })\n\n const resolvedError = error ?? bound?.error ?? false\n const resolvedHelperText = helperText ?? bound?.helperText\n\n const commit = (next: number | null) => {\n if (!isControlled) setInternal(next)\n if (isFormBound) form!.setValue(name!, next)\n onChange?.(next)\n }\n\n const handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n const el = event.target\n const raw = el.value\n\n if (thousandSeparator == null) {\n if (raw !== '' && !NUMERIC_RE.test(raw)) return // reject non-numeric keystrokes\n setText(raw)\n commit(parseValue(raw))\n return\n }\n\n // Live grouping: strip separators, validate, regroup, and remember where the caret should land.\n const sep = thousandSeparator\n const cleaned = raw.split(sep).join('')\n if (cleaned !== '' && !NUMERIC_RE.test(cleaned)) return\n const caret = el.selectionStart ?? raw.length\n const significantBefore = countExcept(raw.slice(0, caret), sep)\n const next = parseValue(cleaned)\n const formatted = next == null ? cleaned : groupThousands(next, sep)\n setText(formatted)\n commit(next)\n pendingCaret.current = positionAfterExcept(formatted, sep, significantBefore)\n }\n\n const handleBlur = (event: FocusEvent<HTMLInputElement>) => {\n if (numValue != null) {\n const clamped = clampValue(numValue, min, max)\n if (clamped !== numValue) commit(clamped)\n }\n bound?.onBlur(event)\n onBlur?.(event)\n }\n\n const stepBy = (direction: 1 | -1) => {\n const base = numValue ?? min ?? 0\n commit(clampValue(roundStep(base + direction * step), min, max))\n }\n\n const atMax = max != null && numValue != null && numValue >= max\n const atMin = min != null && numValue != null && numValue <= min\n\n return (\n <div\n className={clsx(\n fieldStyles.field,\n fieldStyles[size],\n fullWidth && fieldStyles.fullWidth,\n resolvedError && fieldStyles.error,\n disabled && fieldStyles.disabled,\n className,\n )}\n style={style as CSSProperties}\n >\n {label != null && (\n <label htmlFor={id} className={fieldStyles.label}>\n <Typography as=\"span\" variant=\"bodySmall\" color=\"muted\">\n {label}\n </Typography>\n {required && (\n <span className={fieldStyles.required} aria-hidden=\"true\">\n *\n </span>\n )}\n </label>\n )}\n\n <div className={clsx(fieldStyles.control, !hideStepper && fieldStyles.hasRightAdornment)}>\n <input\n ref={setInputRef}\n id={id}\n name={name}\n type=\"text\"\n inputMode=\"decimal\"\n className={fieldStyles.input}\n value={text}\n onChange={handleChange}\n onBlur={handleBlur}\n disabled={disabled}\n aria-invalid={resolvedError || undefined}\n aria-describedby={resolvedHelperText != null ? helperId : undefined}\n {...props}\n />\n {!hideStepper && (\n <>\n {/* Filled icon buttons, sized via the shared `.control .iconButton` rule (flush square,\n stretched to the control height, scaled). The minus glyph is nudged for optical centering. */}\n <IconButton\n variant=\"filled\"\n color=\"primary\"\n className={fieldStyles.iconButton}\n style={{ marginRight: -2 }}\n disabled={disabled || atMin}\n aria-label={t('numberField.decrease')}\n onMouseDown={(event) => event.preventDefault()}\n onClick={() => stepBy(-1)}\n >\n <Icon name=\"Minus\" />\n </IconButton>\n <IconButton\n variant=\"filled\"\n color=\"primary\"\n className={fieldStyles.iconButton}\n disabled={disabled || atMax}\n aria-label={t('numberField.increase')}\n onMouseDown={(event) => event.preventDefault()}\n onClick={() => stepBy(1)}\n >\n <Icon name=\"Add\" />\n </IconButton>\n </>\n )}\n </div>\n\n {resolvedHelperText != null && (\n <Typography\n as=\"span\"\n id={helperId}\n variant=\"bodySmall\"\n color={resolvedError ? 'error' : 'muted'}\n className={fieldStyles.helper}\n >\n {resolvedHelperText}\n </Typography>\n )}\n </div>\n )\n})\n"],"names":["NUMERIC_RE","parseValue","raw","clampValue","n","min","max","roundStep","groupThousands","value","separator","intPart","decPart","sign","grouped","countExcept","s","sep","c","positionAfterExcept","str","count","i","NumberField","forwardRef","label","size","error","helperText","required","fullWidth","defaultValue","onChange","step","hideStepper","thousandSeparator","name","onBlur","disabled","idProp","className","style","props","ref","t","useT","reactId","useId","id","helperId","form","useFormContext","isFormBound","bound","externalValue","isControlled","internal","setInternal","useState","numValue","toDisplay","v","fromDisplay","text","setText","useEffect","innerRef","useRef","pendingCaret","setInputRef","useCallback","node","useLayoutEffect","pos","_a","resolvedError","resolvedHelperText","commit","next","handleChange","event","el","cleaned","caret","significantBefore","formatted","handleBlur","clamped","stepBy","direction","atMax","atMin","jsxs","clsx","fieldStyles","jsx","Typography","Fragment","IconButton","Icon"],"mappings":";;;;;;;;;AA0BA,MAAMA,IAAa;AAGnB,SAASC,EAAWC,GAA4B;AAC9C,MAAIA,MAAQ,MAAMA,MAAQ,OAAOA,MAAQ,OAAOA,MAAQ,KAAM,QAAO;AACrE,QAAM,IAAI,OAAOA,CAAG;AACpB,SAAO,OAAO,MAAM,CAAC,IAAI,OAAO;AAClC;AAEA,SAASC,EAAWC,GAAWC,GAAcC,GAAsB;AACjE,SAAID,KAAO,QAAQD,IAAIC,IAAYA,IAC/BC,KAAO,QAAQF,IAAIE,IAAYA,IAC5BF;AACT;AAGA,SAASG,GAAUH,GAAmB;AACpC,SAAO,KAAK,MAAMA,IAAI,GAAG,IAAI;AAC/B;AAGA,SAASI,GAAeC,GAAeC,GAA2B;AAChE,QAAM,CAACC,GAASC,CAAO,IAAI,OAAOH,CAAK,EAAE,MAAM,GAAG,GAC5CI,IAAOF,EAAQ,WAAW,GAAG,IAAI,MAAM,IAEvCG,KADSD,IAAOF,EAAQ,MAAM,CAAC,IAAIA,GAClB,QAAQ,yBAAyBD,CAAS;AACjE,SAAOE,KAAW,OAAO,GAAGC,CAAI,GAAGC,CAAO,IAAIF,CAAO,KAAK,GAAGC,CAAI,GAAGC,CAAO;AAC7E;AAGA,SAASC,GAAYC,GAAWC,GAAqB;AACnD,MAAIb,IAAI;AACR,aAAWc,KAAKF,EAAG,CAAIE,MAAMD,KAAKb;AAClC,SAAOA;AACT;AAGA,SAASe,GAAoBC,GAAaH,GAAab,GAAmB;AACxE,MAAIA,KAAK,EAAG,QAAO;AACnB,MAAIiB,IAAQ;AACZ,WAASC,IAAI,GAAGA,IAAIF,EAAI,QAAQE;AAC9B,QAAIF,EAAIE,CAAC,MAAML,MACbI,KAAS,GACLA,MAAUjB;AAAG,aAAOkB,IAAI;AAGhC,SAAOF,EAAI;AACb;AAgDO,MAAMG,KAAcC,G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AA,CACF;AAAA,QAAA,GAEJ;AAAA,QAECvB,KAAsB,QACrB,gBAAAmB;AAAA,UAACC;AAAA,UAAA;AAAA,YACC,IAAG;AAAA,YACH,IAAI/C;AAAA,YACJ,SAAQ;AAAA,YACR,OAAO0B,IAAgB,UAAU;AAAA,YACjC,WAAWmB,EAAY;AAAA,YAEtB,UAAAlB;AAAA,UAAA;AAAA,QAAA;AAAA,MACH;AAAA,IAAA;AAAA,EAAA;AAIR,CAAC;"}
@@ -0,0 +1,2 @@
1
+ "use strict";const i=require("react/jsx-runtime"),y=require("react"),k=require("clsx"),ee=require("./formContext-bTWrqdEV.cjs"),A=require("./Typography-d97DdbNd.cjs"),f=require("./TextField.module-DsNCo8vN.cjs"),te=require("./ConfigProvider-Cf-awvZs.cjs"),re="_row_u40i0_2",se="_center_u40i0_14",oe="_end_u40i0_15",le="_sm_u40i0_27",ce="_md_u40i0_31",ie="_lg_u40i0_35",ne="_box_u40i0_41",ae="_filled_u40i0_65",ue="_invalid_u40i0_84",p={row:re,center:se,end:oe,sm:le,md:ce,lg:ie,box:ne,filled:ae,invalid:ue},de={numeric:/[0-9]/,alphabetic:/[A-Za-z]/,alphanumeric:/[A-Za-z0-9]/};function fe(F,l){const n=[...F].slice(0,l);for(;n.length<l;)n.push("");return n}const pe=y.forwardRef(function({length:l=4,type:n="numeric",value:g,defaultValue:I,onChange:b,onComplete:T,name:a,label:x,helperText:z,error:P,required:C=!1,disabled:S=!1,autoFocus:E=!1,placeholder:M,size:O="md",align:V="start",color:K="primary",className:Z,style:$},H){const q=te.useT(),B=`${y.useId()}-helper`,N=de[n],h=ee.useFormContext(),w=!!(h&&a),o=h&&a?h.field(a):void 0,L=g!==void 0?g:w?h.values[a]:void 0,R=g!==void 0||w,[G,J]=y.useState(I??""),Q=R?L??"":G,v=P??(o==null?void 0:o.error)??!1,D=z??(o==null?void 0:o.helperText),u=fe(Q,l),j=y.useRef([]);y.useEffect(()=>{var t;E&&((t=j.current[0])==null||t.focus())},[]);const d=t=>{const e=j.current[Math.max(0,Math.min(t,l-1))];e==null||e.focus(),e==null||e.select()},m=t=>{const e=t.join("");R||J(e),w&&h.setValue(a,e),b==null||b(e),t.every(r=>r!=="")&&(T==null||T(e))},U=(t,e)=>{const r=[...e].filter(s=>N.test(s));if(e!==""&&r.length===0)return;const c=[...u];if(r.length<=1)c[t]=r[0]??"",m(c),r[0]&&d(t+1);else{let s=t;for(const _ of r){if(s>=l)break;c[s]=_,s++}m(c),d(s)}},W=(t,e)=>{if(e.key==="Backspace"){if(u[t]===""&&t>0){e.preventDefault();const r=[...u];r[t-1]="",m(r),d(t-1)}}else if(e.key==="ArrowLeft")e.preventDefault(),d(t-1);else if(e.key==="ArrowRight")e.preventDefault(),d(t+1);else if(e.key==="Delete"){e.preventDefault();const r=[...u];r[t]="",m(r)}},X=(t,e)=>{e.preventDefault();const r=[...e.clipboardData.getData("text")].filter(_=>N.test(_));if(r.length===0)return;const c=[...u];let s=t;for(const _ of r){if(s>=l)break;c[s]=_,s++}m(c),d(s)},Y=t=>{t.currentTarget.contains(t.relatedTarget)||o==null||o.onBlur(t)};return i.jsxs("div",{ref:H,className:k.clsx(f.fieldStyles.field,v&&f.fieldStyles.error,S&&f.fieldStyles.disabled,Z),style:{"--tz-btn-rgb":`var(--tz-color-${K}-rgb)`,...$},children:[x!=null&&i.jsxs("span",{className:f.fieldStyles.label,children:[i.jsx(A.Typography,{as:"span",variant:"bodySmall",color:"muted",children:x}),C&&i.jsx("span",{className:f.fieldStyles.required,"aria-hidden":"true",children:"*"})]}),i.jsx("div",{role:"group","aria-label":typeof x=="string"?x:q("otpField.label"),"aria-invalid":v||void 0,"aria-describedby":D!=null?B:void 0,className:k.clsx(p.row,p[O],p[V],v&&p.invalid),onBlur:Y,children:u.map((t,e)=>i.jsx("input",{ref:r=>{j.current[e]=r},name:e===0?a:void 0,type:"text",inputMode:n==="numeric"?"numeric":"text",autoComplete:e===0?"one-time-code":"off","aria-label":q("otpField.digit",{index:e+1,total:l}),className:k.clsx(p.box,t!==""&&p.filled),value:t,placeholder:M,disabled:S,onChange:r=>U(e,r.target.value),onKeyDown:r=>W(e,r),onPaste:r=>X(e,r),onFocus:r=>r.target.select()},e))}),D!=null&&i.jsx(A.Typography,{as:"span",id:B,variant:"bodySmall",color:v?"error":"muted",className:f.fieldStyles.helper,children:D})]})});exports.OtpField=pe;
2
+ //# sourceMappingURL=OtpField-CIy5OtXI.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"OtpField-Drjy2wwq.cjs","sources":["../src/components/OtpField/OtpField.tsx"],"sourcesContent":["import {\n forwardRef,\n useEffect,\n useId,\n useRef,\n useState,\n type ClipboardEvent,\n type CSSProperties,\n type FocusEvent,\n type KeyboardEvent,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { useFormContext } from '../../form/formContext'\nimport { useT, type ThemeColor } from '../../theme'\nimport { Typography } from '../Typography'\nimport fieldStyles from '../TextField/TextField.module.css'\nimport styles from './OtpField.module.css'\n\nexport type OtpFieldSize = 'sm' | 'md' | 'lg'\n/** Which characters the code accepts. */\nexport type OtpFieldType = 'numeric' | 'alphabetic' | 'alphanumeric'\n\nexport type OtpFieldAlign = 'start' | 'center' | 'end'\n\n/** Allowed-character matcher per `type`. */\nconst PATTERN: Record<OtpFieldType, RegExp> = {\n numeric: /[0-9]/,\n alphabetic: /[A-Za-z]/,\n alphanumeric: /[A-Za-z0-9]/,\n}\n\n/** Split a code string into exactly `length` single-char slots, padded with empties. */\nfunction toChars(value: string, length: number): string[] {\n const out = [...value].slice(0, length)\n while (out.length < length) out.push('')\n return out\n}\n\nexport interface OtpFieldProps {\n /** Number of input boxes (the code length). Defaults to `4`. */\n length?: number\n /** Which characters are accepted (also drives the mobile keyboard). Defaults to `'numeric'`. */\n type?: OtpFieldType\n /** Controlled value — the concatenated code string. */\n value?: string\n /** Initial value for uncontrolled use. */\n defaultValue?: string\n /** Fires with the full code string on every change. */\n onChange?: (value: string) => void\n /** Fires with the code once every box is filled. */\n onComplete?: (value: string) => void\n /** Field name — the `<Form>` binding key (form value is the code `string`). */\n name?: string\n /** Label rendered above the boxes. */\n label?: ReactNode\n /** Helper / error text under the boxes (shown in the error color while `error`). */\n helperText?: ReactNode\n /** Marks the field invalid — reddens the boxes + helper. */\n error?: boolean\n /** Adds a red asterisk after the label. */\n required?: boolean\n /** Disables every box. */\n disabled?: boolean\n /** Focus the first box on mount. */\n autoFocus?: boolean\n /** Placeholder character shown in empty boxes (e.g. `'•'`). */\n placeholder?: string\n /** Preset size. Defaults to `'md'`. */\n size?: OtpFieldSize\n /** Horizontal alignment of the boxes within the field. Defaults to `'start'` (left). */\n align?: OtpFieldAlign\n /** Theme palette token for the focus ring / active box. Defaults to `'primary'`. */\n color?: ThemeColor\n className?: string\n style?: CSSProperties\n}\n\n/**\n * A one-time-passcode input — a row of single-character boxes for verification codes. **`length`**\n * (default `4`) sets the box count; **`type`** (`'numeric'` default · `'alphabetic'` · `'alphanumeric'`)\n * restricts the accepted characters and the mobile keyboard. Typing advances to the next box, Backspace\n * clears the box (in an empty box: clears the previous one and steps back), Arrows navigate, and **paste / SMS autofill** (`autocomplete=\"one-time-code\"`)\n * distributes the whole code across the boxes. The value is the concatenated string — controlled\n * (`value` + `onChange`) or uncontrolled (`defaultValue`); **`onComplete`** fires when all boxes are\n * filled. Shares the field-family chrome (`label` · `error` + `helperText` · `required` · `disabled` ·\n * `size`) and binds to a surrounding `<Form>` by **`name`** (form value = the code string; validate with\n * e.g. `z.string().length(4)` or a `type`-matching regex). Tinted by `color` via the shared\n * `--tz-btn-rgb` pattern; `role=\"group\"` with per-box `aria-label`s. Own CSS module (+ TextField's for\n * the label/helper chrome).\n */\nexport const OtpField = forwardRef<HTMLDivElement, OtpFieldProps>(function OtpField(\n {\n length = 4,\n type = 'numeric',\n value,\n defaultValue,\n onChange,\n onComplete,\n name,\n label,\n helperText,\n error,\n required = false,\n disabled = false,\n autoFocus = false,\n placeholder,\n size = 'md',\n align = 'start',\n color = 'primary',\n className,\n style,\n },\n ref,\n) {\n const t = useT()\n const reactId = useId()\n const helperId = `${reactId}-helper`\n const allowed = PATTERN[type]\n\n // bind to a surrounding <Form> by `name` — form value is the code string; error/touched via field()\n const form = useFormContext()\n const isFormBound = Boolean(form && name)\n const bound = form && name ? form.field(name) : undefined\n\n const externalValue =\n value !== undefined ? value : isFormBound ? (form!.values[name!] as string) : undefined\n const isControlled = value !== undefined || isFormBound\n const [internal, setInternal] = useState<string>(defaultValue ?? '')\n const currentValue = isControlled ? (externalValue ?? '') : internal\n\n const resolvedError = error ?? bound?.error ?? false\n const resolvedHelperText = helperText ?? bound?.helperText\n\n // the code split into exactly `length` single-char slots (padded with empties)\n const chars = toChars(currentValue, length)\n\n const inputsRef = useRef<(HTMLInputElement | null)[]>([])\n\n useEffect(() => {\n if (autoFocus) inputsRef.current[0]?.focus()\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n const focusBox = (i: number) => {\n const el = inputsRef.current[Math.max(0, Math.min(i, length - 1))]\n el?.focus()\n el?.select()\n }\n\n const commit = (nextChars: string[]) => {\n const next = nextChars.join('')\n if (!isControlled) setInternal(next)\n if (isFormBound) form!.setValue(name!, next)\n onChange?.(next)\n if (nextChars.every((c) => c !== '')) onComplete?.(next)\n }\n\n const handleChange = (index: number, raw: string) => {\n const filtered = [...raw].filter((c) => allowed.test(c))\n // a disallowed keystroke (raw non-empty but nothing survives the filter) is ignored\n if (raw !== '' && filtered.length === 0) return\n const nextChars = [...chars]\n if (filtered.length <= 1) {\n // a single typed char (boxes select-on-focus, so this replaces) — or a clear ('')\n nextChars[index] = filtered[0] ?? ''\n commit(nextChars)\n if (filtered[0]) focusBox(index + 1)\n } else {\n // multiple chars (SMS autofill dumps the whole code into one box) → distribute from here\n let k = index\n for (const ch of filtered) {\n if (k >= length) break\n nextChars[k] = ch\n k++\n }\n commit(nextChars)\n focusBox(k)\n }\n }\n\n const handleKeyDown = (index: number, event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Backspace') {\n if (chars[index] === '' && index > 0) {\n // empty box → step back and clear the previous one\n event.preventDefault()\n const nextChars = [...chars]\n nextChars[index - 1] = ''\n commit(nextChars)\n focusBox(index - 1)\n }\n // a non-empty box lets the native delete run → onChange fires with '' (stays put)\n } else if (event.key === 'ArrowLeft') {\n event.preventDefault()\n focusBox(index - 1)\n } else if (event.key === 'ArrowRight') {\n event.preventDefault()\n focusBox(index + 1)\n } else if (event.key === 'Delete') {\n event.preventDefault()\n const nextChars = [...chars]\n nextChars[index] = ''\n commit(nextChars)\n }\n }\n\n const handlePaste = (index: number, event: ClipboardEvent<HTMLInputElement>) => {\n event.preventDefault()\n const filtered = [...event.clipboardData.getData('text')].filter((c) => allowed.test(c))\n if (filtered.length === 0) return\n const nextChars = [...chars]\n let k = index\n for (const ch of filtered) {\n if (k >= length) break\n nextChars[k] = ch\n k++\n }\n commit(nextChars)\n focusBox(k)\n }\n\n // mark the field touched when focus leaves the whole widget (not when it hops between boxes)\n const handleBlur = (event: FocusEvent<HTMLDivElement>) => {\n if (!event.currentTarget.contains(event.relatedTarget as Node | null)) {\n bound?.onBlur(event as unknown as FocusEvent<HTMLInputElement>)\n }\n }\n\n return (\n <div\n ref={ref}\n className={clsx(\n fieldStyles.field,\n resolvedError && fieldStyles.error,\n disabled && fieldStyles.disabled,\n className,\n )}\n style={\n {\n '--tz-btn-rgb': `var(--tz-color-${color}-rgb)`,\n ...style,\n } as CSSProperties\n }\n >\n {label != null && (\n <span className={fieldStyles.label}>\n <Typography as=\"span\" variant=\"bodySmall\" color=\"muted\">\n {label}\n </Typography>\n {required && (\n <span className={fieldStyles.required} aria-hidden=\"true\">\n *\n </span>\n )}\n </span>\n )}\n\n <div\n role=\"group\"\n aria-label={typeof label === 'string' ? label : t('otpField.label')}\n aria-invalid={resolvedError || undefined}\n aria-describedby={resolvedHelperText != null ? helperId : undefined}\n className={clsx(styles.row, styles[size], styles[align], resolvedError && styles.invalid)}\n onBlur={handleBlur}\n >\n {chars.map((char, i) => (\n <input\n key={i}\n ref={(el) => {\n inputsRef.current[i] = el\n }}\n // the name goes on the first box only, so the form's scroll-to-error can target it\n name={i === 0 ? name : undefined}\n type=\"text\"\n inputMode={type === 'numeric' ? 'numeric' : 'text'}\n autoComplete={i === 0 ? 'one-time-code' : 'off'}\n aria-label={t('otpField.digit', { index: i + 1, total: length })}\n className={clsx(styles.box, char !== '' && styles.filled)}\n value={char}\n placeholder={placeholder}\n disabled={disabled}\n onChange={(e) => handleChange(i, e.target.value)}\n onKeyDown={(e) => handleKeyDown(i, e)}\n onPaste={(e) => handlePaste(i, e)}\n onFocus={(e) => e.target.select()}\n />\n ))}\n </div>\n\n {resolvedHelperText != null && (\n <Typography\n as=\"span\"\n id={helperId}\n variant=\"bodySmall\"\n color={resolvedError ? 'error' : 'muted'}\n className={fieldStyles.helper}\n >\n {resolvedHelperText}\n </Typography>\n )}\n </div>\n )\n})\n"],"names":["PATTERN","toChars","value","length","out","OtpField","forwardRef","type","defaultValue","onChange","onComplete","name","label","helperText","error","required","disabled","autoFocus","placeholder","size","align","color","className","style","ref","t","useT","helperId","useId","allowed","form","useFormContext","isFormBound","bound","externalValue","isControlled","internal","setInternal","useState","currentValue","resolvedError","resolvedHelperText","chars","inputsRef","useRef","useEffect","_a","focusBox","i","el","commit","nextChars","next","c","handleChange","index","raw","filtered","k","ch","handleKeyDown","event","handlePaste","handleBlur","jsxs","clsx","fieldStyles","jsx","Typography","styles","char","e"],"mappings":"2fA0BMA,GAAwC,CAC5C,QAAS,QACT,WAAY,WACZ,aAAc,aAChB,EAGA,SAASC,GAAQC,EAAeC,EAA0B,CACxD,MAAMC,EAAM,CAAC,GAAGF,CAAK,EAAE,MAAM,EAAGC,CAAM,EACtC,KAAOC,EAAI,OAASD,GAAQC,EAAI,KAAK,EAAE,EACvC,OAAOA,CACT,CAsDO,MAAMC,GAAWC,EAAAA,WAA0C,SAChE,CACE,OAAAH,EAAS,EACT,KAAAI,EAAO,UACP,M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ArB,EAAM,IAAI,CAAC4B,EAAMtB,IAChBmB,EAAAA,IAAC,QAAA,CAEC,IAAMlB,GAAO,CACXN,EAAU,QAAQK,CAAC,EAAIC,CACzB,EAEA,KAAMD,IAAM,EAAIrC,EAAO,OACvB,KAAK,OACL,UAAWJ,IAAS,UAAY,UAAY,OAC5C,aAAcyC,IAAM,EAAI,gBAAkB,MAC1C,aAAYvB,EAAE,iBAAkB,CAAE,MAAOuB,EAAI,EAAG,MAAO7C,EAAQ,EAC/D,UAAW8D,EAAAA,KAAKI,EAAO,IAAKC,IAAS,IAAMD,EAAO,MAAM,EACxD,MAAOC,EACP,YAAApD,EACA,SAAAF,EACA,SAAWuD,GAAMjB,EAAaN,EAAGuB,EAAE,OAAO,KAAK,EAC/C,UAAYA,GAAMX,EAAcZ,EAAGuB,CAAC,EACpC,QAAUA,GAAMT,EAAYd,EAAGuB,CAAC,EAChC,QAAUA,GAAMA,EAAE,OAAO,OAAA,CAAO,EAjB3BvB,CAAA,CAmBR,CAAA,CAAA,EAGFP,GAAsB,MACrB0B,EAAAA,IAACC,EAAAA,WAAA,CACC,GAAG,OACH,GAAIzC,EACJ,QAAQ,YACR,MAAOa,EAAgB,QAAU,QACjC,UAAW0B,EAAAA,YAAY,OAEtB,SAAAzB,CAAA,CAAA,CACH,CAAA,CAAA,CAIR,CAAC"}
1
+ {"version":3,"file":"OtpField-CIy5OtXI.cjs","sources":["../src/components/OtpField/OtpField.tsx"],"sourcesContent":["import {\n forwardRef,\n useEffect,\n useId,\n useRef,\n useState,\n type ClipboardEvent,\n type CSSProperties,\n type FocusEvent,\n type KeyboardEvent,\n type ReactNode,\n} from 'react'\nimport { clsx } from 'clsx'\nimport { useFormContext } from '../../form/formContext'\nimport { useT, type ThemeColor } from '../../theme'\nimport { Typography } from '../Typography'\nimport fieldStyles from '../TextField/TextField.module.css'\nimport styles from './OtpField.module.css'\n\nexport type OtpFieldSize = 'sm' | 'md' | 'lg'\n/** Which characters the code accepts. */\nexport type OtpFieldType = 'numeric' | 'alphabetic' | 'alphanumeric'\n\nexport type OtpFieldAlign = 'start' | 'center' | 'end'\n\n/** Allowed-character matcher per `type`. */\nconst PATTERN: Record<OtpFieldType, RegExp> = {\n numeric: /[0-9]/,\n alphabetic: /[A-Za-z]/,\n alphanumeric: /[A-Za-z0-9]/,\n}\n\n/** Split a code string into exactly `length` single-char slots, padded with empties. */\nfunction toChars(value: string, length: number): string[] {\n const out = [...value].slice(0, length)\n while (out.length < length) out.push('')\n return out\n}\n\nexport interface OtpFieldProps {\n /** Number of input boxes (the code length). Defaults to `4`. */\n length?: number\n /** Which characters are accepted (also drives the mobile keyboard). Defaults to `'numeric'`. */\n type?: OtpFieldType\n /** Controlled value — the concatenated code string. */\n value?: string\n /** Initial value for uncontrolled use. */\n defaultValue?: string\n /** Fires with the full code string on every change. */\n onChange?: (value: string) => void\n /** Fires with the code once every box is filled. */\n onComplete?: (value: string) => void\n /** Field name — the `<Form>` binding key (form value is the code `string`). */\n name?: string\n /** Label rendered above the boxes. */\n label?: ReactNode\n /** Helper / error text under the boxes (shown in the error color while `error`). */\n helperText?: ReactNode\n /** Marks the field invalid — reddens the boxes + helper. */\n error?: boolean\n /** Adds a red asterisk after the label. */\n required?: boolean\n /** Disables every box. */\n disabled?: boolean\n /** Focus the first box on mount. */\n autoFocus?: boolean\n /** Placeholder character shown in empty boxes (e.g. `'•'`). */\n placeholder?: string\n /** Preset size. Defaults to `'md'`. */\n size?: OtpFieldSize\n /** Horizontal alignment of the boxes within the field. Defaults to `'start'` (left). */\n align?: OtpFieldAlign\n /** Theme palette token for the focus ring / active box. Defaults to `'primary'`. */\n color?: ThemeColor\n className?: string\n style?: CSSProperties\n}\n\n/**\n * A one-time-passcode input — a row of single-character boxes for verification codes. **`length`**\n * (default `4`) sets the box count; **`type`** (`'numeric'` default · `'alphabetic'` · `'alphanumeric'`)\n * restricts the accepted characters and the mobile keyboard. Typing advances to the next box, Backspace\n * clears the box (in an empty box: clears the previous one and steps back), Arrows navigate, and **paste / SMS autofill** (`autocomplete=\"one-time-code\"`)\n * distributes the whole code across the boxes. The value is the concatenated string — controlled\n * (`value` + `onChange`) or uncontrolled (`defaultValue`); **`onComplete`** fires when all boxes are\n * filled. Shares the field-family chrome (`label` · `error` + `helperText` · `required` · `disabled` ·\n * `size`) and binds to a surrounding `<Form>` by **`name`** (form value = the code string; validate with\n * e.g. `z.string().length(4)` or a `type`-matching regex). Tinted by `color` via the shared\n * `--tz-btn-rgb` pattern; `role=\"group\"` with per-box `aria-label`s. Own CSS module (+ TextField's for\n * the label/helper chrome).\n */\nexport const OtpField = forwardRef<HTMLDivElement, OtpFieldProps>(function OtpField(\n {\n length = 4,\n type = 'numeric',\n value,\n defaultValue,\n onChange,\n onComplete,\n name,\n label,\n helperText,\n error,\n required = false,\n disabled = false,\n autoFocus = false,\n placeholder,\n size = 'md',\n align = 'start',\n color = 'primary',\n className,\n style,\n },\n ref,\n) {\n const t = useT()\n const reactId = useId()\n const helperId = `${reactId}-helper`\n const allowed = PATTERN[type]\n\n // bind to a surrounding <Form> by `name` — form value is the code string; error/touched via field()\n const form = useFormContext()\n const isFormBound = Boolean(form && name)\n const bound = form && name ? form.field(name) : undefined\n\n const externalValue =\n value !== undefined ? value : isFormBound ? (form!.values[name!] as string) : undefined\n const isControlled = value !== undefined || isFormBound\n const [internal, setInternal] = useState<string>(defaultValue ?? '')\n const currentValue = isControlled ? (externalValue ?? '') : internal\n\n const resolvedError = error ?? bound?.error ?? false\n const resolvedHelperText = helperText ?? bound?.helperText\n\n // the code split into exactly `length` single-char slots (padded with empties)\n const chars = toChars(currentValue, length)\n\n const inputsRef = useRef<(HTMLInputElement | null)[]>([])\n\n useEffect(() => {\n if (autoFocus) inputsRef.current[0]?.focus()\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n const focusBox = (i: number) => {\n const el = inputsRef.current[Math.max(0, Math.min(i, length - 1))]\n el?.focus()\n el?.select()\n }\n\n const commit = (nextChars: string[]) => {\n const next = nextChars.join('')\n if (!isControlled) setInternal(next)\n if (isFormBound) form!.setValue(name!, next)\n onChange?.(next)\n if (nextChars.every((c) => c !== '')) onComplete?.(next)\n }\n\n const handleChange = (index: number, raw: string) => {\n const filtered = [...raw].filter((c) => allowed.test(c))\n // a disallowed keystroke (raw non-empty but nothing survives the filter) is ignored\n if (raw !== '' && filtered.length === 0) return\n const nextChars = [...chars]\n if (filtered.length <= 1) {\n // a single typed char (boxes select-on-focus, so this replaces) — or a clear ('')\n nextChars[index] = filtered[0] ?? ''\n commit(nextChars)\n if (filtered[0]) focusBox(index + 1)\n } else {\n // multiple chars (SMS autofill dumps the whole code into one box) → distribute from here\n let k = index\n for (const ch of filtered) {\n if (k >= length) break\n nextChars[k] = ch\n k++\n }\n commit(nextChars)\n focusBox(k)\n }\n }\n\n const handleKeyDown = (index: number, event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key === 'Backspace') {\n if (chars[index] === '' && index > 0) {\n // empty box → step back and clear the previous one\n event.preventDefault()\n const nextChars = [...chars]\n nextChars[index - 1] = ''\n commit(nextChars)\n focusBox(index - 1)\n }\n // a non-empty box lets the native delete run → onChange fires with '' (stays put)\n } else if (event.key === 'ArrowLeft') {\n event.preventDefault()\n focusBox(index - 1)\n } else if (event.key === 'ArrowRight') {\n event.preventDefault()\n focusBox(index + 1)\n } else if (event.key === 'Delete') {\n event.preventDefault()\n const nextChars = [...chars]\n nextChars[index] = ''\n commit(nextChars)\n }\n }\n\n const handlePaste = (index: number, event: ClipboardEvent<HTMLInputElement>) => {\n event.preventDefault()\n const filtered = [...event.clipboardData.getData('text')].filter((c) => allowed.test(c))\n if (filtered.length === 0) return\n const nextChars = [...chars]\n let k = index\n for (const ch of filtered) {\n if (k >= length) break\n nextChars[k] = ch\n k++\n }\n commit(nextChars)\n focusBox(k)\n }\n\n // mark the field touched when focus leaves the whole widget (not when it hops between boxes)\n const handleBlur = (event: FocusEvent<HTMLDivElement>) => {\n if (!event.currentTarget.contains(event.relatedTarget as Node | null)) {\n bound?.onBlur(event as unknown as FocusEvent<HTMLInputElement>)\n }\n }\n\n return (\n <div\n ref={ref}\n className={clsx(\n fieldStyles.field,\n resolvedError && fieldStyles.error,\n disabled && fieldStyles.disabled,\n className,\n )}\n style={\n {\n '--tz-btn-rgb': `var(--tz-color-${color}-rgb)`,\n ...style,\n } as CSSProperties\n }\n >\n {label != null && (\n <span className={fieldStyles.label}>\n <Typography as=\"span\" variant=\"bodySmall\" color=\"muted\">\n {label}\n </Typography>\n {required && (\n <span className={fieldStyles.required} aria-hidden=\"true\">\n *\n </span>\n )}\n </span>\n )}\n\n <div\n role=\"group\"\n aria-label={typeof label === 'string' ? label : t('otpField.label')}\n aria-invalid={resolvedError || undefined}\n aria-describedby={resolvedHelperText != null ? helperId : undefined}\n className={clsx(styles.row, styles[size], styles[align], resolvedError && styles.invalid)}\n onBlur={handleBlur}\n >\n {chars.map((char, i) => (\n <input\n key={i}\n ref={(el) => {\n inputsRef.current[i] = el\n }}\n // the name goes on the first box only, so the form's scroll-to-error can target it\n name={i === 0 ? name : undefined}\n type=\"text\"\n inputMode={type === 'numeric' ? 'numeric' : 'text'}\n autoComplete={i === 0 ? 'one-time-code' : 'off'}\n aria-label={t('otpField.digit', { index: i + 1, total: length })}\n className={clsx(styles.box, char !== '' && styles.filled)}\n value={char}\n placeholder={placeholder}\n disabled={disabled}\n onChange={(e) => handleChange(i, e.target.value)}\n onKeyDown={(e) => handleKeyDown(i, e)}\n onPaste={(e) => handlePaste(i, e)}\n onFocus={(e) => e.target.select()}\n />\n ))}\n </div>\n\n {resolvedHelperText != null && (\n <Typography\n as=\"span\"\n id={helperId}\n variant=\"bodySmall\"\n color={resolvedError ? 'error' : 'muted'}\n className={fieldStyles.helper}\n >\n {resolvedHelperText}\n </Typography>\n )}\n </div>\n )\n})\n"],"names":["PATTERN","toChars","value","length","out","OtpField","forwardRef","type","defaultValue","onChange","onComplete","name","label","helperText","error","required","disabled","autoFocus","placeholder","size","align","color","className","style","ref","t","useT","helperId","useId","allowed","form","useFormContext","isFormBound","bound","externalValue","isControlled","internal","setInternal","useState","currentValue","resolvedError","resolvedHelperText","chars","inputsRef","useRef","useEffect","_a","focusBox","i","el","commit","nextChars","next","c","handleChange","index","raw","filtered","k","ch","handleKeyDown","event","handlePaste","handleBlur","jsxs","clsx","fieldStyles","jsx","Typography","styles","char","e"],"mappings":"2fA0BMA,GAAwC,CAC5C,QAAS,QACT,WAAY,WACZ,aAAc,aAChB,EAGA,SAASC,GAAQC,EAAeC,EAA0B,CACxD,MAAMC,EAAM,CAAC,GAAGF,CAAK,EAAE,MAAM,EAAGC,CAAM,EACtC,KAAOC,EAAI,OAASD,GAAQC,EAAI,KAAK,EAAE,EACvC,OAAOA,CACT,CAsDO,MAAMC,GAAWC,EAAAA,WAA0C,SAChE,CACE,OAAAH,EAAS,EACT,KAAAI,EAAO,UACP,MAAAL,EACA,aAAAM,EACA,SAAAC,EACA,WAAAC,EACA,KAAAC,EACA,MAAAC,EACA,WAAAC,EACA,MAAAC,EACA,SAAAC,EAAW,GACX,SAAAC,EAAW,GACX,UAAAC,EAAY,GACZ,YAAAC,EACA,KAAAC,EAAO,KACP,MAAAC,EAAQ,QACR,MAAAC,EAAQ,UACR,UAAAC,EACA,MAAAC,CACF,EACAC,EACA,CACA,MAAMC,EAAIC,GAAAA,KAAA,EAEJC,EAAW,GADDC,EAAAA,MAAA,CACW,UACrBC,EAAU7B,GAAQO,CAAI,EAGtBuB,EAAOC,GAAAA,eAAA,EACPC,EAAc,GAAQF,GAAQnB,GAC9BsB,EAAQH,GAAQnB,EAAOmB,EAAK,MAAMnB,CAAI,EAAI,OAE1CuB,EACJhC,IAAU,OAAYA,EAAQ8B,EAAeF,EAAM,OAAOnB,CAAK,EAAe,OAC1EwB,EAAejC,IAAU,QAAa8B,EACtC,CAACI,EAAUC,CAAW,EAAIC,EAAAA,SAAiB9B,GAAgB,EAAE,EAC7D+B,EAAeJ,EAAgBD,GAAiB,GAAME,EAEtDI,E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GAAG,OACH,GAAIzC,EACJ,QAAQ,YACR,MAAOa,EAAgB,QAAU,QACjC,UAAW0B,EAAAA,YAAY,OAEtB,SAAAzB,CAAA,CAAA,CACH,CAAA,CAAA,CAIR,CAAC"}
@@ -1,39 +1,39 @@
1
- import { jsxs as z, jsx as _ } from "react/jsx-runtime";
2
- import { forwardRef as tt, useId as et, useState as rt, useRef as st, useEffect as ot } from "react";
1
+ import { jsxs as z, jsx as h } from "react/jsx-runtime";
2
+ import { forwardRef as tt, useId as et, useState as rt, useRef as ot, useEffect as st } from "react";
3
3
  import { clsx as T } from "clsx";
4
4
  import { u as lt } from "./formContext-B7ln1Miy.js";
5
5
  import { T as S } from "./Typography-ChSuxgkc.js";
6
- import { f as d } from "./TextField.module-6gYcR9TL.js";
7
- import { a as at } from "./ConfigProvider-D61cpCz-.js";
8
- const ct = "_row_1bbms_2", nt = "_center_1bbms_14", it = "_end_1bbms_15", ft = "_sm_1bbms_27", dt = "_md_1bbms_31", ut = "_lg_1bbms_35", mt = "_box_1bbms_41", pt = "_filled_1bbms_65", bt = "_invalid_1bbms_82", u = {
9
- row: ct,
10
- center: nt,
11
- end: it,
6
+ import { f as u } from "./TextField.module-6gYcR9TL.js";
7
+ import { a as at } from "./ConfigProvider-CYgmMH4j.js";
8
+ const it = "_row_u40i0_2", ct = "_center_u40i0_14", nt = "_end_u40i0_15", ft = "_sm_u40i0_27", ut = "_md_u40i0_31", dt = "_lg_u40i0_35", mt = "_box_u40i0_41", pt = "_filled_u40i0_65", _t = "_invalid_u40i0_84", d = {
9
+ row: it,
10
+ center: ct,
11
+ end: nt,
12
12
  sm: ft,
13
- md: dt,
14
- lg: ut,
13
+ md: ut,
14
+ lg: dt,
15
15
  box: mt,
16
16
  filled: pt,
17
- invalid: bt
18
- }, _t = {
17
+ invalid: _t
18
+ }, ht = {
19
19
  numeric: /[0-9]/,
20
20
  alphabetic: /[A-Za-z]/,
21
21
  alphanumeric: /[A-Za-z0-9]/
22
22
  };
23
- function ht(B, l) {
24
- const c = [...B].slice(0, l);
25
- for (; c.length < l; ) c.push("");
26
- return c;
23
+ function yt(B, l) {
24
+ const i = [...B].slice(0, l);
25
+ for (; i.length < l; ) i.push("");
26
+ return i;
27
27
  }
28
28
  const Bt = tt(function({
29
29
  length: l = 4,
30
- type: c = "numeric",
31
- value: v,
30
+ type: i = "numeric",
31
+ value: x,
32
32
  defaultValue: j,
33
- onChange: x,
34
- onComplete: g,
35
- name: n,
36
- label: h,
33
+ onChange: g,
34
+ onComplete: b,
35
+ name: c,
36
+ label: y,
37
37
  helperText: E,
38
38
  error: M,
39
39
  required: O = !1,
@@ -46,8 +46,8 @@ const Bt = tt(function({
46
46
  className: q,
47
47
  style: C
48
48
  }, H) {
49
- const N = at(), A = `${et()}-helper`, I = _t[c], m = lt(), w = !!(m && n), o = m && n ? m.field(n) : void 0, L = v !== void 0 ? v : w ? m.values[n] : void 0, R = v !== void 0 || w, [G, J] = rt(j ?? ""), Q = R ? L ?? "" : G, y = M ?? (o == null ? void 0 : o.error) ?? !1, D = E ?? (o == null ? void 0 : o.helperText), i = ht(Q, l), k = st([]);
50
- ot(() => {
49
+ const N = at(), A = `${et()}-helper`, I = ht[i], m = lt(), w = !!(m && c), s = m && c ? m.field(c) : void 0, L = x !== void 0 ? x : w ? m.values[c] : void 0, R = x !== void 0 || w, [G, J] = rt(j ?? ""), Q = R ? L ?? "" : G, v = M ?? (s == null ? void 0 : s.error) ?? !1, D = E ?? (s == null ? void 0 : s.helperText), n = yt(Q, l), k = ot([]);
50
+ st(() => {
51
51
  var e;
52
52
  P && ((e = k.current[0]) == null || e.focus());
53
53
  }, []);
@@ -56,26 +56,26 @@ const Bt = tt(function({
56
56
  t == null || t.focus(), t == null || t.select();
57
57
  }, p = (e) => {
58
58
  const t = e.join("");
59
- R || J(t), w && m.setValue(n, t), x == null || x(t), e.every((r) => r !== "") && (g == null || g(t));
59
+ R || J(t), w && m.setValue(c, t), g == null || g(t), e.every((r) => r !== "") && (b == null || b(t));
60
60
  }, U = (e, t) => {
61
- const r = [...t].filter((s) => I.test(s));
61
+ const r = [...t].filter((o) => I.test(o));
62
62
  if (t !== "" && r.length === 0) return;
63
- const a = [...i];
63
+ const a = [...n];
64
64
  if (r.length <= 1)
65
65
  a[e] = r[0] ?? "", p(a), r[0] && f(e + 1);
66
66
  else {
67
- let s = e;
68
- for (const b of r) {
69
- if (s >= l) break;
70
- a[s] = b, s++;
67
+ let o = e;
68
+ for (const _ of r) {
69
+ if (o >= l) break;
70
+ a[o] = _, o++;
71
71
  }
72
- p(a), f(s);
72
+ p(a), f(o);
73
73
  }
74
74
  }, W = (e, t) => {
75
75
  if (t.key === "Backspace") {
76
- if (i[e] === "" && e > 0) {
76
+ if (n[e] === "" && e > 0) {
77
77
  t.preventDefault();
78
- const r = [...i];
78
+ const r = [...n];
79
79
  r[e - 1] = "", p(r), f(e - 1);
80
80
  }
81
81
  } else if (t.key === "ArrowLeft")
@@ -84,31 +84,31 @@ const Bt = tt(function({
84
84
  t.preventDefault(), f(e + 1);
85
85
  else if (t.key === "Delete") {
86
86
  t.preventDefault();
87
- const r = [...i];
87
+ const r = [...n];
88
88
  r[e] = "", p(r);
89
89
  }
90
90
  }, X = (e, t) => {
91
91
  t.preventDefault();
92
- const r = [...t.clipboardData.getData("text")].filter((b) => I.test(b));
92
+ const r = [...t.clipboardData.getData("text")].filter((_) => I.test(_));
93
93
  if (r.length === 0) return;
94
- const a = [...i];
95
- let s = e;
96
- for (const b of r) {
97
- if (s >= l) break;
98
- a[s] = b, s++;
94
+ const a = [...n];
95
+ let o = e;
96
+ for (const _ of r) {
97
+ if (o >= l) break;
98
+ a[o] = _, o++;
99
99
  }
100
- p(a), f(s);
100
+ p(a), f(o);
101
101
  }, Y = (e) => {
102
- e.currentTarget.contains(e.relatedTarget) || o == null || o.onBlur(e);
102
+ e.currentTarget.contains(e.relatedTarget) || s == null || s.onBlur(e);
103
103
  };
104
104
  return /* @__PURE__ */ z(
105
105
  "div",
106
106
  {
107
107
  ref: H,
108
108
  className: T(
109
- d.field,
110
- y && d.error,
111
- F && d.disabled,
109
+ u.field,
110
+ v && u.error,
111
+ F && u.disabled,
112
112
  q
113
113
  ),
114
114
  style: {
@@ -116,31 +116,31 @@ const Bt = tt(function({
116
116
  ...C
117
117
  },
118
118
  children: [
119
- h != null && /* @__PURE__ */ z("span", { className: d.label, children: [
120
- /* @__PURE__ */ _(S, { as: "span", variant: "bodySmall", color: "muted", children: h }),
121
- O && /* @__PURE__ */ _("span", { className: d.required, "aria-hidden": "true", children: "*" })
119
+ y != null && /* @__PURE__ */ z("span", { className: u.label, children: [
120
+ /* @__PURE__ */ h(S, { as: "span", variant: "bodySmall", color: "muted", children: y }),
121
+ O && /* @__PURE__ */ h("span", { className: u.required, "aria-hidden": "true", children: "*" })
122
122
  ] }),
123
- /* @__PURE__ */ _(
123
+ /* @__PURE__ */ h(
124
124
  "div",
125
125
  {
126
126
  role: "group",
127
- "aria-label": typeof h == "string" ? h : N("otpField.label"),
128
- "aria-invalid": y || void 0,
127
+ "aria-label": typeof y == "string" ? y : N("otpField.label"),
128
+ "aria-invalid": v || void 0,
129
129
  "aria-describedby": D != null ? A : void 0,
130
- className: T(u.row, u[K], u[Z], y && u.invalid),
130
+ className: T(d.row, d[K], d[Z], v && d.invalid),
131
131
  onBlur: Y,
132
- children: i.map((e, t) => /* @__PURE__ */ _(
132
+ children: n.map((e, t) => /* @__PURE__ */ h(
133
133
  "input",
134
134
  {
135
135
  ref: (r) => {
136
136
  k.current[t] = r;
137
137
  },
138
- name: t === 0 ? n : void 0,
138
+ name: t === 0 ? c : void 0,
139
139
  type: "text",
140
- inputMode: c === "numeric" ? "numeric" : "text",
140
+ inputMode: i === "numeric" ? "numeric" : "text",
141
141
  autoComplete: t === 0 ? "one-time-code" : "off",
142
142
  "aria-label": N("otpField.digit", { index: t + 1, total: l }),
143
- className: T(u.box, e !== "" && u.filled),
143
+ className: T(d.box, e !== "" && d.filled),
144
144
  value: e,
145
145
  placeholder: V,
146
146
  disabled: F,
@@ -153,14 +153,14 @@ const Bt = tt(function({
153
153
  ))
154
154
  }
155
155
  ),
156
- D != null && /* @__PURE__ */ _(
156
+ D != null && /* @__PURE__ */ h(
157
157
  S,
158
158
  {
159
159
  as: "span",
160
160
  id: A,
161
161
  variant: "bodySmall",
162
- color: y ? "error" : "muted",
163
- className: d.helper,
162
+ color: v ? "error" : "muted",
163
+ className: u.helper,
164
164
  children: D
165
165
  }
166
166
  )
@@ -171,4 +171,4 @@ const Bt = tt(function({
171
171
  export {
172
172
  Bt as O
173
173
  };
174
- //# sourceMappingURL=OtpField-D4-r7I0A.js.map
174
+ //# sourceMappingURL=OtpField-pL9nj4AW.js.map