@42-central/ui-react 0.29.0 → 0.30.0

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 (591) hide show
  1. package/dist/{chunk-X6DESK37.js → chunk-2RRTT4AF.js} +17 -5
  2. package/dist/chunk-2RRTT4AF.js.map +1 -0
  3. package/dist/{chunk-TUP7WXQE.js → chunk-322I2RSV.js} +9 -6
  4. package/dist/chunk-322I2RSV.js.map +1 -0
  5. package/dist/{chunk-ISX3AM32.js → chunk-37SRSNLJ.js} +4 -4
  6. package/dist/{chunk-ISX3AM32.js.map → chunk-37SRSNLJ.js.map} +1 -1
  7. package/dist/{chunk-L5GH7LLD.js → chunk-3MFWUG5O.js} +4 -4
  8. package/dist/{chunk-L5GH7LLD.js.map → chunk-3MFWUG5O.js.map} +1 -1
  9. package/dist/{chunk-FQJNQW3G.js → chunk-3XQEOJCE.js} +8 -5
  10. package/dist/chunk-3XQEOJCE.js.map +1 -0
  11. package/dist/{chunk-JKFPRQB2.js → chunk-4LSZ5JWF.js} +3 -3
  12. package/dist/{chunk-JKFPRQB2.js.map → chunk-4LSZ5JWF.js.map} +1 -1
  13. package/dist/{chunk-V2QZG4IT.js → chunk-5HWFYYHW.js} +27 -9
  14. package/dist/chunk-5HWFYYHW.js.map +1 -0
  15. package/dist/{chunk-GEZYGBXY.js → chunk-6MVFCS46.js} +99 -42
  16. package/dist/chunk-6MVFCS46.js.map +1 -0
  17. package/dist/{chunk-NNPSBC7O.js → chunk-6WZSUS3U.js} +10 -9
  18. package/dist/chunk-6WZSUS3U.js.map +1 -0
  19. package/dist/chunk-6YRGP6PS.js +138 -0
  20. package/dist/chunk-6YRGP6PS.js.map +1 -0
  21. package/dist/{chunk-B5YHYI7E.js → chunk-ALANKV5Y.js} +23 -6
  22. package/dist/chunk-ALANKV5Y.js.map +1 -0
  23. package/dist/{chunk-IA6DCC3N.js → chunk-AUQPNDE5.js} +23 -13
  24. package/dist/chunk-AUQPNDE5.js.map +1 -0
  25. package/dist/{chunk-AKXALCUN.js → chunk-D7SW2E24.js} +4 -4
  26. package/dist/chunk-D7SW2E24.js.map +1 -0
  27. package/dist/{chunk-OXR7BXZA.js → chunk-DQIYYDFD.js} +4 -3
  28. package/dist/chunk-DQIYYDFD.js.map +1 -0
  29. package/dist/{chunk-HMNXNKDA.js → chunk-FCBYUN6F.js} +4 -4
  30. package/dist/{chunk-HMNXNKDA.js.map → chunk-FCBYUN6F.js.map} +1 -1
  31. package/dist/{chunk-2W7H43WL.js → chunk-FED6SJWM.js} +23 -14
  32. package/dist/chunk-FED6SJWM.js.map +1 -0
  33. package/dist/{chunk-7E7JNWOC.js → chunk-FEPIHXVI.js} +6 -5
  34. package/dist/chunk-FEPIHXVI.js.map +1 -0
  35. package/dist/{chunk-Y57NW6G7.js → chunk-G3YOSG3U.js} +4 -4
  36. package/dist/{chunk-Y57NW6G7.js.map → chunk-G3YOSG3U.js.map} +1 -1
  37. package/dist/chunk-GZN5CXMR.js +100 -0
  38. package/dist/chunk-GZN5CXMR.js.map +1 -0
  39. package/dist/{chunk-HCHGERDB.js → chunk-HCSZPBWV.js} +17 -115
  40. package/dist/chunk-HCSZPBWV.js.map +1 -0
  41. package/dist/{chunk-I4B3N3UX.js → chunk-HTVICHT4.js} +12 -7
  42. package/dist/chunk-HTVICHT4.js.map +1 -0
  43. package/dist/chunk-I7TC2C3I.js +163 -0
  44. package/dist/chunk-I7TC2C3I.js.map +1 -0
  45. package/dist/{chunk-7FPSQBWB.js → chunk-IBXYLO2J.js} +14 -13
  46. package/dist/chunk-IBXYLO2J.js.map +1 -0
  47. package/dist/{chunk-7KFUFAVP.js → chunk-IRYG6B5A.js} +9 -8
  48. package/dist/chunk-IRYG6B5A.js.map +1 -0
  49. package/dist/{chunk-2RQLPN4U.js → chunk-JCNEW4WJ.js} +8 -8
  50. package/dist/{chunk-2RQLPN4U.js.map → chunk-JCNEW4WJ.js.map} +1 -1
  51. package/dist/{chunk-SP6LCCTZ.js → chunk-KZDMVOL6.js} +35 -8
  52. package/dist/chunk-KZDMVOL6.js.map +1 -0
  53. package/dist/chunk-LR5U6TZZ.js +169 -0
  54. package/dist/chunk-LR5U6TZZ.js.map +1 -0
  55. package/dist/{chunk-MQHD3EJE.js → chunk-LZHZJWVM.js} +6 -4
  56. package/dist/chunk-LZHZJWVM.js.map +1 -0
  57. package/dist/{chunk-5EOMSWNO.js → chunk-MAM2X3MW.js} +5 -5
  58. package/dist/{chunk-5EOMSWNO.js.map → chunk-MAM2X3MW.js.map} +1 -1
  59. package/dist/{chunk-FSPS7TVD.js → chunk-MCMS4NMO.js} +5 -5
  60. package/dist/{chunk-FSPS7TVD.js.map → chunk-MCMS4NMO.js.map} +1 -1
  61. package/dist/{chunk-ZB5VMGKB.js → chunk-MV5DIE2T.js} +15 -4
  62. package/dist/chunk-MV5DIE2T.js.map +1 -0
  63. package/dist/chunk-NDI4HLQE.js +41 -0
  64. package/dist/chunk-NDI4HLQE.js.map +1 -0
  65. package/dist/{chunk-B4GNSSHU.js → chunk-NLJEQZQQ.js} +3 -3
  66. package/dist/{chunk-B4GNSSHU.js.map → chunk-NLJEQZQQ.js.map} +1 -1
  67. package/dist/{chunk-SBZJGFZ6.js → chunk-QHT4DCXE.js} +8 -7
  68. package/dist/chunk-QHT4DCXE.js.map +1 -0
  69. package/dist/{chunk-I4IJOLNA.js → chunk-RMUBCTEF.js} +5 -5
  70. package/dist/{chunk-I4IJOLNA.js.map → chunk-RMUBCTEF.js.map} +1 -1
  71. package/dist/{chunk-G3AD3NJG.js → chunk-RNTDM3RP.js} +9 -5
  72. package/dist/chunk-RNTDM3RP.js.map +1 -0
  73. package/dist/chunk-RPFN6ETQ.js +509 -0
  74. package/dist/chunk-RPFN6ETQ.js.map +1 -0
  75. package/dist/{chunk-HWBFRDX7.js → chunk-SI7C3W5M.js} +28 -9
  76. package/dist/chunk-SI7C3W5M.js.map +1 -0
  77. package/dist/chunk-TPOV3OCC.js +234 -0
  78. package/dist/chunk-TPOV3OCC.js.map +1 -0
  79. package/dist/{chunk-IANYMDKH.js → chunk-UBQ54W46.js} +4 -4
  80. package/dist/chunk-UBQ54W46.js.map +1 -0
  81. package/dist/{chunk-QVOBLRCM.js → chunk-UIKQ4X6W.js} +3 -3
  82. package/dist/{chunk-QVOBLRCM.js.map → chunk-UIKQ4X6W.js.map} +1 -1
  83. package/dist/chunk-UOWQH53N.js +70 -0
  84. package/dist/chunk-UOWQH53N.js.map +1 -0
  85. package/dist/{chunk-QRNQQIQM.js → chunk-WJUY6YWF.js} +52 -20
  86. package/dist/chunk-WJUY6YWF.js.map +1 -0
  87. package/dist/{chunk-3KARNPW4.js → chunk-WKIUMLRT.js} +3 -3
  88. package/dist/{chunk-3KARNPW4.js.map → chunk-WKIUMLRT.js.map} +1 -1
  89. package/dist/chunk-X6RB74JN.js +37 -0
  90. package/dist/chunk-X6RB74JN.js.map +1 -0
  91. package/dist/chunk-XQ6L2CM5.js +83 -0
  92. package/dist/chunk-XQ6L2CM5.js.map +1 -0
  93. package/dist/{chunk-RKCUXOU2.js → chunk-YUVKROMA.js} +44 -7
  94. package/dist/chunk-YUVKROMA.js.map +1 -0
  95. package/dist/components/action-icon/action-icon.d.ts +9 -2
  96. package/dist/components/action-icon/action-icon.d.ts.map +1 -1
  97. package/dist/components/action-icon/index.js +5 -1
  98. package/dist/components/alert/index.js +4 -4
  99. package/dist/components/anchor/anchor.d.ts +45 -0
  100. package/dist/components/anchor/anchor.d.ts.map +1 -0
  101. package/dist/components/anchor/index.d.ts +2 -0
  102. package/dist/components/anchor/index.d.ts.map +1 -0
  103. package/dist/components/anchor/index.js +11 -0
  104. package/dist/components/anchor/index.js.map +1 -0
  105. package/dist/components/app-shell/app-shell.d.ts +10 -6
  106. package/dist/components/app-shell/app-shell.d.ts.map +1 -1
  107. package/dist/components/app-shell/index.js +23 -24
  108. package/dist/components/app-shell/index.js.map +1 -1
  109. package/dist/components/autocomplete/autocomplete.d.ts +1 -1
  110. package/dist/components/autocomplete/autocomplete.d.ts.map +1 -1
  111. package/dist/components/autocomplete/index.js +15 -9
  112. package/dist/components/autocomplete/index.js.map +1 -1
  113. package/dist/components/avatar/index.js +1 -1
  114. package/dist/components/button/button.d.ts +15 -2
  115. package/dist/components/button/button.d.ts.map +1 -1
  116. package/dist/components/button/index.js +5 -1
  117. package/dist/components/button-multi-select/index.js +6 -4
  118. package/dist/components/button-multi-select/index.js.map +1 -1
  119. package/dist/components/button-select/button-select-control.d.ts.map +1 -1
  120. package/dist/components/button-select/button-select.d.ts +2 -2
  121. package/dist/components/button-select/button-select.d.ts.map +1 -1
  122. package/dist/components/button-select/index.js +6 -4
  123. package/dist/components/button-select/index.js.map +1 -1
  124. package/dist/components/calendar/aliases.d.ts +16 -0
  125. package/dist/components/calendar/aliases.d.ts.map +1 -0
  126. package/dist/components/calendar/calendar-body.d.ts +11 -1
  127. package/dist/components/calendar/calendar-body.d.ts.map +1 -1
  128. package/dist/components/calendar/calendar.d.ts +8 -4
  129. package/dist/components/calendar/calendar.d.ts.map +1 -1
  130. package/dist/components/calendar/index.d.ts +2 -1
  131. package/dist/components/calendar/index.d.ts.map +1 -1
  132. package/dist/components/calendar/index.js +15 -5
  133. package/dist/components/calendar/index.js.map +1 -1
  134. package/dist/components/calendar-heatmap/calendar-heatmap.d.ts.map +1 -1
  135. package/dist/components/calendar-heatmap/index.js +85 -73
  136. package/dist/components/calendar-heatmap/index.js.map +1 -1
  137. package/dist/components/camera/index.js +16 -14
  138. package/dist/components/carousel/index.js +3 -3
  139. package/dist/components/checkbox/checkbox.d.ts.map +1 -1
  140. package/dist/components/checkbox/index.js +2 -2
  141. package/dist/components/choice-card-group/index.js +2 -2
  142. package/dist/components/choice-card-group/index.js.map +1 -1
  143. package/dist/components/circular-progress/circular-progress.d.ts +22 -11
  144. package/dist/components/circular-progress/circular-progress.d.ts.map +1 -1
  145. package/dist/components/circular-progress/index.d.ts +1 -1
  146. package/dist/components/circular-progress/index.d.ts.map +1 -1
  147. package/dist/components/circular-progress/index.js +68 -49
  148. package/dist/components/circular-progress/index.js.map +1 -1
  149. package/dist/components/clipboard/index.js +7 -3
  150. package/dist/components/clipboard/index.js.map +1 -1
  151. package/dist/components/code/code.d.ts +10 -0
  152. package/dist/components/code/code.d.ts.map +1 -1
  153. package/dist/components/code/index.js +1 -0
  154. package/dist/components/code/index.js.map +1 -1
  155. package/dist/components/code-block/chrome.js +10 -6
  156. package/dist/components/code-block/index.js +10 -7
  157. package/dist/components/code-block/index.js.map +1 -1
  158. package/dist/components/combobox/combobox.d.ts +5 -3
  159. package/dist/components/combobox/combobox.d.ts.map +1 -1
  160. package/dist/components/combobox/index.js +12 -7
  161. package/dist/components/combobox-list/combobox-list.d.ts +1 -1
  162. package/dist/components/combobox-list/combobox-list.d.ts.map +1 -1
  163. package/dist/components/combobox-list/index.js +14 -9
  164. package/dist/components/compare/index.js +1 -1
  165. package/dist/components/data-list/data-list.d.ts +96 -0
  166. package/dist/components/data-list/data-list.d.ts.map +1 -0
  167. package/dist/components/data-list/index.d.ts +2 -0
  168. package/dist/components/data-list/index.d.ts.map +1 -0
  169. package/dist/components/data-list/index.js +147 -0
  170. package/dist/components/data-list/index.js.map +1 -0
  171. package/dist/components/data-table/data-table-group.d.ts.map +1 -1
  172. package/dist/components/data-table/data-table-placeholder.d.ts +12 -1
  173. package/dist/components/data-table/data-table-placeholder.d.ts.map +1 -1
  174. package/dist/components/data-table/data-table-stack.d.ts.map +1 -1
  175. package/dist/components/data-table/data-table.d.ts +5 -2
  176. package/dist/components/data-table/data-table.d.ts.map +1 -1
  177. package/dist/components/data-table/index.js +163 -168
  178. package/dist/components/data-table/index.js.map +1 -1
  179. package/dist/components/date-picker/aliases.d.ts +16 -0
  180. package/dist/components/date-picker/aliases.d.ts.map +1 -1
  181. package/dist/components/date-picker/date-picker.d.ts +22 -8
  182. package/dist/components/date-picker/date-picker.d.ts.map +1 -1
  183. package/dist/components/date-picker/index.d.ts +2 -2
  184. package/dist/components/date-picker/index.d.ts.map +1 -1
  185. package/dist/components/date-picker/index.js +34 -28
  186. package/dist/components/date-picker/index.js.map +1 -1
  187. package/dist/components/download-button/index.js +6 -2
  188. package/dist/components/drawer/drawer.d.ts +7 -4
  189. package/dist/components/drawer/drawer.d.ts.map +1 -1
  190. package/dist/components/drawer/index.js +11 -6
  191. package/dist/components/empty-state/empty-state.d.ts +57 -0
  192. package/dist/components/empty-state/empty-state.d.ts.map +1 -0
  193. package/dist/components/empty-state/index.d.ts +2 -0
  194. package/dist/components/empty-state/index.d.ts.map +1 -0
  195. package/dist/components/empty-state/index.js +8 -0
  196. package/dist/components/empty-state/index.js.map +1 -0
  197. package/dist/components/field/field.d.ts +20 -0
  198. package/dist/components/field/field.d.ts.map +1 -1
  199. package/dist/components/field/index.js +1 -1
  200. package/dist/components/fieldset/fieldset.d.ts +103 -0
  201. package/dist/components/fieldset/fieldset.d.ts.map +1 -0
  202. package/dist/components/fieldset/index.d.ts +2 -0
  203. package/dist/components/fieldset/index.d.ts.map +1 -0
  204. package/dist/components/fieldset/index.js +150 -0
  205. package/dist/components/fieldset/index.js.map +1 -0
  206. package/dist/components/file-item/index.js +10 -7
  207. package/dist/components/file-preview/file-preview.d.ts.map +1 -1
  208. package/dist/components/file-preview/index.js +10 -18
  209. package/dist/components/file-preview/index.js.map +1 -1
  210. package/dist/components/file-trigger/index.js +6 -2
  211. package/dist/components/file-upload/file-upload.d.ts.map +1 -1
  212. package/dist/components/file-upload/index.js +18 -14
  213. package/dist/components/file-upload/index.js.map +1 -1
  214. package/dist/components/gallery/index.js +3 -3
  215. package/dist/components/geodesic/a11y.d.ts +3 -3
  216. package/dist/components/geodesic/a11y.d.ts.map +1 -1
  217. package/dist/components/hover-card/hover-card.d.ts.map +1 -1
  218. package/dist/components/hover-card/index.js +10 -3
  219. package/dist/components/hover-card/index.js.map +1 -1
  220. package/dist/components/image/index.js +3 -3
  221. package/dist/components/image-cropper/index.js +9 -6
  222. package/dist/components/input/index.js +2 -2
  223. package/dist/components/input/input.d.ts.map +1 -1
  224. package/dist/components/kbd/index.js +3 -3
  225. package/dist/components/kbd/kbd.d.ts +4 -0
  226. package/dist/components/kbd/kbd.d.ts.map +1 -1
  227. package/dist/components/lightbox/index.js +13 -11
  228. package/dist/components/lightbox/index.js.map +1 -1
  229. package/dist/components/menu/index.js +9 -5
  230. package/dist/components/menu/index.js.map +1 -1
  231. package/dist/components/menu/menu.d.ts.map +1 -1
  232. package/dist/components/modal/index.js +11 -6
  233. package/dist/components/modal/modal.d.ts +10 -4
  234. package/dist/components/modal/modal.d.ts.map +1 -1
  235. package/dist/components/multi-combobox-list/index.js +13 -9
  236. package/dist/components/multi-combobox-list/multi-combobox-list.d.ts +1 -1
  237. package/dist/components/multi-combobox-list/multi-combobox-list.d.ts.map +1 -1
  238. package/dist/components/multi-select/index.js +13 -10
  239. package/dist/components/multi-select/index.js.map +1 -1
  240. package/dist/components/multi-select/multi-select.d.ts +1 -1
  241. package/dist/components/multi-select/multi-select.d.ts.map +1 -1
  242. package/dist/components/nav-link/index.js +4 -4
  243. package/dist/components/nav-link/tanstack.js +4 -4
  244. package/dist/components/notification/index.js +6 -6
  245. package/dist/components/notification/index.js.map +1 -1
  246. package/dist/components/number-input/index.js +11 -7
  247. package/dist/components/number-input/number-input.d.ts +1 -1
  248. package/dist/components/number-input/number-input.d.ts.map +1 -1
  249. package/dist/components/overlays/dialog-parts.d.ts +10 -1
  250. package/dist/components/overlays/dialog-parts.d.ts.map +1 -1
  251. package/dist/components/overlays/index.js +13 -8
  252. package/dist/components/overlays/index.js.map +1 -1
  253. package/dist/components/pagination/index.d.ts +2 -0
  254. package/dist/components/pagination/index.d.ts.map +1 -0
  255. package/dist/components/pagination/index.js +362 -0
  256. package/dist/components/pagination/index.js.map +1 -0
  257. package/dist/components/pagination/pagination.d.ts +147 -0
  258. package/dist/components/pagination/pagination.d.ts.map +1 -0
  259. package/dist/components/password-input/index.js +6 -5
  260. package/dist/components/password-input/index.js.map +1 -1
  261. package/dist/components/password-input/password-input.d.ts +1 -1
  262. package/dist/components/password-input/password-input.d.ts.map +1 -1
  263. package/dist/components/phone-input/index.js +14 -11
  264. package/dist/components/phone-input/index.js.map +1 -1
  265. package/dist/components/phone-input/phone-input.d.ts +1 -1
  266. package/dist/components/phone-input/phone-input.d.ts.map +1 -1
  267. package/dist/components/photo-capture/index.js +19 -17
  268. package/dist/components/photo-capture/index.js.map +1 -1
  269. package/dist/components/pills-input/index.js +4 -4
  270. package/dist/components/pills-input/pills-input.d.ts +1 -1
  271. package/dist/components/pills-input/pills-input.d.ts.map +1 -1
  272. package/dist/components/pin-input/index.js +6 -5
  273. package/dist/components/pin-input/index.js.map +1 -1
  274. package/dist/components/pin-input/pin-input.d.ts.map +1 -1
  275. package/dist/components/popover/index.js +7 -2
  276. package/dist/components/popover/popover.d.ts +41 -16
  277. package/dist/components/popover/popover.d.ts.map +1 -1
  278. package/dist/components/progress/index.d.ts +1 -1
  279. package/dist/components/progress/index.d.ts.map +1 -1
  280. package/dist/components/progress/index.js +4 -1
  281. package/dist/components/progress/progress.d.ts +22 -14
  282. package/dist/components/progress/progress.d.ts.map +1 -1
  283. package/dist/components/prose/index.d.ts +2 -0
  284. package/dist/components/prose/index.d.ts.map +1 -0
  285. package/dist/components/prose/index.js +17 -0
  286. package/dist/components/prose/index.js.map +1 -0
  287. package/dist/components/prose/prose.d.ts +49 -0
  288. package/dist/components/prose/prose.d.ts.map +1 -0
  289. package/dist/components/prose/styles.css +593 -0
  290. package/dist/components/radio-group/index.js +9 -3
  291. package/dist/components/radio-group/index.js.map +1 -1
  292. package/dist/components/radio-group/radio-group.d.ts.map +1 -1
  293. package/dist/components/rating/index.js +3 -2
  294. package/dist/components/rating/index.js.map +1 -1
  295. package/dist/components/rating/rating.d.ts.map +1 -1
  296. package/dist/components/schedule/index.js +10 -8
  297. package/dist/components/schedule/index.js.map +1 -1
  298. package/dist/components/scroll-area/index.d.ts +2 -0
  299. package/dist/components/scroll-area/index.d.ts.map +1 -0
  300. package/dist/components/scroll-area/index.js +10 -0
  301. package/dist/components/scroll-area/index.js.map +1 -0
  302. package/dist/components/scroll-area/scroll-area.d.ts +150 -0
  303. package/dist/components/scroll-area/scroll-area.d.ts.map +1 -0
  304. package/dist/components/segment-group/index.js +2 -2
  305. package/dist/components/segment-group/segment-group.d.ts.map +1 -1
  306. package/dist/components/select/index.js +12 -8
  307. package/dist/components/select/select.d.ts +1 -1
  308. package/dist/components/select/select.d.ts.map +1 -1
  309. package/dist/components/slider/index.js +2 -2
  310. package/dist/components/slider/slider.d.ts.map +1 -1
  311. package/dist/components/splitter/index.d.ts +2 -0
  312. package/dist/components/splitter/index.d.ts.map +1 -0
  313. package/dist/components/splitter/index.js +373 -0
  314. package/dist/components/splitter/index.js.map +1 -0
  315. package/dist/components/splitter/splitter.d.ts +159 -0
  316. package/dist/components/splitter/splitter.d.ts.map +1 -0
  317. package/dist/components/spotlight/index.js +23 -22
  318. package/dist/components/spotlight/index.js.map +1 -1
  319. package/dist/components/spotlight/spotlight.d.ts.map +1 -1
  320. package/dist/components/steps/index.d.ts +4 -0
  321. package/dist/components/steps/index.d.ts.map +1 -0
  322. package/dist/components/steps/index.js +478 -0
  323. package/dist/components/steps/index.js.map +1 -0
  324. package/dist/components/steps/steps-data.d.ts +78 -0
  325. package/dist/components/steps/steps-data.d.ts.map +1 -0
  326. package/dist/components/steps/steps.d.ts +183 -0
  327. package/dist/components/steps/steps.d.ts.map +1 -0
  328. package/dist/components/switch/index.js +4 -3
  329. package/dist/components/switch/index.js.map +1 -1
  330. package/dist/components/switch/switch.d.ts.map +1 -1
  331. package/dist/components/table-of-contents/index.d.ts +2 -0
  332. package/dist/components/table-of-contents/index.d.ts.map +1 -0
  333. package/dist/components/table-of-contents/index.js +471 -0
  334. package/dist/components/table-of-contents/index.js.map +1 -0
  335. package/dist/components/table-of-contents/table-of-contents.d.ts +173 -0
  336. package/dist/components/table-of-contents/table-of-contents.d.ts.map +1 -0
  337. package/dist/components/tags-input/index.js +12 -9
  338. package/dist/components/tags-input/index.js.map +1 -1
  339. package/dist/components/tags-input/tags-input.d.ts +1 -1
  340. package/dist/components/tags-input/tags-input.d.ts.map +1 -1
  341. package/dist/components/text-input/index.js +2 -2
  342. package/dist/components/textarea/index.js +8 -6
  343. package/dist/components/textarea/index.js.map +1 -1
  344. package/dist/components/textarea/textarea.d.ts.map +1 -1
  345. package/dist/components/time-input/index.js +11 -9
  346. package/dist/components/time-input/index.js.map +1 -1
  347. package/dist/components/timeline/index.js +8 -1
  348. package/dist/components/timeline/index.js.map +1 -1
  349. package/dist/components/timeline/timeline.d.ts.map +1 -1
  350. package/dist/components/tooltip/index.js +1 -1
  351. package/dist/components/tooltip/tooltip.d.ts +3 -8
  352. package/dist/components/tooltip/tooltip.d.ts.map +1 -1
  353. package/dist/components/tour/conditions.d.ts +83 -0
  354. package/dist/components/tour/conditions.d.ts.map +1 -0
  355. package/dist/components/tour/create-tours.d.ts +49 -0
  356. package/dist/components/tour/create-tours.d.ts.map +1 -0
  357. package/dist/components/tour/index.d.ts +6 -0
  358. package/dist/components/tour/index.d.ts.map +1 -0
  359. package/dist/components/tour/index.js +1449 -0
  360. package/dist/components/tour/index.js.map +1 -0
  361. package/dist/components/tour/runtime.d.ts +57 -0
  362. package/dist/components/tour/runtime.d.ts.map +1 -0
  363. package/dist/components/tour/storage.d.ts +14 -0
  364. package/dist/components/tour/storage.d.ts.map +1 -0
  365. package/dist/components/tour/store.d.ts +62 -0
  366. package/dist/components/tour/store.d.ts.map +1 -0
  367. package/dist/components/tour/tour.d.ts +77 -0
  368. package/dist/components/tour/tour.d.ts.map +1 -0
  369. package/dist/components/tour/types.d.ts +680 -0
  370. package/dist/components/tour/types.d.ts.map +1 -0
  371. package/dist/components/tree/index.d.ts +3 -0
  372. package/dist/components/tree/index.d.ts.map +1 -0
  373. package/dist/components/tree/index.js +457 -0
  374. package/dist/components/tree/index.js.map +1 -0
  375. package/dist/components/tree/tree-row.d.ts +72 -0
  376. package/dist/components/tree/tree-row.d.ts.map +1 -0
  377. package/dist/components/tree/tree.d.ts +193 -0
  378. package/dist/components/tree/tree.d.ts.map +1 -0
  379. package/dist/components/tree-multi-select/index.js +31 -54
  380. package/dist/components/tree-multi-select/index.js.map +1 -1
  381. package/dist/components/tree-multi-select/tree-multi-select.d.ts +16 -1
  382. package/dist/components/tree-multi-select/tree-multi-select.d.ts.map +1 -1
  383. package/dist/components/tree-select/index.js +30 -24
  384. package/dist/components/tree-select/index.js.map +1 -1
  385. package/dist/components/tree-select/tree-popover.d.ts +20 -31
  386. package/dist/components/tree-select/tree-popover.d.ts.map +1 -1
  387. package/dist/components/tree-select/tree-select.d.ts +1 -1
  388. package/dist/components/tree-select/tree-select.d.ts.map +1 -1
  389. package/dist/index.d.ts +2 -0
  390. package/dist/index.d.ts.map +1 -1
  391. package/dist/index.js +10 -8
  392. package/dist/index.js.map +1 -1
  393. package/dist/lib/date-predicates.d.ts +7 -5
  394. package/dist/lib/date-predicates.d.ts.map +1 -1
  395. package/dist/lib/date-value.d.ts +20 -0
  396. package/dist/lib/date-value.d.ts.map +1 -1
  397. package/dist/lib/floating-arrow.d.ts +53 -0
  398. package/dist/lib/floating-arrow.d.ts.map +1 -0
  399. package/dist/lib/focus-return.d.ts +53 -0
  400. package/dist/lib/focus-return.d.ts.map +1 -0
  401. package/dist/lib/meter.d.ts +104 -0
  402. package/dist/lib/meter.d.ts.map +1 -0
  403. package/dist/lib/overlay-layer.d.ts +26 -8
  404. package/dist/lib/overlay-layer.d.ts.map +1 -1
  405. package/dist/lib/pressed.d.ts +92 -0
  406. package/dist/lib/pressed.d.ts.map +1 -0
  407. package/dist/lib/tree-data.d.ts +18 -2
  408. package/dist/lib/tree-data.d.ts.map +1 -1
  409. package/dist/lib/use-pagination.d.ts +102 -0
  410. package/dist/lib/use-pagination.d.ts.map +1 -0
  411. package/dist/lib/use-scroll-spy.d.ts +126 -0
  412. package/dist/lib/use-scroll-spy.d.ts.map +1 -0
  413. package/dist/theme.css +39 -3
  414. package/package.json +1 -1
  415. package/src/as-child.contract.test.tsx +283 -1
  416. package/src/components/action-icon/action-icon.tsx +34 -4
  417. package/src/components/anchor/anchor.test.tsx +232 -0
  418. package/src/components/anchor/anchor.tsx +187 -0
  419. package/src/components/anchor/index.ts +12 -0
  420. package/src/components/app-shell/app-shell.test.tsx +15 -7
  421. package/src/components/app-shell/app-shell.tsx +27 -20
  422. package/src/components/autocomplete/autocomplete.tsx +11 -3
  423. package/src/components/button/button-pressed.test.tsx +202 -0
  424. package/src/components/button/button.tsx +48 -6
  425. package/src/components/button-select/button-select-control.tsx +2 -2
  426. package/src/components/button-select/button-select.tsx +22 -2
  427. package/src/components/calendar/aliases.tsx +28 -0
  428. package/src/components/calendar/calendar-body.tsx +310 -210
  429. package/src/components/calendar/calendar.tsx +43 -12
  430. package/src/components/calendar/index.ts +7 -1
  431. package/src/components/calendar/month-year-calendar.test.tsx +106 -0
  432. package/src/components/calendar-heatmap/calendar-heatmap.tsx +88 -73
  433. package/src/components/checkbox/checkbox.tsx +7 -2
  434. package/src/components/choice-card-group/choice-card-group.tsx +2 -2
  435. package/src/components/circular-progress/circular-progress.test.tsx +35 -0
  436. package/src/components/circular-progress/circular-progress.tsx +116 -59
  437. package/src/components/circular-progress/index.ts +1 -0
  438. package/src/components/code/code.test.tsx +16 -0
  439. package/src/components/code/code.tsx +11 -0
  440. package/src/components/combobox/combobox.tsx +63 -28
  441. package/src/components/combobox-list/combobox-list.tsx +11 -3
  442. package/src/components/data-list/data-list.test.tsx +149 -0
  443. package/src/components/data-list/data-list.tsx +268 -0
  444. package/src/components/data-list/index.ts +9 -0
  445. package/src/components/data-table/data-table-group.test.tsx +16 -0
  446. package/src/components/data-table/data-table-group.tsx +15 -2
  447. package/src/components/data-table/data-table-placeholder.tsx +28 -36
  448. package/src/components/data-table/data-table-stack.tsx +33 -39
  449. package/src/components/data-table/data-table.test.tsx +31 -0
  450. package/src/components/data-table/data-table.tsx +41 -42
  451. package/src/components/date-picker/aliases.tsx +28 -0
  452. package/src/components/date-picker/date-picker.test.tsx +29 -0
  453. package/src/components/date-picker/date-picker.tsx +164 -45
  454. package/src/components/date-picker/index.ts +5 -1
  455. package/src/components/date-picker/month-year-picker.test.tsx +362 -0
  456. package/src/components/drawer/drawer.test.tsx +41 -0
  457. package/src/components/drawer/drawer.tsx +7 -1
  458. package/src/components/empty-state/empty-state.test.tsx +109 -0
  459. package/src/components/empty-state/empty-state.tsx +180 -0
  460. package/src/components/empty-state/index.ts +9 -0
  461. package/src/components/field/field.tsx +35 -1
  462. package/src/components/fieldset/fieldset.test.tsx +352 -0
  463. package/src/components/fieldset/fieldset.tsx +268 -0
  464. package/src/components/fieldset/index.ts +11 -0
  465. package/src/components/file-preview/file-preview.test.tsx +2 -1
  466. package/src/components/file-preview/file-preview.tsx +7 -13
  467. package/src/components/file-upload/file-upload.tsx +14 -5
  468. package/src/components/hover-card/hover-card.tsx +5 -1
  469. package/src/components/input/input.tsx +12 -5
  470. package/src/components/kbd/kbd.test.tsx +13 -0
  471. package/src/components/kbd/kbd.tsx +6 -0
  472. package/src/components/menu/menu.tsx +6 -2
  473. package/src/components/modal/modal.test.tsx +41 -0
  474. package/src/components/modal/modal.tsx +17 -9
  475. package/src/components/multi-combobox-list/multi-combobox-list.tsx +11 -3
  476. package/src/components/multi-select/multi-select.tsx +11 -3
  477. package/src/components/notification/create-notifier.tsx +1 -1
  478. package/src/components/number-input/number-input.tsx +12 -3
  479. package/src/components/overlays/dialog-parts.tsx +42 -5
  480. package/src/components/pagination/index.ts +19 -0
  481. package/src/components/pagination/pagination.test.tsx +187 -0
  482. package/src/components/pagination/pagination.tsx +563 -0
  483. package/src/components/password-input/password-input.tsx +12 -3
  484. package/src/components/phone-input/phone-input.tsx +12 -3
  485. package/src/components/pills-input/pills-input.tsx +7 -2
  486. package/src/components/pin-input/pin-input.tsx +13 -4
  487. package/src/components/popover/popover.tsx +87 -17
  488. package/src/components/progress/index.ts +1 -0
  489. package/src/components/progress/progress.test.tsx +102 -0
  490. package/src/components/progress/progress.tsx +116 -62
  491. package/src/components/prose/index.ts +1 -0
  492. package/src/components/prose/prose.test.tsx +90 -0
  493. package/src/components/prose/prose.tsx +60 -0
  494. package/src/components/prose/styles.css +593 -0
  495. package/src/components/radio-group/radio-group.tsx +8 -3
  496. package/src/components/rating/rating.tsx +5 -2
  497. package/src/components/scroll-area/index.ts +18 -0
  498. package/src/components/scroll-area/scroll-area.test.tsx +184 -0
  499. package/src/components/scroll-area/scroll-area.tsx +448 -0
  500. package/src/components/segment-group/segment-group.tsx +2 -2
  501. package/src/components/select/select.tsx +37 -18
  502. package/src/components/slider/slider.tsx +2 -2
  503. package/src/components/splitter/index.ts +15 -0
  504. package/src/components/splitter/splitter.test.tsx +244 -0
  505. package/src/components/splitter/splitter.tsx +625 -0
  506. package/src/components/spotlight/spotlight.test.tsx +34 -26
  507. package/src/components/spotlight/spotlight.tsx +7 -9
  508. package/src/components/steps/index.ts +21 -0
  509. package/src/components/steps/steps-data.tsx +179 -0
  510. package/src/components/steps/steps.test.tsx +235 -0
  511. package/src/components/steps/steps.tsx +686 -0
  512. package/src/components/switch/switch.tsx +7 -2
  513. package/src/components/table-of-contents/index.ts +17 -0
  514. package/src/components/table-of-contents/table-of-contents.test.tsx +289 -0
  515. package/src/components/table-of-contents/table-of-contents.tsx +708 -0
  516. package/src/components/tags-input/tags-input.tsx +12 -3
  517. package/src/components/textarea/textarea.tsx +15 -5
  518. package/src/components/timeline/timeline.test.tsx +22 -0
  519. package/src/components/timeline/timeline.tsx +10 -1
  520. package/src/components/tooltip/tooltip.tsx +8 -17
  521. package/src/components/tour/conditions.test.ts +527 -0
  522. package/src/components/tour/conditions.ts +445 -0
  523. package/src/components/tour/create-tours.tsx +150 -0
  524. package/src/components/tour/index.ts +86 -0
  525. package/src/components/tour/runtime.ts +187 -0
  526. package/src/components/tour/storage.test.ts +68 -0
  527. package/src/components/tour/storage.ts +44 -0
  528. package/src/components/tour/store.test.tsx +784 -0
  529. package/src/components/tour/store.ts +661 -0
  530. package/src/components/tour/tour.test.tsx +318 -0
  531. package/src/components/tour/tour.tsx +773 -0
  532. package/src/components/tour/tour.types.test.ts +185 -0
  533. package/src/components/tour/types.ts +904 -0
  534. package/src/components/tree/index.ts +24 -0
  535. package/src/components/tree/tree-row.tsx +179 -0
  536. package/src/components/tree/tree.test.tsx +296 -0
  537. package/src/components/tree/tree.tsx +796 -0
  538. package/src/components/tree-multi-select/tree-multi-select.tsx +29 -58
  539. package/src/components/tree-select/tree-popover.tsx +26 -107
  540. package/src/components/tree-select/tree-select.tsx +24 -16
  541. package/src/icon-stroke.test.tsx +2 -0
  542. package/src/index.ts +16 -0
  543. package/src/lib/date-predicates.test.ts +46 -0
  544. package/src/lib/date-predicates.ts +44 -24
  545. package/src/lib/date-value.test.ts +24 -1
  546. package/src/lib/date-value.ts +42 -1
  547. package/src/lib/floating-arrow.tsx +73 -0
  548. package/src/lib/focus-return.test.tsx +143 -0
  549. package/src/lib/focus-return.ts +106 -0
  550. package/src/lib/meter.test.ts +40 -0
  551. package/src/lib/meter.ts +159 -0
  552. package/src/lib/overlay-layer.test.tsx +47 -1
  553. package/src/lib/overlay-layer.tsx +65 -8
  554. package/src/lib/pressed.ts +130 -0
  555. package/src/lib/tree-data.ts +42 -2
  556. package/src/lib/use-pagination.test.ts +105 -0
  557. package/src/lib/use-pagination.ts +179 -0
  558. package/src/lib/use-scroll-spy.test.tsx +238 -0
  559. package/src/lib/use-scroll-spy.ts +336 -0
  560. package/src/theme.css +39 -3
  561. package/src/theme.test.ts +29 -1
  562. package/src/visually-hidden-containment.test.tsx +9 -0
  563. package/dist/chunk-2W7H43WL.js.map +0 -1
  564. package/dist/chunk-7E7JNWOC.js.map +0 -1
  565. package/dist/chunk-7FPSQBWB.js.map +0 -1
  566. package/dist/chunk-7KFUFAVP.js.map +0 -1
  567. package/dist/chunk-AKXALCUN.js.map +0 -1
  568. package/dist/chunk-B5YHYI7E.js.map +0 -1
  569. package/dist/chunk-FQJNQW3G.js.map +0 -1
  570. package/dist/chunk-G3AD3NJG.js.map +0 -1
  571. package/dist/chunk-GEZYGBXY.js.map +0 -1
  572. package/dist/chunk-HCHGERDB.js.map +0 -1
  573. package/dist/chunk-HWBFRDX7.js.map +0 -1
  574. package/dist/chunk-I4B3N3UX.js.map +0 -1
  575. package/dist/chunk-IA6DCC3N.js.map +0 -1
  576. package/dist/chunk-IANYMDKH.js.map +0 -1
  577. package/dist/chunk-MQHD3EJE.js.map +0 -1
  578. package/dist/chunk-NNPSBC7O.js.map +0 -1
  579. package/dist/chunk-OXR7BXZA.js.map +0 -1
  580. package/dist/chunk-QKSLDQM2.js +0 -120
  581. package/dist/chunk-QKSLDQM2.js.map +0 -1
  582. package/dist/chunk-QRNQQIQM.js.map +0 -1
  583. package/dist/chunk-RKCUXOU2.js.map +0 -1
  584. package/dist/chunk-S5CQRCTF.js +0 -426
  585. package/dist/chunk-S5CQRCTF.js.map +0 -1
  586. package/dist/chunk-SBZJGFZ6.js.map +0 -1
  587. package/dist/chunk-SP6LCCTZ.js.map +0 -1
  588. package/dist/chunk-TUP7WXQE.js.map +0 -1
  589. package/dist/chunk-V2QZG4IT.js.map +0 -1
  590. package/dist/chunk-X6DESK37.js.map +0 -1
  591. package/dist/chunk-ZB5VMGKB.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/password-input/password-input.tsx"],"names":["Ark"],"mappings":";;;;;;;;;;;;;;AAoEO,IAAM,aAAA,GAA0D;AAAA,EACrE,IAAA,kBAAM,GAAA,CAAC,GAAA,EAAA,EAAI,SAAA,EAAW,UAAA,EAAY,CAAA;AAAA,EAClC,IAAA,kBAAM,GAAA,CAAC,MAAA,EAAA,EAAO,SAAA,EAAW,UAAA,EAAY;AACvC,CAAA;AA0EA,IAAM,qBAAqB,CAAC;AAAA,EAC1B,GAAA;AAAA,EACA,KAAA;AAAA,EACA,YAAA;AAAA,EACA,QAAA;AAAA,EACA,MAAA;AAAA,EACA,IAAA;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EAAO,CAAA;AAAA,sBAC7B,UAAA,EAAY;AAAA,qBACd;AAAA,oBAEC,QAAA,EAAA,YAAA,uBACEA,eAAA,CAAI,OAAA,EAAJ,EAAa,QAAA,EAAA,CAAC,GAAA,KAAQ,aAAa,GAAA,CAAI,OAAO,GAAE,CAAA,mBAEjD,GAAA,CAACA,gBAAI,SAAA,EAAJ,EAAc,UAAU,KAAA,CAAM,IAAA,EAAO,gBAAM,IAAA,EAAK;AAAA;AAAA;AAErD;AAAA;AAAA;AAEJ;AAAA;AACF;AAAA,GACF;AAEJ","file":"index.js","sourcesContent":["\"use client\"\n\nimport { useFieldContext } from \"@ark-ui/react/field\"\nimport { PasswordInput as Ark, usePasswordInputContext } from \"@ark-ui/react/password-input\"\nimport { Eye, EyeOff } from \"lucide-react\"\nimport type {\n ChangeEvent,\n ComponentPropsWithoutRef,\n FocusEvent,\n MouseEvent,\n ReactNode,\n Ref,\n} from \"react\"\nimport { useEffect, useRef } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { devWarn } from \"../../lib/dev-warn\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport { type IconMap, iconStroke, mergeIcons } from \"../../lib/icons\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { type FieldProps, FieldShell, fieldA11yProps } from \"../field/field\"\nimport {\n InputBase,\n type InputSize,\n type InputVariant,\n inputControlClasses,\n inputSlot,\n} from \"../input/input\"\n\n/**\n * PasswordInput — a native password field with a built-in show / hide toggle.\n * Like {@link Input} it is **event-based**: `value` / `onChange` / `name`\n * forward to the underlying `<input>` (so RHF's `register` and a plain\n * `onChange` handler work as usual). Like the rest of the family it carries its\n * own `label` / `description` / `error` / `required` via [`Field`](/docs/field),\n * so it's complete on its own; `error` flips it to the invalid (red) state.\n *\n * The reveal toggle is owned by Ark's `PasswordInput` machine — it flips the\n * input `type` between `password` and `text` and swaps the indicator icon. The\n * machine is field-aware, so nested in the built-in `Field` it inherits the\n * `id`, `aria-describedby`, and disabled / invalid / read-only state.\n *\n * The toggle renders as a real `<button>` sibling of the input — NOT via the\n * shell's decorative `endSlot`, whose wrapper span is `aria-hidden` and would\n * hide the control from assistive tech. As a direct child it stays clickable\n * and exposed to AT, with `aria-controls` pointing at the input. It is a tab\n * stop by default (zag ships it at `tabIndex={-1}`, which left keyboard users\n * no way to reveal the value); `toggleTabIndex={-1}` restores that.\n *\n * The reveal state can be lifted out (`visible` / `defaultVisible` /\n * `onVisibleChange`), e.g. to drive several fields from one \"Show\n * passwords\" checkbox. `renderToggle` swaps what renders *inside* the kit's\n * button — which keeps its a11y wiring — and `hideToggle` drops the button so\n * an external control owns the state.\n */\n\n/** Ark's own `translations` prop type, derived structurally rather than imported by name —\n * `IntlTranslations` lives in `@zag-js/password-input`, a transitive dependency of the\n * `@ark-ui/react` peer dep, not one this package declares itself. */\nexport type PasswordInputTranslations = NonNullable<\n ComponentPropsWithoutRef<typeof Ark.Root>[\"translations\"]\n>\n\nexport type PasswordInputIconSlot = \"show\" | \"hide\"\nexport type PasswordInputIcons = IconMap<PasswordInputIconSlot>\n\n/** The default icons, named for what the toggle does: `show` while the value\n * is hidden, `hide` while it is shown. */\nexport const DEFAULT_ICONS: Record<PasswordInputIconSlot, ReactNode> = {\n show: <Eye className={iconStroke} />,\n hide: <EyeOff className={iconStroke} />,\n}\n\nexport type PasswordInputProps = Pick<FieldProps, \"label\" | \"description\" | \"error\" | \"required\"> &\n WithTestId & {\n /** Controlled value, forwarded to the native input. */\n value?: string\n /** Uncontrolled initial value. */\n defaultValue?: string\n /** Native change event (forwarded straight to the `<input>`). */\n onChange?: (e: ChangeEvent<HTMLInputElement>) => void\n /** Field name for native form submission. */\n name?: string\n /** Placeholder shown while the field is empty. */\n placeholder?: string\n /** Shell treatment: bordered (`default`), soft-filled, or chrome-less. */\n variant?: InputVariant\n /** Height step / control font / slot icon size. */\n size?: InputSize\n /** Red border + ring; also wires `aria-invalid`. OR'd with `error`. */\n invalid?: boolean\n /** Dims the shell and disables the input + toggle. */\n disabled?: boolean\n /** Keeps full contrast but blocks edits. */\n readOnly?: boolean\n /** Controlled reveal state: `true` shows the value as plain text. */\n visible?: boolean\n /** Uncontrolled initial reveal state. */\n defaultVisible?: boolean\n /** Fires with the next reveal state when the toggle is pressed. */\n onVisibleChange?: (visible: boolean) => void\n /**\n * Content of the reveal button, called with the current state — the button\n * itself (and its `aria-*` wiring) stays the kit's. Its accessible name\n * still comes from `translations`: if you render visible text, pass\n * `translations` whose label contains that text (WCAG 2.5.3).\n */\n renderToggle?: (visible: boolean) => ReactNode\n /** Replaces the toggle's icons: `show` while the value is hidden, `hide`\n * while it is shown. A missing key keeps its default; `renderToggle` wins. */\n icons?: PasswordInputIcons\n /**\n * Renders no reveal button at all; pair it with `visible` driven by your\n * own control. `renderToggle` is ignored while it is set.\n */\n hideToggle?: boolean\n /**\n * `tabIndex` of the reveal button. Defaults to `0`, so keyboard users can\n * reach it; `-1` takes it out of the tab order, leaving it a pointer-only\n * convenience.\n */\n toggleTabIndex?: number\n /** Localized accessible label of the reveal button. It names the button\n * even when `renderToggle` renders text, so it must contain that text. */\n translations?: PasswordInputTranslations\n /** Decorative or interactive content at the inline-start of the control. */\n startSlot?: ReactNode\n /** Explicit id for label association. */\n id?: string\n /** Lands on the underlying `<input>` for focus-on-error. */\n ref?: Ref<HTMLInputElement>\n /** Forwarded to the input; drives touched / blurred validation. */\n onBlur?: (e: FocusEvent<HTMLInputElement>) => void\n /** Styles the shell root. */\n className?: string\n /** Per-part class overrides. `visibilityTrigger` lands on the reveal\n * button, merged after the kit's own classes so it can override them. */\n classNames?: { field?: string; root?: string; input?: string; visibilityTrigger?: string }\n }\n\n/**\n * The real `<input>`, split out so it reads the `Field` context from *inside*\n * the wrapping `FieldShell` — `PasswordInput` itself renders that shell, so\n * calling `useFieldContext()` at its own top level would run too early.\n */\nconst PasswordInputField = ({\n ref,\n value,\n defaultValue,\n onChange,\n onBlur,\n name,\n placeholder,\n testId,\n className,\n}: Pick<\n PasswordInputProps,\n \"ref\" | \"value\" | \"defaultValue\" | \"onChange\" | \"onBlur\" | \"name\" | \"placeholder\" | \"testId\"\n> & { className?: string }) => {\n const field = useFieldContext()\n return (\n <Ark.Input\n ref={ref}\n value={value}\n defaultValue={defaultValue}\n onChange={onChange}\n onBlur={onBlur}\n name={name}\n placeholder={placeholder}\n {...fieldA11yProps(field)}\n {...props({ \"data-testid\": testId })}\n className={className}\n />\n )\n}\n\n/**\n * The reveal button. Built from the machine's trigger props rather than Ark's\n * `VisibilityTrigger` part, because two of those props are wrong for a\n * reveal toggle and `mergeProps` can't remove a key, only override it:\n *\n * - `tabIndex: -1` — overridden by `tabIndex` (default `0`).\n * - `aria-expanded` — dropped. Showing a value isn't expanding anything, so\n * AT announced \"Hide password, expanded\". The state already lives in the\n * label, which flips between \"Show password\" and \"Hide password\"; an\n * `aria-pressed` on top would read \"Hide password, pressed\", which the\n * ARIA APG advises against for a toggle whose label changes with state.\n *\n * zag toggles on `pointerdown` only, so a keyboard press (Enter / Space) or an\n * AT \"click\" — both a `click` with `detail === 0` — did nothing. `onClick`\n * covers them, with the same read-only / disabled guard the machine applies.\n *\n * The `aria-label` always comes from `translations` (zag's English default\n * otherwise), so it overrides whatever `renderToggle` renders. For an icon\n * that's what you want; for visible text it fails WCAG 2.5.3 (Label in Name)\n * unless the label contains that text — a voice-control user saying \"click\n * Afficher\" can't hit a button named \"Show password\". Content can't be read\n * at render time, so `custom` turns on a dev-only check of the rendered DOM.\n */\nconst PasswordInputToggle = ({\n tabIndex,\n custom,\n className,\n children,\n}: {\n tabIndex: number\n custom: boolean\n className: string\n children: ReactNode\n}) => {\n const api = usePasswordInputContext()\n const { \"aria-expanded\": _expanded, ...trigger } = api.getVisibilityTriggerProps()\n const label = trigger[\"aria-label\"]\n const ref = useRef<HTMLButtonElement>(null)\n useEffect(() => {\n if (!custom) return\n const text = ref.current?.textContent?.trim() ?? \"\"\n // Only real words count — an icon contributes no text content.\n if (!/\\p{L}/u.test(text)) return\n if (label?.toLocaleLowerCase().includes(text.toLocaleLowerCase())) return\n devWarn(\n `PasswordInput: \\`renderToggle\\` renders the text \"${text}\", but the button's accessible name is \"${label}\". ` +\n \"Pass `translations.visibilityTrigger` returning a label that contains the visible text (WCAG 2.5.3, Label in Name).\",\n )\n }, [custom, label])\n // The machine's own resolved read-only state (prop or Field) — the trigger\n // props only carry it as an untyped `data-readonly`.\n const interactive = !api.disabled && !api.getInputProps().readOnly\n return (\n <button\n {...trigger}\n ref={ref}\n tabIndex={tabIndex}\n className={className}\n onClick={(event: MouseEvent<HTMLButtonElement>) => {\n // Pointer clicks were already handled on pointerdown.\n if (event.detail !== 0 || !interactive) return\n api.toggleVisible()\n }}\n >\n {children}\n </button>\n )\n}\n\nexport const PasswordInput = ({\n value,\n defaultValue,\n onChange,\n name,\n placeholder,\n variant,\n size,\n invalid,\n disabled,\n readOnly,\n required,\n label,\n description,\n error,\n visible,\n defaultVisible,\n onVisibleChange,\n renderToggle,\n icons: iconsProp,\n hideToggle,\n toggleTabIndex = 0,\n translations,\n startSlot,\n id,\n ref,\n onBlur,\n className,\n classNames,\n testId,\n}: PasswordInputProps) => {\n // Drive the red state independently of the `Field` error slot so a form\n // library can flip it from `fieldState.invalid` (see FormControlProps).\n const isInvalid = invalid || error != null\n const icons = mergeIcons(DEFAULT_ICONS, iconsProp)\n\n return (\n <FieldShell\n label={label}\n description={description}\n error={error}\n required={required}\n disabled={disabled}\n size={size}\n className={classNames?.field}\n >\n <Ark.Root\n id={id}\n invalid={isInvalid}\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n visible={visible}\n defaultVisible={defaultVisible}\n onVisibilityChange={(details) => onVisibleChange?.(details.visible)}\n translations={translations}\n >\n <InputBase\n variant={variant}\n size={size}\n invalid={isInvalid}\n disabled={disabled}\n readOnly={readOnly}\n startSlot={startSlot}\n className={className}\n classNames={{ root: classNames?.root }}\n >\n <PasswordInputField\n ref={ref}\n value={value}\n defaultValue={defaultValue}\n onChange={onChange}\n onBlur={onBlur}\n name={name}\n placeholder={placeholder}\n testId={testId}\n className={cn(inputControlClasses, classNames?.input)}\n />\n {/* Rendered as a direct sibling — NOT via InputBase's `endSlot`, whose\n wrapper span is `aria-hidden` — so the toggle button stays clickable\n and keyboard-focusable / announced to assistive tech. */}\n {!hideToggle && (\n <PasswordInputToggle\n tabIndex={toggleTabIndex}\n custom={renderToggle !== undefined}\n className={cn(\n inputSlot,\n \"cursor-pointer rounded-xs\",\n // Its own ring, not just the shell's: the shell's `:has()`\n // halo is already on while the input is focused, so it can't\n // tell a keyboard user that focus moved onto the toggle. No\n // offset — the gap would be painted in the page color, a hole\n // punched in the shell's own fill.\n focusStyles({ offset: false }),\n classNames?.visibilityTrigger,\n )}\n >\n {renderToggle ? (\n <Ark.Context>{(api) => renderToggle(api.visible)}</Ark.Context>\n ) : (\n <Ark.Indicator fallback={icons.show}>{icons.hide}</Ark.Indicator>\n )}\n </PasswordInputToggle>\n )}\n </InputBase>\n </Ark.Root>\n </FieldShell>\n )\n}\n"]}
1
+ {"version":3,"sources":["../../../src/components/password-input/password-input.tsx"],"names":["Ark"],"mappings":";;;;;;;;;;;;;;AA0EO,IAAM,aAAA,GAA0D;AAAA,EACrE,IAAA,kBAAM,GAAA,CAAC,GAAA,EAAA,EAAI,SAAA,EAAW,UAAA,EAAY,CAAA;AAAA,EAClC,IAAA,kBAAM,GAAA,CAAC,MAAA,EAAA,EAAO,SAAA,EAAW,UAAA,EAAY;AACvC,CAAA;AA0EA,IAAM,qBAAqB,CAAC;AAAA,EAC1B,GAAA;AAAA,EACA,KAAA;AAAA,EACA,YAAA;AAAA,EACA,QAAA;AAAA,EACA,MAAA;AAAA,EACA,IAAA;AAAA,EACA,WAAA;AAAA,EACA,MAAA;AAAA,EACA;AACF,CAAA,KAG+B;AAC7B,EAAA,MAAM,QAAQ,eAAA,EAAgB;AAC9B,EAAA,uBACE,GAAA;AAAA,IAACA,eAAA,CAAI,KAAA;AAAA,IAAJ;AAAA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ACEA,eAAA,CAAI,OAAA,EAAJ,EAAa,QAAA,EAAA,CAAC,GAAA,KAAQ,aAAa,GAAA,CAAI,OAAO,GAAE,CAAA,mBAEjD,GAAA,CAACA,gBAAI,SAAA,EAAJ,EAAc,UAAU,KAAA,CAAM,IAAA,EAAO,gBAAM,IAAA,EAAK;AAAA;AAAA;AAErD;AAAA;AAAA;AAEJ;AAAA;AACF;AAAA,GACF;AAEJ","file":"index.js","sourcesContent":["\"use client\"\n\nimport { useFieldContext } from \"@ark-ui/react/field\"\nimport { PasswordInput as Ark, usePasswordInputContext } from \"@ark-ui/react/password-input\"\nimport { Eye, EyeOff } from \"lucide-react\"\nimport type {\n ChangeEvent,\n ComponentPropsWithoutRef,\n FocusEvent,\n MouseEvent,\n ReactNode,\n Ref,\n} from \"react\"\nimport { useEffect, useRef } from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { devWarn } from \"../../lib/dev-warn\"\nimport { focusStyles } from \"../../lib/focus-styles\"\nimport { type IconMap, iconStroke, mergeIcons } from \"../../lib/icons\"\nimport { props } from \"../../lib/props\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport {\n type FieldProps,\n FieldShell,\n fieldA11yProps,\n useInheritedDisabled,\n useInheritedInvalid,\n} from \"../field/field\"\nimport {\n InputBase,\n type InputSize,\n type InputVariant,\n inputControlClasses,\n inputSlot,\n} from \"../input/input\"\n\n/**\n * PasswordInput — a native password field with a built-in show / hide toggle.\n * Like {@link Input} it is **event-based**: `value` / `onChange` / `name`\n * forward to the underlying `<input>` (so RHF's `register` and a plain\n * `onChange` handler work as usual). Like the rest of the family it carries its\n * own `label` / `description` / `error` / `required` via [`Field`](/docs/field),\n * so it's complete on its own; `error` flips it to the invalid (red) state.\n *\n * The reveal toggle is owned by Ark's `PasswordInput` machine — it flips the\n * input `type` between `password` and `text` and swaps the indicator icon. The\n * machine is field-aware, so nested in the built-in `Field` it inherits the\n * `id`, `aria-describedby`, and disabled / invalid / read-only state.\n *\n * The toggle renders as a real `<button>` sibling of the input — NOT via the\n * shell's decorative `endSlot`, whose wrapper span is `aria-hidden` and would\n * hide the control from assistive tech. As a direct child it stays clickable\n * and exposed to AT, with `aria-controls` pointing at the input. It is a tab\n * stop by default (zag ships it at `tabIndex={-1}`, which left keyboard users\n * no way to reveal the value); `toggleTabIndex={-1}` restores that.\n *\n * The reveal state can be lifted out (`visible` / `defaultVisible` /\n * `onVisibleChange`), e.g. to drive several fields from one \"Show\n * passwords\" checkbox. `renderToggle` swaps what renders *inside* the kit's\n * button — which keeps its a11y wiring — and `hideToggle` drops the button so\n * an external control owns the state.\n */\n\n/** Ark's own `translations` prop type, derived structurally rather than imported by name —\n * `IntlTranslations` lives in `@zag-js/password-input`, a transitive dependency of the\n * `@ark-ui/react` peer dep, not one this package declares itself. */\nexport type PasswordInputTranslations = NonNullable<\n ComponentPropsWithoutRef<typeof Ark.Root>[\"translations\"]\n>\n\nexport type PasswordInputIconSlot = \"show\" | \"hide\"\nexport type PasswordInputIcons = IconMap<PasswordInputIconSlot>\n\n/** The default icons, named for what the toggle does: `show` while the value\n * is hidden, `hide` while it is shown. */\nexport const DEFAULT_ICONS: Record<PasswordInputIconSlot, ReactNode> = {\n show: <Eye className={iconStroke} />,\n hide: <EyeOff className={iconStroke} />,\n}\n\nexport type PasswordInputProps = Pick<FieldProps, \"label\" | \"description\" | \"error\" | \"required\"> &\n WithTestId & {\n /** Controlled value, forwarded to the native input. */\n value?: string\n /** Uncontrolled initial value. */\n defaultValue?: string\n /** Native change event (forwarded straight to the `<input>`). */\n onChange?: (e: ChangeEvent<HTMLInputElement>) => void\n /** Field name for native form submission. */\n name?: string\n /** Placeholder shown while the field is empty. */\n placeholder?: string\n /** Shell treatment: bordered (`default`), soft-filled, or chrome-less. */\n variant?: InputVariant\n /** Height step / control font / slot icon size. */\n size?: InputSize\n /** Red border + ring; also wires `aria-invalid`. OR'd with `error`. */\n invalid?: boolean\n /** Dims the shell and disables the input + toggle. */\n disabled?: boolean\n /** Keeps full contrast but blocks edits. */\n readOnly?: boolean\n /** Controlled reveal state: `true` shows the value as plain text. */\n visible?: boolean\n /** Uncontrolled initial reveal state. */\n defaultVisible?: boolean\n /** Fires with the next reveal state when the toggle is pressed. */\n onVisibleChange?: (visible: boolean) => void\n /**\n * Content of the reveal button, called with the current state — the button\n * itself (and its `aria-*` wiring) stays the kit's. Its accessible name\n * still comes from `translations`: if you render visible text, pass\n * `translations` whose label contains that text (WCAG 2.5.3).\n */\n renderToggle?: (visible: boolean) => ReactNode\n /** Replaces the toggle's icons: `show` while the value is hidden, `hide`\n * while it is shown. A missing key keeps its default; `renderToggle` wins. */\n icons?: PasswordInputIcons\n /**\n * Renders no reveal button at all; pair it with `visible` driven by your\n * own control. `renderToggle` is ignored while it is set.\n */\n hideToggle?: boolean\n /**\n * `tabIndex` of the reveal button. Defaults to `0`, so keyboard users can\n * reach it; `-1` takes it out of the tab order, leaving it a pointer-only\n * convenience.\n */\n toggleTabIndex?: number\n /** Localized accessible label of the reveal button. It names the button\n * even when `renderToggle` renders text, so it must contain that text. */\n translations?: PasswordInputTranslations\n /** Decorative or interactive content at the inline-start of the control. */\n startSlot?: ReactNode\n /** Explicit id for label association. */\n id?: string\n /** Lands on the underlying `<input>` for focus-on-error. */\n ref?: Ref<HTMLInputElement>\n /** Forwarded to the input; drives touched / blurred validation. */\n onBlur?: (e: FocusEvent<HTMLInputElement>) => void\n /** Styles the shell root. */\n className?: string\n /** Per-part class overrides. `visibilityTrigger` lands on the reveal\n * button, merged after the kit's own classes so it can override them. */\n classNames?: { field?: string; root?: string; input?: string; visibilityTrigger?: string }\n }\n\n/**\n * The real `<input>`, split out so it reads the `Field` context from *inside*\n * the wrapping `FieldShell` — `PasswordInput` itself renders that shell, so\n * calling `useFieldContext()` at its own top level would run too early.\n */\nconst PasswordInputField = ({\n ref,\n value,\n defaultValue,\n onChange,\n onBlur,\n name,\n placeholder,\n testId,\n className,\n}: Pick<\n PasswordInputProps,\n \"ref\" | \"value\" | \"defaultValue\" | \"onChange\" | \"onBlur\" | \"name\" | \"placeholder\" | \"testId\"\n> & { className?: string }) => {\n const field = useFieldContext()\n return (\n <Ark.Input\n ref={ref}\n value={value}\n defaultValue={defaultValue}\n onChange={onChange}\n onBlur={onBlur}\n name={name}\n placeholder={placeholder}\n {...fieldA11yProps(field)}\n {...props({ \"data-testid\": testId })}\n className={className}\n />\n )\n}\n\n/**\n * The reveal button. Built from the machine's trigger props rather than Ark's\n * `VisibilityTrigger` part, because two of those props are wrong for a\n * reveal toggle and `mergeProps` can't remove a key, only override it:\n *\n * - `tabIndex: -1` — overridden by `tabIndex` (default `0`).\n * - `aria-expanded` — dropped. Showing a value isn't expanding anything, so\n * AT announced \"Hide password, expanded\". The state already lives in the\n * label, which flips between \"Show password\" and \"Hide password\"; an\n * `aria-pressed` on top would read \"Hide password, pressed\", which the\n * ARIA APG advises against for a toggle whose label changes with state.\n *\n * zag toggles on `pointerdown` only, so a keyboard press (Enter / Space) or an\n * AT \"click\" — both a `click` with `detail === 0` — did nothing. `onClick`\n * covers them, with the same read-only / disabled guard the machine applies.\n *\n * The `aria-label` always comes from `translations` (zag's English default\n * otherwise), so it overrides whatever `renderToggle` renders. For an icon\n * that's what you want; for visible text it fails WCAG 2.5.3 (Label in Name)\n * unless the label contains that text — a voice-control user saying \"click\n * Afficher\" can't hit a button named \"Show password\". Content can't be read\n * at render time, so `custom` turns on a dev-only check of the rendered DOM.\n */\nconst PasswordInputToggle = ({\n tabIndex,\n custom,\n className,\n children,\n}: {\n tabIndex: number\n custom: boolean\n className: string\n children: ReactNode\n}) => {\n const api = usePasswordInputContext()\n const { \"aria-expanded\": _expanded, ...trigger } = api.getVisibilityTriggerProps()\n const label = trigger[\"aria-label\"]\n const ref = useRef<HTMLButtonElement>(null)\n useEffect(() => {\n if (!custom) return\n const text = ref.current?.textContent?.trim() ?? \"\"\n // Only real words count — an icon contributes no text content.\n if (!/\\p{L}/u.test(text)) return\n if (label?.toLocaleLowerCase().includes(text.toLocaleLowerCase())) return\n devWarn(\n `PasswordInput: \\`renderToggle\\` renders the text \"${text}\", but the button's accessible name is \"${label}\". ` +\n \"Pass `translations.visibilityTrigger` returning a label that contains the visible text (WCAG 2.5.3, Label in Name).\",\n )\n }, [custom, label])\n // The machine's own resolved read-only state (prop or Field) — the trigger\n // props only carry it as an untyped `data-readonly`.\n const interactive = !api.disabled && !api.getInputProps().readOnly\n return (\n <button\n {...trigger}\n ref={ref}\n tabIndex={tabIndex}\n className={className}\n onClick={(event: MouseEvent<HTMLButtonElement>) => {\n // Pointer clicks were already handled on pointerdown.\n if (event.detail !== 0 || !interactive) return\n api.toggleVisible()\n }}\n >\n {children}\n </button>\n )\n}\n\nexport const PasswordInput = ({\n value,\n defaultValue,\n onChange,\n name,\n placeholder,\n variant,\n size,\n invalid,\n disabled: disabledProp,\n readOnly,\n required,\n label,\n description,\n error,\n visible,\n defaultVisible,\n onVisibleChange,\n renderToggle,\n icons: iconsProp,\n hideToggle,\n toggleTabIndex = 0,\n translations,\n startSlot,\n id,\n ref,\n onBlur,\n className,\n classNames,\n testId,\n}: PasswordInputProps) => {\n // An enclosing `Field` or `Fieldset` disables it too: the shell only dims on\n // the `disabled` handed to it here.\n const disabled = useInheritedDisabled(disabledProp)\n // Drive the red state independently of the `Field` error slot so a form\n // library can flip it from `fieldState.invalid` (see FormControlProps).\n const isInvalid = useInheritedInvalid(invalid || error != null)\n const icons = mergeIcons(DEFAULT_ICONS, iconsProp)\n\n return (\n <FieldShell\n label={label}\n description={description}\n error={error}\n required={required}\n disabled={disabled}\n size={size}\n className={classNames?.field}\n >\n <Ark.Root\n id={id}\n invalid={isInvalid}\n disabled={disabled}\n readOnly={readOnly}\n required={required}\n visible={visible}\n defaultVisible={defaultVisible}\n onVisibilityChange={(details) => onVisibleChange?.(details.visible)}\n translations={translations}\n >\n <InputBase\n variant={variant}\n size={size}\n invalid={isInvalid}\n disabled={disabled}\n readOnly={readOnly}\n startSlot={startSlot}\n className={className}\n classNames={{ root: classNames?.root }}\n >\n <PasswordInputField\n ref={ref}\n value={value}\n defaultValue={defaultValue}\n onChange={onChange}\n onBlur={onBlur}\n name={name}\n placeholder={placeholder}\n testId={testId}\n className={cn(inputControlClasses, classNames?.input)}\n />\n {/* Rendered as a direct sibling — NOT via InputBase's `endSlot`, whose\n wrapper span is `aria-hidden` — so the toggle button stays clickable\n and keyboard-focusable / announced to assistive tech. */}\n {!hideToggle && (\n <PasswordInputToggle\n tabIndex={toggleTabIndex}\n custom={renderToggle !== undefined}\n className={cn(\n inputSlot,\n \"cursor-pointer rounded-xs\",\n // Its own ring, not just the shell's: the shell's `:has()`\n // halo is already on while the input is focused, so it can't\n // tell a keyboard user that focus moved onto the toggle. No\n // offset — the gap would be painted in the page color, a hole\n // punched in the shell's own fill.\n focusStyles({ offset: false }),\n classNames?.visibilityTrigger,\n )}\n >\n {renderToggle ? (\n <Ark.Context>{(api) => renderToggle(api.visible)}</Ark.Context>\n ) : (\n <Ark.Indicator fallback={icons.show}>{icons.hide}</Ark.Indicator>\n )}\n </PasswordInputToggle>\n )}\n </InputBase>\n </Ark.Root>\n </FieldShell>\n )\n}\n"]}
@@ -109,5 +109,5 @@ export type PasswordInputProps = Pick<FieldProps, "label" | "description" | "err
109
109
  visibilityTrigger?: string;
110
110
  };
111
111
  };
112
- export declare const PasswordInput: ({ value, defaultValue, onChange, name, placeholder, variant, size, invalid, disabled, readOnly, required, label, description, error, visible, defaultVisible, onVisibleChange, renderToggle, icons: iconsProp, hideToggle, toggleTabIndex, translations, startSlot, id, ref, onBlur, className, classNames, testId, }: PasswordInputProps) => import("react").JSX.Element;
112
+ export declare const PasswordInput: ({ value, defaultValue, onChange, name, placeholder, variant, size, invalid, disabled: disabledProp, readOnly, required, label, description, error, visible, defaultVisible, onVisibleChange, renderToggle, icons: iconsProp, hideToggle, toggleTabIndex, translations, startSlot, id, ref, onBlur, className, classNames, testId, }: PasswordInputProps) => import("react").JSX.Element;
113
113
  //# sourceMappingURL=password-input.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"password-input.d.ts","sourceRoot":"","sources":["../../../src/components/password-input/password-input.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,IAAI,GAAG,EAA2B,MAAM,8BAA8B,CAAA;AAE5F,OAAO,KAAK,EACV,WAAW,EACX,wBAAwB,EACxB,UAAU,EAEV,SAAS,EACT,GAAG,EACJ,MAAM,OAAO,CAAA;AAKd,OAAO,EAAE,KAAK,OAAO,EAA0B,MAAM,iBAAiB,CAAA;AAEtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EAAE,KAAK,UAAU,EAA8B,MAAM,gBAAgB,CAAA;AAC5E,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,YAAY,EAGlB,MAAM,gBAAgB,CAAA;AAEvB;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH;;sEAEsE;AACtE,MAAM,MAAM,yBAAyB,GAAG,WAAW,CACjD,wBAAwB,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,CAAC,cAAc,CAAC,CAC1D,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,MAAM,CAAA;AACnD,MAAM,MAAM,kBAAkB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAA;AAE/D;2CAC2C;AAC3C,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,qBAAqB,EAAE,SAAS,CAGlE,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,UAAU,EAAE,OAAO,GAAG,aAAa,GAAG,OAAO,GAAG,UAAU,CAAC,GAC/F,UAAU,GAAG;IACX,uDAAuD;IACvD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,kCAAkC;IAClC,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,iEAAiE;IACjE,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,WAAW,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAA;IACrD,6C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C,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,iBAAiB,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAC3F,CAAA;AA2GH,eAAO,MAAM,aAAa,0TA8BvB,kBAAkB,gCA8EpB,CAAA"}
1
+ {"version":3,"file":"password-input.d.ts","sourceRoot":"","sources":["../../../src/components/password-input/password-input.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,aAAa,IAAI,GAAG,EAA2B,MAAM,8BAA8B,CAAA;AAE5F,OAAO,KAAK,EACV,WAAW,EACX,wBAAwB,EACxB,UAAU,EAEV,SAAS,EACT,GAAG,EACJ,MAAM,OAAO,CAAA;AAKd,OAAO,EAAE,KAAK,OAAO,EAA0B,MAAM,iBAAiB,CAAA;AAEtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EACL,KAAK,UAAU,EAKhB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,YAAY,EAGlB,MAAM,gBAAgB,CAAA;AAEvB;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH;;sEAEsE;AACtE,MAAM,MAAM,yBAAyB,GAAG,WAAW,CACjD,wBAAwB,CAAC,OAAO,GAAG,CAAC,IAAI,CAAC,CAAC,cAAc,CAAC,CAC1D,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG,MAAM,GAAG,MAAM,CAAA;AACnD,MAAM,MAAM,kBAAkB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAAA;AAE/D;2CAC2C;AAC3C,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,qBAAqB,EAAE,SAAS,CAGlE,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,UAAU,EAAE,OAAO,GAAG,aAAa,GAAG,OAAO,GAAG,UAAU,CAAC,GAC/F,UAAU,GAAG;IACX,uDAAuD;IACvD,KAAK,CAAC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AE,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAA;IAClD,6BAA6B;IAC7B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;8EAC0E;IAC1E,UAAU,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,iBAAiB,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAC3F,CAAA;AA2GH,eAAO,MAAM,aAAa,wUA8BvB,kBAAkB,gCAiFpB,CAAA"}
@@ -1,23 +1,25 @@
1
1
  "use client";
2
- import { ComboboxList } from '../../chunk-NNPSBC7O.js';
3
- import '../../chunk-ISX3AM32.js';
2
+ import { ComboboxList } from '../../chunk-6WZSUS3U.js';
3
+ import '../../chunk-37SRSNLJ.js';
4
4
  import '../../chunk-7TDHT3QD.js';
5
- import '../../chunk-QRNQQIQM.js';
6
- import { InputBase, inputControlClasses } from '../../chunk-I4B3N3UX.js';
7
- import { FieldShell, fieldA11yProps } from '../../chunk-X6DESK37.js';
5
+ import '../../chunk-WJUY6YWF.js';
6
+ import { InputBase, inputControlClasses } from '../../chunk-HTVICHT4.js';
7
+ import { useInheritedDisabled, useInheritedInvalid, FieldShell, fieldA11yProps } from '../../chunk-2RRTT4AF.js';
8
+ import { Popover, popoverChevron, popoverIndicator } from '../../chunk-YUVKROMA.js';
9
+ import '../../chunk-TPOV3OCC.js';
10
+ import '../../chunk-SI7C3W5M.js';
8
11
  import { useMergedRefs } from '../../chunk-HBWV5EPU.js';
9
12
  import { useLocale } from '../../chunk-OBSZ4NE2.js';
10
- import { Popover, popoverChevron, popoverIndicator } from '../../chunk-RKCUXOU2.js';
11
- import '../../chunk-HWBFRDX7.js';
12
13
  import '../../chunk-V6PY7C6S.js';
13
14
  import '../../chunk-SLUOF7XW.js';
15
+ import { CheckIcon, ChevronIcon } from '../../chunk-6YNLRQ25.js';
16
+ import { mergeIcons, iconStroke } from '../../chunk-XXOR34T4.js';
14
17
  import '../../chunk-PQZSTI3R.js';
15
18
  import '../../chunk-PMUCGFY5.js';
16
19
  import { useIsomorphicLayoutEffect } from '../../chunk-BUIHQJGE.js';
17
- import { CheckIcon, ChevronIcon } from '../../chunk-6YNLRQ25.js';
18
- import { mergeIcons, iconStroke } from '../../chunk-XXOR34T4.js';
19
20
  import '../../chunk-R5LYFTHA.js';
20
21
  import { props } from '../../chunk-WYCMIIRR.js';
22
+ import '../../chunk-C6NVU4F7.js';
21
23
  import { TEXT_COLOR_CLASSES } from '../../chunk-GIPQUKCN.js';
22
24
  import { cn } from '../../chunk-4ASNIDV7.js';
23
25
  import { getCountries, parsePhoneNumberFromString, getExampleNumber, getCountryCallingCode, AsYouType } from 'libphonenumber-js/min';
@@ -257,7 +259,7 @@ var PhoneInput = ({
257
259
  placeholder,
258
260
  name,
259
261
  invalid,
260
- disabled,
262
+ disabled: disabledProp,
261
263
  readOnly,
262
264
  required,
263
265
  label,
@@ -273,10 +275,11 @@ var PhoneInput = ({
273
275
  translations,
274
276
  icons: iconsProp
275
277
  }) => {
278
+ const disabled = useInheritedDisabled(disabledProp);
276
279
  const locale = useLocale(localeProp);
277
280
  const t = { ...PHONE_INPUT_DEFAULT_TRANSLATIONS, ...translations };
278
281
  const icons = mergeIcons(DEFAULT_ICONS, iconsProp);
279
- const isInvalid = invalid || error != null;
282
+ const isInvalid = useInheritedInvalid(invalid || error != null);
280
283
  const allowed = countries ?? PHONE_COUNTRIES;
281
284
  const [initial] = useState(() => {
282
285
  const localeCountry = countryOfLocale(locale);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/components/phone-input/flag.tsx","../../../src/components/phone-input/phone.ts","../../../src/components/phone-input/phone-input.tsx"],"names":["jsx","countryName","ArkCombobox"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,IAAI,KAAA,GAAwB,IAAA;AAC5B,IAAI,SAAA,GAAY,KAAA;AAChB,IA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AAA,8BACA,IAAA,CAAC,UAAK,GAAA,EAAI,KAAA,EAAM,WAAW,EAAA,CAAG,cAAA,EAAgB,kBAAA,CAAmB,KAAK,CAAA,EAAG,QAAA,EAAA;AAAA,gBAAA,GAAA;AAAA,gBACrE,KAAK,OAAA,EAAS;AAAA,eAAA,EAClB,CAAA;AAAA,8BACAF,GAAAA,CAACE,QAAA,CAAY,aAAA,EAAZ,EAA0B,WAAW,gBAAA,EACpC,QAAA,kBAAAF,GAAAA,CAAC,SAAA,EAAA,EAAU,CAAA,EACb;AAAA,aAAA,EACF;AAAA;AAAA,WAGN,CAAA,EACF;AAAA;AAAA;AAAA,GACF;AAEJ","file":"index.js","sourcesContent":["\"use client\"\n\nimport type { ComponentType, SVGProps } from \"react\"\nimport { useSyncExternalStore } from \"react\"\nimport { cn } from \"../../lib/cn\"\n\n/**\n * Country flags, from `country-flag-icons` (3×2 SVGs).\n *\n * All ~260 flags weigh about 47 KB gzipped, which is too much to put in the\n * bundle of every page that renders a phone field. They load as one lazy\n * chunk the first time a `Flag` mounts and stay cached for the rest of the\n * session. Until the chunk arrives (and always during SSR and hydration),\n * each flag draws a neutral box of the same size, so nothing shifts when the\n * real flags paint.\n */\n\ntype FlagComponent = ComponentType<SVGProps<SVGSVGElement>>\ntype FlagSet = Readonly<Record<string, FlagComponent | undefined>>\n\nlet flags: FlagSet | null = null\nlet requested = false\nconst listeners = new Set<() => void>()\n\nconst load = () => {\n if (requested) return\n requested = true\n import(\"country-flag-icons/react/3x2\").then(\n (module) => {\n flags = module as unknown as FlagSet\n listeners.forEach((listener) => {\n listener()\n })\n },\n () => {\n // Let the next mount try again; until then the placeholders stay.\n requested = false\n },\n )\n}\n\nconst subscribe = (listener: () => void) => {\n listeners.add(listener)\n load()\n return () => {\n listeners.delete(listener)\n }\n}\n\nconst useFlags = () =>\n useSyncExternalStore(\n subscribe,\n () => flags,\n () => null,\n )\n\n/** The flag box: 3×2, sized in `em` so it follows the shell's text scale, with an inset\n * hairline so a white flag (Japan, Finland) still has an edge on a white surface. The\n * hairline is a pseudo-element over the flag, since an inset shadow on the box itself\n * would be painted under the SVG. */\nconst flagBox = cn(\n \"relative inline-flex h-[0.75em] w-[1.125em] shrink-0 overflow-hidden rounded-[2px]\",\n \"after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit]\",\n \"after:shadow-[inset_0_0_0_1px_rgb(0_0_0/0.12)] dark:after:shadow-[inset_0_0_0_1px_rgb(255_255_255/0.15)]\",\n)\n\nexport type FlagProps = {\n /** ISO 3166-1 alpha-2 code (`\"FR\"`). */\n country: string\n className?: string\n}\n\n/** A country's flag, decorative (`aria-hidden`): the country's name is always spelled out\n * next to it, or carried by the trigger's accessible name. */\nexport const Flag = ({ country, className }: FlagProps) => {\n const Svg = useFlags()?.[country]\n return (\n <span\n aria-hidden\n data-flag={country}\n className={cn(flagBox, !Svg && \"bg-brand-900/10 dark:bg-white/12\", className)}\n >\n {Svg && <Svg className=\"size-full\" />}\n </span>\n )\n}\n","import {\n AsYouType,\n type CountryCode,\n getCountries,\n getCountryCallingCode,\n getExampleNumber,\n parsePhoneNumberFromString,\n} from \"libphonenumber-js/min\"\nimport metadata from \"libphonenumber-js/min/metadata\"\nimport examples from \"libphonenumber-js/mobile/examples\"\n\n/**\n * PhoneInput's engine, with nothing visual in it: libphonenumber-js formats\n * as you type and produces the E.164 value, and the caret helpers below keep\n * the cursor where the user left it while the formatting moves characters\n * around it.\n *\n * The dial code behaves like a token in front of the number. Typing a complete\n * code (`+33`) moves it out of the text and into the country trigger. Backspace\n * at the very start of the text pulls it back out as editable characters\n * (`releaseCountry`). Whenever a country is selected, the text is national.\n */\n\nexport type { CountryCode }\n\n/** Every country libphonenumber-js has metadata for. */\nexport const PHONE_COUNTRIES: readonly CountryCode[] = getCountries()\n\n/** `\"33\"` for `\"FR\"`. */\nexport const callingCodeOf = (country: CountryCode): string => getCountryCallingCode(country)\n\n/**\n * A real-looking mobile number for `country`, as its people write it (`06 12 34 56 78`,\n * `07400 123456`, `(201) 555-0123`), for the placeholder. libphonenumber's example numbers\n * weigh ~1.4 KB gzipped for every country.\n */\nexport const exampleOf = (country: CountryCode): string | undefined =>\n getExampleNumber(country, examples)?.formatNational()\n\n/**\n * The main country of a calling code shared by several (`44` is GB, GG, IM and JE; `1` is the\n * US, Canada and the Caribbean). libphonenumber's metadata lists the main one first. It's the\n * same metadata module the `min` build already bundles, so this costs nothing extra.\n */\nconst mainCountryOf = (callingCode: string): CountryCode | null =>\n (metadata.country_calling_codes[callingCode]?.[0] as CountryCode | undefined) ?? null\n\n/** What the field holds after a keystroke. */\nexport type PhoneState = {\n /** The formatted text shown in the `<input>`. National whenever a country is selected. */\n text: string\n /** The selected country — resolved from a typed `+…` code, else the one the user picked. */\n country: CountryCode | null\n /** E.164 (`\"+33612345678\"`), or `null` while there's no number to speak of. */\n value: string | null\n /** Whether the number is a complete, valid number for its country. */\n isValid: boolean\n}\n\n/** A keystroke's result, plus how many caret-relevant characters (the `+` and the code's\n * digits) moved out of the text and into the trigger, so the caret can follow. */\nexport type FormattedPhone = PhoneState & { consumed: number }\n\nconst startsInternational = (text: string) => /^\\s*\\+/.test(text)\n\n/**\n * Which country national `digits` belong to, among those sharing `country`'s calling code:\n * `204 555 0123` under the US is Canadian. Stays on `country` while the digits can't tell yet.\n */\nconst refineCountry = (digits: string, country: CountryCode): CountryCode => {\n const found = digits ? parsePhoneNumberFromString(digits, country)?.country : undefined\n return found && callingCodeOf(found) === callingCodeOf(country) ? found : country\n}\n\n/**\n * Group national `digits` for display. libphonenumber's national grouping only kicks in when\n * the digits start with the country's trunk prefix (`06 12 …` in France, `020 …` in the UK). A\n * number whose code just collapsed into the trigger has no trunk prefix (`6 12 …`), and would\n * come out as one unbroken run. Then the international grouping is used, minus its `+code`.\n * NANP numbers, which have no trunk prefix in front, keep their national form,\n * `(201) 555-0123`.\n */\nconst groupNational = (digits: string, country: CountryCode, national: string): string => {\n if (/\\D/.test(national)) return national\n const code = callingCodeOf(country)\n const international = new AsYouType().input(`+${code}${digits}`)\n return international.startsWith(`+${code}`)\n ? international.slice(code.length + 1).trim()\n : national\n}\n\n/** National `digits` under `country` (or bare digits with none, which make no number).\n * `refine` lets the digits move the country within its calling code (see `formatPhone`). */\nconst formatNational = (\n digits: string,\n country: CountryCode | null,\n refine: boolean,\n): PhoneState => {\n if (digits === \"\") return { text: \"\", country, value: null, isValid: false }\n const resolved = country && (refine ? refineCountry(digits, country) : country)\n const typer = new AsYouType(resolved ?? undefined)\n const national = typer.input(digits)\n const text = resolved ? groupNational(digits, resolved, national) : national\n return {\n text,\n country: resolved,\n value: resolved ? (typer.getNumber()?.number ?? null) : null,\n isValid: typer.isValid(),\n }\n}\n\n/**\n * Format `raw` as typed under `country`. Only digits and a leading `+` survive,\n * so pasted spaces, dashes, dots and parentheses all fold into the country's\n * own grouping.\n *\n * A national number keeps the selected country. With `refine`, the digits move it\n * within its calling code (`204 …` under the US becomes Canada): that's for a\n * country resolved from a typed code, which the user never chose. A country they\n * picked stays put; the E.164 value is the same either way. An international one\n * collapses its code\n * into the country as soon as the code is complete. Calling codes are\n * prefix-free, so `+33` can't be the start of a longer one. A shared code\n * resolves to the current country if it shares it, else to the code's main\n * country, and the national digits refine it.\n *\n * `caret` is the number of caret-relevant characters before the caret. The code\n * only collapses when the caret is at or past its end. With the caret inside the\n * code, the user is editing it: `+3|6 12` after deleting a `3` is a complete\n * Hungarian code, and collapsing it would jump to a country they never typed.\n * It stays international text until they finish the code. Omit `caret` (a\n * paste, a value) to collapse unconditionally.\n */\nexport const formatPhone = (\n raw: string,\n country: CountryCode | null,\n caret?: number,\n refine = false,\n): FormattedPhone => {\n const digits = raw.replace(/\\D/g, \"\")\n if (!startsInternational(raw)) return { ...formatNational(digits, country, refine), consumed: 0 }\n\n const typer = new AsYouType()\n const text = typer.input(`+${digits}`)\n const callingCode = typer.getCallingCode()\n const shared =\n callingCode && country && callingCodeOf(country) === callingCode\n ? country\n : callingCode\n ? mainCountryOf(callingCode)\n : null\n const codeEnd = 1 + (callingCode?.length ?? 0)\n if (callingCode && shared && (caret === undefined || caret >= codeEnd)) {\n return {\n ...formatNational(digits.slice(callingCode.length), shared, true),\n consumed: codeEnd,\n }\n }\n // Still typing (or editing) the code: international text, with whatever country the digits\n // so far point to, for the flag.\n return {\n text,\n country: typer.getCountry() ?? shared,\n value: typer.getNumber()?.number ?? null,\n isValid: typer.isValid(),\n consumed: 0,\n }\n}\n\n/**\n * Backspace at the very start of the text, with a country selected: the dial code comes back\n * out of the trigger as editable text, and the country is unselected.\n *\n * - With no number yet, it's the exact inverse of the keystroke that created the token: `+33`\n * collapsed to France, so Backspace leaves `+3`.\n * - With a number after it, the code comes back whole (`+33| 6 12`, caret after the code)\n * without deleting anything. Deleting its last digit would leave `+36 12`, a Hungarian number\n * the user never typed.\n *\n * Returns the new state and the caret position, in caret-relevant characters.\n */\nexport const releaseCountry = (\n text: string,\n country: CountryCode,\n): { next: PhoneState; caret: number } => {\n const code = callingCodeOf(country)\n const digits = text.replace(/\\D/g, \"\")\n if (digits === \"\") {\n const raw = `+${code.slice(0, -1)}`\n const { consumed: _, ...next } = formatPhone(raw, null, raw.length)\n return { next, caret: raw.length }\n }\n const typer = new AsYouType()\n return {\n next: {\n text: typer.input(`+${code}${digits}`),\n country: null,\n value: typer.getNumber()?.number ?? null,\n isValid: typer.isValid(),\n },\n caret: 1 + code.length,\n }\n}\n\n/**\n * The display state for an E.164 `value` handed in from outside (initial or\n * controlled): national formatting once the number is possible for a known\n * country, the collapsed code and national digits otherwise. A `null` value\n * keeps `fallback`.\n */\nexport const parsePhone = (value: string | null, fallback: CountryCode | null): PhoneState => {\n if (!value) return { text: \"\", country: fallback, value: null, isValid: false }\n const parsed = parsePhoneNumberFromString(value)\n if (parsed?.country && parsed.isPossible()) {\n return {\n text: parsed.formatNational(),\n country: parsed.country,\n value: parsed.number,\n isValid: parsed.isValid(),\n }\n }\n const { consumed: _, ...state } = formatPhone(value, fallback)\n return state\n}\n\n/**\n * Re-home the current text under a newly picked country: international text\n * (a code still being typed) drops its calling code and keeps its national\n * digits, a national one keeps its digits as they are.\n */\nexport const switchCountry = (text: string, country: CountryCode | null): PhoneState => {\n if (!startsInternational(text)) return formatNational(text.replace(/\\D/g, \"\"), country, false)\n const typer = new AsYouType()\n typer.input(text)\n const callingCode = typer.getCallingCode() ?? \"\"\n return formatNational(text.replace(/\\D/g, \"\").slice(callingCode.length), country, false)\n}\n\n/** How many caret-relevant characters (digits, and a leading `+`) sit before `end`. */\nexport const significantBefore = (text: string, end: number): number => {\n const head = text.slice(0, end)\n return (head.match(/\\d/g)?.length ?? 0) + (startsInternational(head) ? 1 : 0)\n}\n\nconst isSignificant = (text: string, index: number) =>\n /\\d/.test(text.charAt(index)) ||\n (text.charAt(index) === \"+\" && startsInternational(text.slice(0, index + 1)))\n\n/**\n * The caret position in `text` right after its `count`-th significant\n * character — where a caret that had `count` digits before it belongs once\n * the text is reformatted.\n */\nexport const caretAfter = (text: string, count: number): number => {\n if (count <= 0) return 0\n const index = [...text].findIndex((_, i) => significantBefore(text, i + 1) === count)\n return index === -1 ? text.length : index + 1\n}\n\n/**\n * Backspace / Delete on a formatting character (a space, a parenthesis, a\n * dash) would be undone by the next format and look like a dead key. Instead\n * it removes the nearest digit in that direction, the way every phone field\n * that formats as you type behaves. Returns `null` when the native edit is\n * fine as it is: a selection, or a digit next to the caret.\n */\nexport const deleteAcrossSeparator = (\n text: string,\n caret: number,\n direction: \"backward\" | \"forward\",\n): { raw: string; count: number } | null => {\n const neighbour = direction === \"backward\" ? caret - 1 : caret\n if (neighbour < 0 || neighbour >= text.length || isSignificant(text, neighbour)) return null\n const indices = Array.from(text, (_, i) => i)\n const target =\n direction === \"backward\"\n ? indices.filter((i) => i < caret && isSignificant(text, i)).at(-1)\n : indices.find((i) => i >= caret && isSignificant(text, i))\n if (target === undefined) return null\n return {\n raw: text.slice(0, target) + text.slice(target + 1),\n count: significantBefore(text, direction === \"backward\" ? target : caret),\n }\n}\n\n/**\n * The country a locale implies (`\"fr\"` → `FR`, `\"en-GB\"` → `GB`), when\n * libphonenumber knows it. `Intl.Locale#maximize` fills in the likely region\n * of a bare language tag.\n */\nexport const countryOfLocale = (locale: string): CountryCode | null => {\n try {\n const region = new Intl.Locale(locale).maximize().region\n return PHONE_COUNTRIES.find((country) => country === region) ?? null\n } catch {\n return null\n }\n}\n","\"use client\"\n\nimport { ark } from \"@ark-ui/react\"\nimport { Combobox as ArkCombobox } from \"@ark-ui/react/combobox\"\nimport { useFieldContext } from \"@ark-ui/react/field\"\nimport { Globe } from \"lucide-react\"\nimport {\n type ComponentProps,\n type FocusEvent,\n type KeyboardEvent,\n type ReactNode,\n type Ref,\n useMemo,\n useRef,\n useState,\n} from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { type IconMap, iconStroke, mergeIcons } from \"../../lib/icons\"\nimport { useLocale } from \"../../lib/intl\"\nimport { useMergedRefs } from \"../../lib/merge-refs\"\nimport { props } from \"../../lib/props\"\nimport type { SelectData } from \"../../lib/select-data\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\nimport { useIsomorphicLayoutEffect } from \"../../lib/use-isomorphic-layout-effect\"\nimport { ComboboxList } from \"../combobox-list/combobox-list\"\nimport { type FieldProps, FieldShell, fieldA11yProps } from \"../field/field\"\nimport { InputBase, type InputSize, type InputVariant, inputControlClasses } from \"../input/input\"\nimport { CheckIcon, ChevronIcon } from \"../popover/icons\"\nimport { Popover, popoverChevron, popoverIndicator } from \"../popover/popover\"\nimport { Flag } from \"./flag\"\nimport {\n type CountryCode,\n callingCodeOf,\n caretAfter,\n countryOfLocale,\n deleteAcrossSeparator,\n exampleOf,\n formatPhone,\n PHONE_COUNTRIES,\n type PhoneState,\n parsePhone,\n releaseCountry,\n significantBefore,\n switchCountry,\n} from \"./phone\"\n\n/**\n * PhoneInput — a phone number field with a country picker. It formats as the\n * user types (`06 12 34 56 78` for France, `(201) 555-0123` for the US) and\n * hands back one canonical value, the E.164 string (`\"+33612345678\"`), which\n * is what a backend or an SMS provider wants.\n *\n * - The country picker at the inline-start is a searchable list (by name or\n * dial code: \"33\" finds France), with each country's flag. Typing or\n * pasting a dial code (`+44 20 …`) moves it into the trigger, and\n * Backspace at the start of the number pulls it back out for editing.\n * - `onChange(value, { country, isValid })` reports `null` while there is no\n * number. The field never turns red on its own while the user is still\n * typing: read `isValid` (or use the exported `isValidPhoneNumber` in your\n * schema) and pass `error`.\n * - The country defaults to the locale's region (`fr-FR` gives France).\n * Pass `defaultCountry` to pin it, which also keeps SSR and the first\n * client render identical when the locale is `\"auto\"`.\n *\n * Formatting and validation come from libphonenumber-js (its `min` metadata),\n * flags from country-flag-icons, loaded lazily on first use.\n */\n\nexport type { CountryCode }\n\ntype PhoneInputClassNames = {\n /** The field wrapper (label / description / error). */\n field?: string\n /** The label element itself. */\n label?: string\n /** The shell `<div>` (also targeted by `className`). */\n root?: string\n /** The country trigger button. */\n country?: string\n /** The inner `<input>`. */\n input?: string\n /** The country list panel. */\n list?: string\n}\n\nexport type PhoneInputTranslations = {\n /** The country trigger's accessible name, given the selected country's name (`null` when\n * none is selected). */\n triggerLabel?: (country: string | null) => string\n /** The country search's placeholder. */\n searchPlaceholder?: string\n /** Shown when no country matches the search. */\n empty?: string\n /** Group heading over `preferredCountries`. */\n preferredLabel?: string\n /** Group heading over the rest of the list, when `preferredCountries` is set. */\n allLabel?: string\n}\n\nexport const PHONE_INPUT_DEFAULT_TRANSLATIONS = {\n triggerLabel: (country: string | null) =>\n country ? `Country: ${country}` : \"Country: none selected\",\n searchPlaceholder: \"Search country\",\n empty: \"No country found\",\n preferredLabel: \"Suggested\",\n allLabel: \"All countries\",\n} as const satisfies Required<PhoneInputTranslations>\n\nexport type PhoneInputIconSlot = \"chevron\" | \"international\"\nexport type PhoneInputIcons = IconMap<PhoneInputIconSlot>\n\n/** The default icons: the trigger's chevron, and the globe shown while no country is set. */\nexport const DEFAULT_ICONS: Record<PhoneInputIconSlot, ReactNode> = {\n chevron: <ChevronIcon />,\n international: <Globe className={iconStroke} />,\n}\n\n/** What `onChange` reports alongside the value. */\nexport type PhoneInputChangeDetails = {\n /** The country the number belongs to, or `null` when it can't be told yet. */\n country: CountryCode | null\n /** A complete, valid number for that country, and the country is in `countries`. */\n isValid: boolean\n}\n\nexport type PhoneInputProps = Pick<FieldProps, \"label\" | \"description\" | \"error\" | \"required\"> &\n WithTestId & {\n /** Controlled value, E.164 (`\"+33612345678\"`); `null` for empty. */\n value?: string | null\n /** Uncontrolled initial value, E.164. */\n defaultValue?: string | null\n /** Fires with the E.164 value (`null` while there's no number) on every change. */\n onChange?: (value: string | null, details: PhoneInputChangeDetails) => void\n /** Controlled country. */\n country?: CountryCode | null\n /** Uncontrolled initial country. Defaults to the locale's region, when it's in `countries`. */\n defaultCountry?: CountryCode | null\n /** Fires when the country changes, picked from the list or detected from a `+…` number. */\n onCountryChange?: (country: CountryCode | null) => void\n /** Only offer these countries. A number from elsewhere still formats, but isn't valid. */\n countries?: readonly CountryCode[]\n /** Pinned at the top of the list, under their own heading. */\n preferredCountries?: readonly CountryCode[]\n /** Draw each country's flag yourself (an emoji, your own sprite). Defaults to the kit's\n * SVG flags. */\n renderFlag?: (country: CountryCode) => ReactNode\n /** Locale for the country names and the default country; defaults to the `IntlProvider`'s. */\n locale?: string\n /**\n * Placeholder shown while the field is empty. Defaults to an example number of the selected\n * country (`06 12 34 56 78` for France) and none while no country is selected. The field's\n * meaning changes with the country, so a fixed string can contradict it (`+33 …` next to a\n * selected France). Pass a function of the country to word it yourself, or `\"\"` for none.\n */\n placeholder?: string | ((country: CountryCode | null) => string | undefined)\n /** Field name for native form submission; submits the E.164 value. */\n name?: string\n /** Red invalid state; OR'd with `error`. */\n invalid?: boolean\n /** Dims the shell and disables the input and the country picker. */\n disabled?: boolean\n /** Keeps full contrast but blocks edits and the country picker. */\n readOnly?: boolean\n variant?: InputVariant\n size?: InputSize\n /** Lands on the `<input>` for focus-on-error. */\n ref?: Ref<HTMLInputElement>\n /** Forwarded to the `<input>`; drives touched/blurred validation. */\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void\n className?: string\n classNames?: PhoneInputClassNames\n /** Overrides the country picker's wording. A partial override keeps the other defaults. */\n translations?: PhoneInputTranslations\n /** Replaces the default icons: `chevron`, `international`. */\n icons?: PhoneInputIcons\n }\n\ntype CountryPayload = { name: string; callingCode: string }\ntype CountryData = SelectData<CountryPayload, CountryCode>\n\n/**\n * The country trigger fills the whole start zone of the shell, full height, from its edge to the\n * divider, so the hover wash and the click target are the zone you see rather than a chip inset\n * in it. The shell drops its own start padding (`ps-0!`) and clips (`overflow-clip`), so its\n * rounded corners clip the wash. The trigger takes the padding the shell would have had, per\n * `size`. Its border is the divider, except under `variant=\"unstyled\"`, which draws no chrome. Its focus shows as the shell's own ring (`shellChrome`'s\n * `:has(:focus-visible)`), like every control inside the family.\n */\nconst countryTrigger = cn(\n \"inline-flex shrink-0 cursor-pointer items-center gap-1 self-stretch outline-none transition-colors\",\n \"[&:hover:not(:disabled)]:bg-brand-900/6 dark:[&:hover:not(:disabled)]:bg-white/8\",\n \"disabled:cursor-not-allowed\",\n)\n\n/** The trigger's inline padding: the shell's own slot-side padding at each size (`inputShell`). */\nconst countryTriggerPadding = {\n xs: \"px-2\",\n sm: \"px-2.5\",\n md: \"px-2.5\",\n lg: \"px-3.5\",\n xl: \"px-4\",\n} as const satisfies Record<InputSize, string>\n\n/** The divider between the country and the number, per `variant`. The same hairline as the\n * shell's own border, and none where the shell draws none. */\nconst countryTriggerDivider = {\n default: \"border-e border-brand-900/20 dark:border-white/15\",\n unstyled: \"\",\n} as const satisfies Record<InputVariant, string>\n\n/** The `<input>`, split out so it reads the `Field` context from inside `FieldShell`. */\nconst PhoneInputControl = ({\n ref,\n testId,\n className,\n ...rest\n}: Omit<ComponentProps<\"input\">, \"ref\"> & { ref?: Ref<HTMLInputElement>; testId?: string }) => {\n const field = useFieldContext()\n return (\n <ark.input\n ref={ref}\n {...field?.getInputProps()}\n {...fieldA11yProps(field)}\n {...props({ \"data-testid\": testId })}\n className={className}\n {...rest}\n />\n )\n}\n\nexport const PhoneInput = ({\n value,\n defaultValue,\n onChange,\n country: countryProp,\n defaultCountry,\n onCountryChange,\n countries,\n preferredCountries,\n renderFlag,\n locale: localeProp,\n placeholder,\n name,\n invalid,\n disabled,\n readOnly,\n required,\n label,\n description,\n error,\n variant = \"default\",\n size = \"md\",\n ref,\n onBlur,\n className,\n classNames,\n testId,\n translations,\n icons: iconsProp,\n}: PhoneInputProps) => {\n const locale = useLocale(localeProp)\n const t = { ...PHONE_INPUT_DEFAULT_TRANSLATIONS, ...translations }\n const icons = mergeIcons(DEFAULT_ICONS, iconsProp)\n const isInvalid = invalid || error != null\n const allowed = countries ?? PHONE_COUNTRIES\n\n const [initial] = useState<PhoneState>(() => {\n const localeCountry = countryOfLocale(locale)\n const fallback =\n countryProp !== undefined\n ? countryProp\n : defaultCountry !== undefined\n ? defaultCountry\n : localeCountry && allowed.includes(localeCountry)\n ? localeCountry\n : null\n return parsePhone(value ?? defaultValue ?? null, fallback)\n })\n const [text, setText] = useState(initial.text)\n const [innerCountry, setInnerCountry] = useState(initial.country)\n // The last value this field reported (or was handed). A controlled `value` that differs from\n // it came from outside — a reset, a server load — and replaces the text; one that matches is\n // just the parent echoing a keystroke back, and must not reformat what the user is typing.\n const [current, setCurrent] = useState(initial.value)\n const country = countryProp !== undefined ? countryProp : innerCountry\n // Whether the country came from the number itself (a typed or pasted `+…` code, or a value)\n // rather than from the user's pick, `defaultCountry` or `country`. Only then may the digits\n // move it within a shared calling code (`+1 204 …` is Canada, not the US). A chosen country\n // stays put. See `formatPhone`'s `refine`.\n const [resolved, setResolved] = useState(initial.value !== null && initial.country !== null)\n\n if (value !== undefined && value !== current) {\n const next = parsePhone(value, country)\n setCurrent(value)\n setText(next.text)\n setInnerCountry(next.country)\n setResolved(next.value !== null && next.country !== null)\n }\n\n const inputRef = useRef<HTMLInputElement>(null)\n const mergedRef = useMergedRefs(inputRef, ref)\n const pendingCaret = useRef<number | null>(null)\n const [open, setOpen] = useState(false)\n const picked = useRef(false)\n\n // Put the caret back where the user left it, counted in digits, once the formatted text is in\n // the DOM. Only while the input has focus: a programmatic change mustn't steal it.\n useIsomorphicLayoutEffect(() => {\n const caret = pendingCaret.current\n const input = inputRef.current\n pendingCaret.current = null\n if (caret === null || !input || input.ownerDocument.activeElement !== input) return\n input.setSelectionRange(caret, caret)\n })\n\n const commit = (next: PhoneState, caretCount: number | null, fromNumber: boolean) => {\n setText(next.text)\n setResolved(fromNumber && next.country !== null)\n pendingCaret.current = caretCount === null ? null : caretAfter(next.text, caretCount)\n if (next.country !== country) {\n setInnerCountry(next.country)\n onCountryChange?.(next.country)\n }\n if (next.value !== current) {\n setCurrent(next.value)\n onChange?.(next.value, {\n country: next.country,\n isValid: next.isValid && next.country !== null && allowed.includes(next.country),\n })\n }\n }\n\n const onKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key !== \"Backspace\" && event.key !== \"Delete\") return\n if (event.altKey || event.ctrlKey || event.metaKey) return\n const input = event.currentTarget\n const caret = input.selectionStart\n if (caret === null || caret !== input.selectionEnd) return\n // Backspace at the very start of a national number pulls the dial code back out of the\n // trigger as editable text (see `releaseCountry`).\n if (event.key === \"Backspace\" && caret === 0 && country && !input.value.startsWith(\"+\")) {\n event.preventDefault()\n const released = releaseCountry(input.value, country)\n commit(released.next, released.caret, false)\n return\n }\n const edit = deleteAcrossSeparator(\n input.value,\n caret,\n event.key === \"Backspace\" ? \"backward\" : \"forward\",\n )\n if (!edit) return\n event.preventDefault()\n const next = formatPhone(edit.raw, country, edit.count, resolved)\n commit(next, edit.count - next.consumed, resolved || next.consumed > 0)\n }\n\n const pick = (next: CountryCode) => {\n picked.current = true\n setOpen(false)\n commit(switchCountry(text, next), null, false)\n }\n\n const data = useMemo<CountryData>(() => {\n const names = new Intl.DisplayNames([locale], { type: \"region\", fallback: \"code\" })\n const collator = new Intl.Collator(locale)\n const toItem = (code: CountryCode) => {\n const countryName = names.of(code) ?? code\n const callingCode = callingCodeOf(code)\n // The label is what the search matches: the name and the dial code both find it.\n return {\n value: code,\n label: `${countryName} +${callingCode}`,\n payload: { name: countryName, callingCode },\n }\n }\n const all = allowed.map(toItem).sort((a, b) => collator.compare(a.payload.name, b.payload.name))\n const preferred = (preferredCountries ?? []).filter((code) => allowed.includes(code))\n if (preferred.length === 0) return all\n return [\n { group: t.preferredLabel, items: preferred.map(toItem) },\n { group: t.allLabel, items: all.filter((item) => !preferred.includes(item.value)) },\n ]\n }, [locale, allowed, preferredCountries, t.preferredLabel, t.allLabel])\n\n const countryName = useMemo(\n () =>\n country\n ? (new Intl.DisplayNames([locale], { type: \"region\", fallback: \"code\" }).of(country) ??\n country)\n : null,\n [country, locale],\n )\n const placeholderText =\n typeof placeholder === \"function\"\n ? placeholder(country)\n : (placeholder ?? (country ? exampleOf(country) : undefined))\n const flagOf = (code: CountryCode) => (renderFlag ? renderFlag(code) : <Flag country={code} />)\n const locked = disabled || readOnly\n\n return (\n <Popover.Root\n open={open}\n onOpenChange={(details) => {\n if (details.open) picked.current = false\n setOpen(details.open)\n }}\n width=\"auto\"\n position=\"bottom-start\"\n // ~250 rows with their flags: only mount them while the list is open.\n lazyMount\n unmountOnExit\n // After a pick, the user's next move is to type the number.\n finalFocusEl={() => (picked.current ? inputRef.current : null)}\n >\n <FieldShell\n label={label}\n description={description}\n error={error}\n required={required}\n disabled={disabled}\n size={size}\n className={classNames?.field}\n classNames={{ label: classNames?.label }}\n >\n {/* The list hangs off the whole field, aligned to its edge, not off the trigger. */}\n <Popover.Anchor asChild>\n <InputBase\n variant={variant}\n size={size}\n invalid={isInvalid}\n disabled={disabled}\n readOnly={readOnly}\n classNames={{ root: classNames?.root }}\n // The country trigger is interactive, so it can't sit in the `aria-hidden` start slot.\n // It's a direct child that owns the start padding (see `countryTrigger`).\n className={cn(\"ps-0! overflow-clip\", className)}\n >\n <Popover.Trigger asChild>\n <button\n type=\"button\"\n disabled={locked}\n aria-label={t.triggerLabel(\n countryName && country ? `${countryName} +${callingCodeOf(country)}` : null,\n )}\n className={cn(\n countryTrigger,\n countryTriggerPadding[size],\n countryTriggerDivider[variant],\n classNames?.country,\n )}\n >\n {country ? flagOf(country) : icons.international}\n {country && (\n <span dir=\"ltr\" className=\"tabular-nums\">\n +{callingCodeOf(country)}\n </span>\n )}\n <span className={cn(popoverChevron, \"inline-flex\", open && \"rotate-180\")}>\n {icons.chevron}\n </span>\n </button>\n </Popover.Trigger>\n <PhoneInputControl\n ref={mergedRef}\n type=\"tel\"\n inputMode=\"tel\"\n autoComplete=\"tel\"\n // A phone number reads left to right in every script.\n dir=\"ltr\"\n value={text}\n placeholder={placeholderText}\n onChange={(event) => {\n const raw = event.currentTarget.value\n const caret = event.currentTarget.selectionStart ?? raw.length\n const count = significantBefore(raw, caret)\n const next = formatPhone(raw, country, count, resolved)\n // A code that just collapsed into the trigger took its characters with it, and\n // the country it resolved to came from the number.\n commit(next, Math.max(0, count - next.consumed), resolved || next.consumed > 0)\n }}\n onKeyDown={onKeyDown}\n onBlur={onBlur}\n testId={testId}\n {...props({\n disabled,\n readOnly,\n \"aria-invalid\": isInvalid,\n })}\n className={cn(inputControlClasses, \"rtl:text-right\", classNames?.input)}\n />\n {name != null && <input type=\"hidden\" name={name} value={current ?? \"\"} />}\n </InputBase>\n </Popover.Anchor>\n </FieldShell>\n <Popover.Content className={cn(\"w-72\", classNames?.list)}>\n <Popover.Body className=\"overflow-visible p-0\">\n <ComboboxList<CountryData>\n size=\"sm\"\n data={data}\n value={country}\n onChange={(next) => {\n if (next) pick(next)\n }}\n placeholder={t.searchPlaceholder}\n empty={t.empty}\n renderItem={(item) => (\n <>\n {flagOf(item.value)}\n <ArkCombobox.ItemText className=\"min-w-0 flex-1 truncate\">\n {item.payload?.name}\n </ArkCombobox.ItemText>\n <span dir=\"ltr\" className={cn(\"tabular-nums\", TEXT_COLOR_CLASSES.muted)}>\n +{item.payload?.callingCode}\n </span>\n <ArkCombobox.ItemIndicator className={popoverIndicator}>\n <CheckIcon />\n </ArkCombobox.ItemIndicator>\n </>\n )}\n />\n </Popover.Body>\n </Popover.Content>\n </Popover.Root>\n )\n}\n"]}
1
+ {"version":3,"sources":["../../../src/components/phone-input/flag.tsx","../../../src/components/phone-input/phone.ts","../../../src/components/phone-input/phone-input.tsx"],"names":["jsx","countryName","ArkCombobox"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,IAAI,KAAA,GAAwB,IAAA;AAC5B,IAAI,SAAA,GAAY,KAAA;AAChB,IAAM,SAAA,uBAAgB,GAAA,EAAgB;AAEtC,IAAM,OAAO,MAAM;AACjB,EAAA,IAAI,SAAA,EAAW;AACf,EAAA,SAAA,GAAY,IAAA;AACZ,EAAA,OAAO,8BAA8B,CAAA,CAAE,IAAA;AAAA,IACrC,CAAC,MAAA,KAAW;AACV,MAAA,KAAA,GAAQ,MAAA;AACR,MAAA,SAAA,CAAU,OAAA,CAAQ,CAAC,QAAA,KAAa;AAC9B,QAAA,QAAA,EAAS;AAAA,MACX,CAAC,CAAA;AAAA,IACH,CAAA;AAAA,IACA,MAAM;AAEJ,MAAA,SAAA,GAAY,KAAA;AAAA,IACd;AAAA,GACF;AACF,CAAA;AAEA,IAAM,SAAA,GAAY,CAAC,QAAA,KAAyB;AAC1C,EAAA,SAAA,CAAU,IAAI,QAAQ,CAAA;AACtB,EAAA,IAAA,EAAK;AACL,EAAA,OAAO,MAAM;AACX,IAAA,SAAA,CAAU,OAAO,QAAQ,CAAA;AAAA,EAC3B,CAAA;AACF,CAAA;AAEA,IAAM,WAAW,MACf,oBAAA;AAAA,EACE,SAAA;AAAA,EACA,MAAM,KAAA;AAAA,EACN,MAAM;AACR,CAAA;AAMF,IAAM,OAAA,GAAU,EAAA;AAAA,EACd,oFAAA;AAAA,EACA,gFAAA;AAAA,EACA;AACF,CAAA;AAUO,IAAM,IAAA,GAAO,CAAC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IAAA;AAAA,YACL,IAAA;AAAA,YACA,KAAA,EAAO,OAAA;AAAA,YACP,QAAA,EAAU,CAAC,IAAA,KAAS;AAClB,cAAA,IAAI,IAAA,OAAW,IAAI,CAAA;AAAA,YACrB,CAAA;AAAA,YACA,aAAa,CAAA,CAAE,iBAAA;AAAA,YACf,OAAO,CAAA,CAAE,KAAA;AAAA,YACT,UAAA,EAAY,CAAC,IAAA,qBACX,IAAA,CAAA,QAAA,EAAA,EACG,QAAA,EAAA;AAAA,cAAA,MAAA,CAAO,KAAK,KAAK,CAAA;AAAA,8BAClBA,IAACE,QAAA,CAAY,QAAA,EAAZ,EAAqB,SAAA,EAAU,yBAAA,EAC7B,QAAA,EAAA,IAAA,CAAK,OAAA,EAAS,IAAA,EACjB,CAAA;AAAA,8BACA,IAAA,CAAC,UAAK,GAAA,EAAI,KAAA,EAAM,WAAW,EAAA,CAAG,cAAA,EAAgB,kBAAA,CAAmB,KAAK,CAAA,EAAG,QAAA,EAAA;AAAA,gBAAA,GAAA;AAAA,gBACrE,KAAK,OAAA,EAAS;AAAA,eAAA,EAClB,CAAA;AAAA,8BACAF,GAAAA,CAACE,QAAA,CAAY,aAAA,EAAZ,EAA0B,WAAW,gBAAA,EACpC,QAAA,kBAAAF,GAAAA,CAAC,SAAA,EAAA,EAAU,CAAA,EACb;AAAA,aAAA,EACF;AAAA;AAAA,WAGN,CAAA,EACF;AAAA;AAAA;AAAA,GACF;AAEJ","file":"index.js","sourcesContent":["\"use client\"\n\nimport type { ComponentType, SVGProps } from \"react\"\nimport { useSyncExternalStore } from \"react\"\nimport { cn } from \"../../lib/cn\"\n\n/**\n * Country flags, from `country-flag-icons` (3×2 SVGs).\n *\n * All ~260 flags weigh about 47 KB gzipped, which is too much to put in the\n * bundle of every page that renders a phone field. They load as one lazy\n * chunk the first time a `Flag` mounts and stay cached for the rest of the\n * session. Until the chunk arrives (and always during SSR and hydration),\n * each flag draws a neutral box of the same size, so nothing shifts when the\n * real flags paint.\n */\n\ntype FlagComponent = ComponentType<SVGProps<SVGSVGElement>>\ntype FlagSet = Readonly<Record<string, FlagComponent | undefined>>\n\nlet flags: FlagSet | null = null\nlet requested = false\nconst listeners = new Set<() => void>()\n\nconst load = () => {\n if (requested) return\n requested = true\n import(\"country-flag-icons/react/3x2\").then(\n (module) => {\n flags = module as unknown as FlagSet\n listeners.forEach((listener) => {\n listener()\n })\n },\n () => {\n // Let the next mount try again; until then the placeholders stay.\n requested = false\n },\n )\n}\n\nconst subscribe = (listener: () => void) => {\n listeners.add(listener)\n load()\n return () => {\n listeners.delete(listener)\n }\n}\n\nconst useFlags = () =>\n useSyncExternalStore(\n subscribe,\n () => flags,\n () => null,\n )\n\n/** The flag box: 3×2, sized in `em` so it follows the shell's text scale, with an inset\n * hairline so a white flag (Japan, Finland) still has an edge on a white surface. The\n * hairline is a pseudo-element over the flag, since an inset shadow on the box itself\n * would be painted under the SVG. */\nconst flagBox = cn(\n \"relative inline-flex h-[0.75em] w-[1.125em] shrink-0 overflow-hidden rounded-[2px]\",\n \"after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit]\",\n \"after:shadow-[inset_0_0_0_1px_rgb(0_0_0/0.12)] dark:after:shadow-[inset_0_0_0_1px_rgb(255_255_255/0.15)]\",\n)\n\nexport type FlagProps = {\n /** ISO 3166-1 alpha-2 code (`\"FR\"`). */\n country: string\n className?: string\n}\n\n/** A country's flag, decorative (`aria-hidden`): the country's name is always spelled out\n * next to it, or carried by the trigger's accessible name. */\nexport const Flag = ({ country, className }: FlagProps) => {\n const Svg = useFlags()?.[country]\n return (\n <span\n aria-hidden\n data-flag={country}\n className={cn(flagBox, !Svg && \"bg-brand-900/10 dark:bg-white/12\", className)}\n >\n {Svg && <Svg className=\"size-full\" />}\n </span>\n )\n}\n","import {\n AsYouType,\n type CountryCode,\n getCountries,\n getCountryCallingCode,\n getExampleNumber,\n parsePhoneNumberFromString,\n} from \"libphonenumber-js/min\"\nimport metadata from \"libphonenumber-js/min/metadata\"\nimport examples from \"libphonenumber-js/mobile/examples\"\n\n/**\n * PhoneInput's engine, with nothing visual in it: libphonenumber-js formats\n * as you type and produces the E.164 value, and the caret helpers below keep\n * the cursor where the user left it while the formatting moves characters\n * around it.\n *\n * The dial code behaves like a token in front of the number. Typing a complete\n * code (`+33`) moves it out of the text and into the country trigger. Backspace\n * at the very start of the text pulls it back out as editable characters\n * (`releaseCountry`). Whenever a country is selected, the text is national.\n */\n\nexport type { CountryCode }\n\n/** Every country libphonenumber-js has metadata for. */\nexport const PHONE_COUNTRIES: readonly CountryCode[] = getCountries()\n\n/** `\"33\"` for `\"FR\"`. */\nexport const callingCodeOf = (country: CountryCode): string => getCountryCallingCode(country)\n\n/**\n * A real-looking mobile number for `country`, as its people write it (`06 12 34 56 78`,\n * `07400 123456`, `(201) 555-0123`), for the placeholder. libphonenumber's example numbers\n * weigh ~1.4 KB gzipped for every country.\n */\nexport const exampleOf = (country: CountryCode): string | undefined =>\n getExampleNumber(country, examples)?.formatNational()\n\n/**\n * The main country of a calling code shared by several (`44` is GB, GG, IM and JE; `1` is the\n * US, Canada and the Caribbean). libphonenumber's metadata lists the main one first. It's the\n * same metadata module the `min` build already bundles, so this costs nothing extra.\n */\nconst mainCountryOf = (callingCode: string): CountryCode | null =>\n (metadata.country_calling_codes[callingCode]?.[0] as CountryCode | undefined) ?? null\n\n/** What the field holds after a keystroke. */\nexport type PhoneState = {\n /** The formatted text shown in the `<input>`. National whenever a country is selected. */\n text: string\n /** The selected country — resolved from a typed `+…` code, else the one the user picked. */\n country: CountryCode | null\n /** E.164 (`\"+33612345678\"`), or `null` while there's no number to speak of. */\n value: string | null\n /** Whether the number is a complete, valid number for its country. */\n isValid: boolean\n}\n\n/** A keystroke's result, plus how many caret-relevant characters (the `+` and the code's\n * digits) moved out of the text and into the trigger, so the caret can follow. */\nexport type FormattedPhone = PhoneState & { consumed: number }\n\nconst startsInternational = (text: string) => /^\\s*\\+/.test(text)\n\n/**\n * Which country national `digits` belong to, among those sharing `country`'s calling code:\n * `204 555 0123` under the US is Canadian. Stays on `country` while the digits can't tell yet.\n */\nconst refineCountry = (digits: string, country: CountryCode): CountryCode => {\n const found = digits ? parsePhoneNumberFromString(digits, country)?.country : undefined\n return found && callingCodeOf(found) === callingCodeOf(country) ? found : country\n}\n\n/**\n * Group national `digits` for display. libphonenumber's national grouping only kicks in when\n * the digits start with the country's trunk prefix (`06 12 …` in France, `020 …` in the UK). A\n * number whose code just collapsed into the trigger has no trunk prefix (`6 12 …`), and would\n * come out as one unbroken run. Then the international grouping is used, minus its `+code`.\n * NANP numbers, which have no trunk prefix in front, keep their national form,\n * `(201) 555-0123`.\n */\nconst groupNational = (digits: string, country: CountryCode, national: string): string => {\n if (/\\D/.test(national)) return national\n const code = callingCodeOf(country)\n const international = new AsYouType().input(`+${code}${digits}`)\n return international.startsWith(`+${code}`)\n ? international.slice(code.length + 1).trim()\n : national\n}\n\n/** National `digits` under `country` (or bare digits with none, which make no number).\n * `refine` lets the digits move the country within its calling code (see `formatPhone`). */\nconst formatNational = (\n digits: string,\n country: CountryCode | null,\n refine: boolean,\n): PhoneState => {\n if (digits === \"\") return { text: \"\", country, value: null, isValid: false }\n const resolved = country && (refine ? refineCountry(digits, country) : country)\n const typer = new AsYouType(resolved ?? undefined)\n const national = typer.input(digits)\n const text = resolved ? groupNational(digits, resolved, national) : national\n return {\n text,\n country: resolved,\n value: resolved ? (typer.getNumber()?.number ?? null) : null,\n isValid: typer.isValid(),\n }\n}\n\n/**\n * Format `raw` as typed under `country`. Only digits and a leading `+` survive,\n * so pasted spaces, dashes, dots and parentheses all fold into the country's\n * own grouping.\n *\n * A national number keeps the selected country. With `refine`, the digits move it\n * within its calling code (`204 …` under the US becomes Canada): that's for a\n * country resolved from a typed code, which the user never chose. A country they\n * picked stays put; the E.164 value is the same either way. An international one\n * collapses its code\n * into the country as soon as the code is complete. Calling codes are\n * prefix-free, so `+33` can't be the start of a longer one. A shared code\n * resolves to the current country if it shares it, else to the code's main\n * country, and the national digits refine it.\n *\n * `caret` is the number of caret-relevant characters before the caret. The code\n * only collapses when the caret is at or past its end. With the caret inside the\n * code, the user is editing it: `+3|6 12` after deleting a `3` is a complete\n * Hungarian code, and collapsing it would jump to a country they never typed.\n * It stays international text until they finish the code. Omit `caret` (a\n * paste, a value) to collapse unconditionally.\n */\nexport const formatPhone = (\n raw: string,\n country: CountryCode | null,\n caret?: number,\n refine = false,\n): FormattedPhone => {\n const digits = raw.replace(/\\D/g, \"\")\n if (!startsInternational(raw)) return { ...formatNational(digits, country, refine), consumed: 0 }\n\n const typer = new AsYouType()\n const text = typer.input(`+${digits}`)\n const callingCode = typer.getCallingCode()\n const shared =\n callingCode && country && callingCodeOf(country) === callingCode\n ? country\n : callingCode\n ? mainCountryOf(callingCode)\n : null\n const codeEnd = 1 + (callingCode?.length ?? 0)\n if (callingCode && shared && (caret === undefined || caret >= codeEnd)) {\n return {\n ...formatNational(digits.slice(callingCode.length), shared, true),\n consumed: codeEnd,\n }\n }\n // Still typing (or editing) the code: international text, with whatever country the digits\n // so far point to, for the flag.\n return {\n text,\n country: typer.getCountry() ?? shared,\n value: typer.getNumber()?.number ?? null,\n isValid: typer.isValid(),\n consumed: 0,\n }\n}\n\n/**\n * Backspace at the very start of the text, with a country selected: the dial code comes back\n * out of the trigger as editable text, and the country is unselected.\n *\n * - With no number yet, it's the exact inverse of the keystroke that created the token: `+33`\n * collapsed to France, so Backspace leaves `+3`.\n * - With a number after it, the code comes back whole (`+33| 6 12`, caret after the code)\n * without deleting anything. Deleting its last digit would leave `+36 12`, a Hungarian number\n * the user never typed.\n *\n * Returns the new state and the caret position, in caret-relevant characters.\n */\nexport const releaseCountry = (\n text: string,\n country: CountryCode,\n): { next: PhoneState; caret: number } => {\n const code = callingCodeOf(country)\n const digits = text.replace(/\\D/g, \"\")\n if (digits === \"\") {\n const raw = `+${code.slice(0, -1)}`\n const { consumed: _, ...next } = formatPhone(raw, null, raw.length)\n return { next, caret: raw.length }\n }\n const typer = new AsYouType()\n return {\n next: {\n text: typer.input(`+${code}${digits}`),\n country: null,\n value: typer.getNumber()?.number ?? null,\n isValid: typer.isValid(),\n },\n caret: 1 + code.length,\n }\n}\n\n/**\n * The display state for an E.164 `value` handed in from outside (initial or\n * controlled): national formatting once the number is possible for a known\n * country, the collapsed code and national digits otherwise. A `null` value\n * keeps `fallback`.\n */\nexport const parsePhone = (value: string | null, fallback: CountryCode | null): PhoneState => {\n if (!value) return { text: \"\", country: fallback, value: null, isValid: false }\n const parsed = parsePhoneNumberFromString(value)\n if (parsed?.country && parsed.isPossible()) {\n return {\n text: parsed.formatNational(),\n country: parsed.country,\n value: parsed.number,\n isValid: parsed.isValid(),\n }\n }\n const { consumed: _, ...state } = formatPhone(value, fallback)\n return state\n}\n\n/**\n * Re-home the current text under a newly picked country: international text\n * (a code still being typed) drops its calling code and keeps its national\n * digits, a national one keeps its digits as they are.\n */\nexport const switchCountry = (text: string, country: CountryCode | null): PhoneState => {\n if (!startsInternational(text)) return formatNational(text.replace(/\\D/g, \"\"), country, false)\n const typer = new AsYouType()\n typer.input(text)\n const callingCode = typer.getCallingCode() ?? \"\"\n return formatNational(text.replace(/\\D/g, \"\").slice(callingCode.length), country, false)\n}\n\n/** How many caret-relevant characters (digits, and a leading `+`) sit before `end`. */\nexport const significantBefore = (text: string, end: number): number => {\n const head = text.slice(0, end)\n return (head.match(/\\d/g)?.length ?? 0) + (startsInternational(head) ? 1 : 0)\n}\n\nconst isSignificant = (text: string, index: number) =>\n /\\d/.test(text.charAt(index)) ||\n (text.charAt(index) === \"+\" && startsInternational(text.slice(0, index + 1)))\n\n/**\n * The caret position in `text` right after its `count`-th significant\n * character — where a caret that had `count` digits before it belongs once\n * the text is reformatted.\n */\nexport const caretAfter = (text: string, count: number): number => {\n if (count <= 0) return 0\n const index = [...text].findIndex((_, i) => significantBefore(text, i + 1) === count)\n return index === -1 ? text.length : index + 1\n}\n\n/**\n * Backspace / Delete on a formatting character (a space, a parenthesis, a\n * dash) would be undone by the next format and look like a dead key. Instead\n * it removes the nearest digit in that direction, the way every phone field\n * that formats as you type behaves. Returns `null` when the native edit is\n * fine as it is: a selection, or a digit next to the caret.\n */\nexport const deleteAcrossSeparator = (\n text: string,\n caret: number,\n direction: \"backward\" | \"forward\",\n): { raw: string; count: number } | null => {\n const neighbour = direction === \"backward\" ? caret - 1 : caret\n if (neighbour < 0 || neighbour >= text.length || isSignificant(text, neighbour)) return null\n const indices = Array.from(text, (_, i) => i)\n const target =\n direction === \"backward\"\n ? indices.filter((i) => i < caret && isSignificant(text, i)).at(-1)\n : indices.find((i) => i >= caret && isSignificant(text, i))\n if (target === undefined) return null\n return {\n raw: text.slice(0, target) + text.slice(target + 1),\n count: significantBefore(text, direction === \"backward\" ? target : caret),\n }\n}\n\n/**\n * The country a locale implies (`\"fr\"` → `FR`, `\"en-GB\"` → `GB`), when\n * libphonenumber knows it. `Intl.Locale#maximize` fills in the likely region\n * of a bare language tag.\n */\nexport const countryOfLocale = (locale: string): CountryCode | null => {\n try {\n const region = new Intl.Locale(locale).maximize().region\n return PHONE_COUNTRIES.find((country) => country === region) ?? null\n } catch {\n return null\n }\n}\n","\"use client\"\n\nimport { ark } from \"@ark-ui/react\"\nimport { Combobox as ArkCombobox } from \"@ark-ui/react/combobox\"\nimport { useFieldContext } from \"@ark-ui/react/field\"\nimport { Globe } from \"lucide-react\"\nimport {\n type ComponentProps,\n type FocusEvent,\n type KeyboardEvent,\n type ReactNode,\n type Ref,\n useMemo,\n useRef,\n useState,\n} from \"react\"\nimport { cn } from \"../../lib/cn\"\nimport { type IconMap, iconStroke, mergeIcons } from \"../../lib/icons\"\nimport { useLocale } from \"../../lib/intl\"\nimport { useMergedRefs } from \"../../lib/merge-refs\"\nimport { props } from \"../../lib/props\"\nimport type { SelectData } from \"../../lib/select-data\"\nimport type { WithTestId } from \"../../lib/test-id\"\nimport { TEXT_COLOR_CLASSES } from \"../../lib/typography-size\"\nimport { useIsomorphicLayoutEffect } from \"../../lib/use-isomorphic-layout-effect\"\nimport { ComboboxList } from \"../combobox-list/combobox-list\"\nimport {\n type FieldProps,\n FieldShell,\n fieldA11yProps,\n useInheritedDisabled,\n useInheritedInvalid,\n} from \"../field/field\"\nimport { InputBase, type InputSize, type InputVariant, inputControlClasses } from \"../input/input\"\nimport { CheckIcon, ChevronIcon } from \"../popover/icons\"\nimport { Popover, popoverChevron, popoverIndicator } from \"../popover/popover\"\nimport { Flag } from \"./flag\"\nimport {\n type CountryCode,\n callingCodeOf,\n caretAfter,\n countryOfLocale,\n deleteAcrossSeparator,\n exampleOf,\n formatPhone,\n PHONE_COUNTRIES,\n type PhoneState,\n parsePhone,\n releaseCountry,\n significantBefore,\n switchCountry,\n} from \"./phone\"\n\n/**\n * PhoneInput — a phone number field with a country picker. It formats as the\n * user types (`06 12 34 56 78` for France, `(201) 555-0123` for the US) and\n * hands back one canonical value, the E.164 string (`\"+33612345678\"`), which\n * is what a backend or an SMS provider wants.\n *\n * - The country picker at the inline-start is a searchable list (by name or\n * dial code: \"33\" finds France), with each country's flag. Typing or\n * pasting a dial code (`+44 20 …`) moves it into the trigger, and\n * Backspace at the start of the number pulls it back out for editing.\n * - `onChange(value, { country, isValid })` reports `null` while there is no\n * number. The field never turns red on its own while the user is still\n * typing: read `isValid` (or use the exported `isValidPhoneNumber` in your\n * schema) and pass `error`.\n * - The country defaults to the locale's region (`fr-FR` gives France).\n * Pass `defaultCountry` to pin it, which also keeps SSR and the first\n * client render identical when the locale is `\"auto\"`.\n *\n * Formatting and validation come from libphonenumber-js (its `min` metadata),\n * flags from country-flag-icons, loaded lazily on first use.\n */\n\nexport type { CountryCode }\n\ntype PhoneInputClassNames = {\n /** The field wrapper (label / description / error). */\n field?: string\n /** The label element itself. */\n label?: string\n /** The shell `<div>` (also targeted by `className`). */\n root?: string\n /** The country trigger button. */\n country?: string\n /** The inner `<input>`. */\n input?: string\n /** The country list panel. */\n list?: string\n}\n\nexport type PhoneInputTranslations = {\n /** The country trigger's accessible name, given the selected country's name (`null` when\n * none is selected). */\n triggerLabel?: (country: string | null) => string\n /** The country search's placeholder. */\n searchPlaceholder?: string\n /** Shown when no country matches the search. */\n empty?: string\n /** Group heading over `preferredCountries`. */\n preferredLabel?: string\n /** Group heading over the rest of the list, when `preferredCountries` is set. */\n allLabel?: string\n}\n\nexport const PHONE_INPUT_DEFAULT_TRANSLATIONS = {\n triggerLabel: (country: string | null) =>\n country ? `Country: ${country}` : \"Country: none selected\",\n searchPlaceholder: \"Search country\",\n empty: \"No country found\",\n preferredLabel: \"Suggested\",\n allLabel: \"All countries\",\n} as const satisfies Required<PhoneInputTranslations>\n\nexport type PhoneInputIconSlot = \"chevron\" | \"international\"\nexport type PhoneInputIcons = IconMap<PhoneInputIconSlot>\n\n/** The default icons: the trigger's chevron, and the globe shown while no country is set. */\nexport const DEFAULT_ICONS: Record<PhoneInputIconSlot, ReactNode> = {\n chevron: <ChevronIcon />,\n international: <Globe className={iconStroke} />,\n}\n\n/** What `onChange` reports alongside the value. */\nexport type PhoneInputChangeDetails = {\n /** The country the number belongs to, or `null` when it can't be told yet. */\n country: CountryCode | null\n /** A complete, valid number for that country, and the country is in `countries`. */\n isValid: boolean\n}\n\nexport type PhoneInputProps = Pick<FieldProps, \"label\" | \"description\" | \"error\" | \"required\"> &\n WithTestId & {\n /** Controlled value, E.164 (`\"+33612345678\"`); `null` for empty. */\n value?: string | null\n /** Uncontrolled initial value, E.164. */\n defaultValue?: string | null\n /** Fires with the E.164 value (`null` while there's no number) on every change. */\n onChange?: (value: string | null, details: PhoneInputChangeDetails) => void\n /** Controlled country. */\n country?: CountryCode | null\n /** Uncontrolled initial country. Defaults to the locale's region, when it's in `countries`. */\n defaultCountry?: CountryCode | null\n /** Fires when the country changes, picked from the list or detected from a `+…` number. */\n onCountryChange?: (country: CountryCode | null) => void\n /** Only offer these countries. A number from elsewhere still formats, but isn't valid. */\n countries?: readonly CountryCode[]\n /** Pinned at the top of the list, under their own heading. */\n preferredCountries?: readonly CountryCode[]\n /** Draw each country's flag yourself (an emoji, your own sprite). Defaults to the kit's\n * SVG flags. */\n renderFlag?: (country: CountryCode) => ReactNode\n /** Locale for the country names and the default country; defaults to the `IntlProvider`'s. */\n locale?: string\n /**\n * Placeholder shown while the field is empty. Defaults to an example number of the selected\n * country (`06 12 34 56 78` for France) and none while no country is selected. The field's\n * meaning changes with the country, so a fixed string can contradict it (`+33 …` next to a\n * selected France). Pass a function of the country to word it yourself, or `\"\"` for none.\n */\n placeholder?: string | ((country: CountryCode | null) => string | undefined)\n /** Field name for native form submission; submits the E.164 value. */\n name?: string\n /** Red invalid state; OR'd with `error`. */\n invalid?: boolean\n /** Dims the shell and disables the input and the country picker. */\n disabled?: boolean\n /** Keeps full contrast but blocks edits and the country picker. */\n readOnly?: boolean\n variant?: InputVariant\n size?: InputSize\n /** Lands on the `<input>` for focus-on-error. */\n ref?: Ref<HTMLInputElement>\n /** Forwarded to the `<input>`; drives touched/blurred validation. */\n onBlur?: (event: FocusEvent<HTMLInputElement>) => void\n className?: string\n classNames?: PhoneInputClassNames\n /** Overrides the country picker's wording. A partial override keeps the other defaults. */\n translations?: PhoneInputTranslations\n /** Replaces the default icons: `chevron`, `international`. */\n icons?: PhoneInputIcons\n }\n\ntype CountryPayload = { name: string; callingCode: string }\ntype CountryData = SelectData<CountryPayload, CountryCode>\n\n/**\n * The country trigger fills the whole start zone of the shell, full height, from its edge to the\n * divider, so the hover wash and the click target are the zone you see rather than a chip inset\n * in it. The shell drops its own start padding (`ps-0!`) and clips (`overflow-clip`), so its\n * rounded corners clip the wash. The trigger takes the padding the shell would have had, per\n * `size`. Its border is the divider, except under `variant=\"unstyled\"`, which draws no chrome. Its focus shows as the shell's own ring (`shellChrome`'s\n * `:has(:focus-visible)`), like every control inside the family.\n */\nconst countryTrigger = cn(\n \"inline-flex shrink-0 cursor-pointer items-center gap-1 self-stretch outline-none transition-colors\",\n \"[&:hover:not(:disabled)]:bg-brand-900/6 dark:[&:hover:not(:disabled)]:bg-white/8\",\n \"disabled:cursor-not-allowed\",\n)\n\n/** The trigger's inline padding: the shell's own slot-side padding at each size (`inputShell`). */\nconst countryTriggerPadding = {\n xs: \"px-2\",\n sm: \"px-2.5\",\n md: \"px-2.5\",\n lg: \"px-3.5\",\n xl: \"px-4\",\n} as const satisfies Record<InputSize, string>\n\n/** The divider between the country and the number, per `variant`. The same hairline as the\n * shell's own border, and none where the shell draws none. */\nconst countryTriggerDivider = {\n default: \"border-e border-brand-900/20 dark:border-white/15\",\n unstyled: \"\",\n} as const satisfies Record<InputVariant, string>\n\n/** The `<input>`, split out so it reads the `Field` context from inside `FieldShell`. */\nconst PhoneInputControl = ({\n ref,\n testId,\n className,\n ...rest\n}: Omit<ComponentProps<\"input\">, \"ref\"> & { ref?: Ref<HTMLInputElement>; testId?: string }) => {\n const field = useFieldContext()\n return (\n <ark.input\n ref={ref}\n {...field?.getInputProps()}\n {...fieldA11yProps(field)}\n {...props({ \"data-testid\": testId })}\n className={className}\n {...rest}\n />\n )\n}\n\nexport const PhoneInput = ({\n value,\n defaultValue,\n onChange,\n country: countryProp,\n defaultCountry,\n onCountryChange,\n countries,\n preferredCountries,\n renderFlag,\n locale: localeProp,\n placeholder,\n name,\n invalid,\n disabled: disabledProp,\n readOnly,\n required,\n label,\n description,\n error,\n variant = \"default\",\n size = \"md\",\n ref,\n onBlur,\n className,\n classNames,\n testId,\n translations,\n icons: iconsProp,\n}: PhoneInputProps) => {\n // An enclosing `Field` or `Fieldset` disables it too: the shell only dims on\n // the `disabled` handed to it here.\n const disabled = useInheritedDisabled(disabledProp)\n const locale = useLocale(localeProp)\n const t = { ...PHONE_INPUT_DEFAULT_TRANSLATIONS, ...translations }\n const icons = mergeIcons(DEFAULT_ICONS, iconsProp)\n const isInvalid = useInheritedInvalid(invalid || error != null)\n const allowed = countries ?? PHONE_COUNTRIES\n\n const [initial] = useState<PhoneState>(() => {\n const localeCountry = countryOfLocale(locale)\n const fallback =\n countryProp !== undefined\n ? countryProp\n : defaultCountry !== undefined\n ? defaultCountry\n : localeCountry && allowed.includes(localeCountry)\n ? localeCountry\n : null\n return parsePhone(value ?? defaultValue ?? null, fallback)\n })\n const [text, setText] = useState(initial.text)\n const [innerCountry, setInnerCountry] = useState(initial.country)\n // The last value this field reported (or was handed). A controlled `value` that differs from\n // it came from outside — a reset, a server load — and replaces the text; one that matches is\n // just the parent echoing a keystroke back, and must not reformat what the user is typing.\n const [current, setCurrent] = useState(initial.value)\n const country = countryProp !== undefined ? countryProp : innerCountry\n // Whether the country came from the number itself (a typed or pasted `+…` code, or a value)\n // rather than from the user's pick, `defaultCountry` or `country`. Only then may the digits\n // move it within a shared calling code (`+1 204 …` is Canada, not the US). A chosen country\n // stays put. See `formatPhone`'s `refine`.\n const [resolved, setResolved] = useState(initial.value !== null && initial.country !== null)\n\n if (value !== undefined && value !== current) {\n const next = parsePhone(value, country)\n setCurrent(value)\n setText(next.text)\n setInnerCountry(next.country)\n setResolved(next.value !== null && next.country !== null)\n }\n\n const inputRef = useRef<HTMLInputElement>(null)\n const mergedRef = useMergedRefs(inputRef, ref)\n const pendingCaret = useRef<number | null>(null)\n const [open, setOpen] = useState(false)\n const picked = useRef(false)\n\n // Put the caret back where the user left it, counted in digits, once the formatted text is in\n // the DOM. Only while the input has focus: a programmatic change mustn't steal it.\n useIsomorphicLayoutEffect(() => {\n const caret = pendingCaret.current\n const input = inputRef.current\n pendingCaret.current = null\n if (caret === null || !input || input.ownerDocument.activeElement !== input) return\n input.setSelectionRange(caret, caret)\n })\n\n const commit = (next: PhoneState, caretCount: number | null, fromNumber: boolean) => {\n setText(next.text)\n setResolved(fromNumber && next.country !== null)\n pendingCaret.current = caretCount === null ? null : caretAfter(next.text, caretCount)\n if (next.country !== country) {\n setInnerCountry(next.country)\n onCountryChange?.(next.country)\n }\n if (next.value !== current) {\n setCurrent(next.value)\n onChange?.(next.value, {\n country: next.country,\n isValid: next.isValid && next.country !== null && allowed.includes(next.country),\n })\n }\n }\n\n const onKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (event.key !== \"Backspace\" && event.key !== \"Delete\") return\n if (event.altKey || event.ctrlKey || event.metaKey) return\n const input = event.currentTarget\n const caret = input.selectionStart\n if (caret === null || caret !== input.selectionEnd) return\n // Backspace at the very start of a national number pulls the dial code back out of the\n // trigger as editable text (see `releaseCountry`).\n if (event.key === \"Backspace\" && caret === 0 && country && !input.value.startsWith(\"+\")) {\n event.preventDefault()\n const released = releaseCountry(input.value, country)\n commit(released.next, released.caret, false)\n return\n }\n const edit = deleteAcrossSeparator(\n input.value,\n caret,\n event.key === \"Backspace\" ? \"backward\" : \"forward\",\n )\n if (!edit) return\n event.preventDefault()\n const next = formatPhone(edit.raw, country, edit.count, resolved)\n commit(next, edit.count - next.consumed, resolved || next.consumed > 0)\n }\n\n const pick = (next: CountryCode) => {\n picked.current = true\n setOpen(false)\n commit(switchCountry(text, next), null, false)\n }\n\n const data = useMemo<CountryData>(() => {\n const names = new Intl.DisplayNames([locale], { type: \"region\", fallback: \"code\" })\n const collator = new Intl.Collator(locale)\n const toItem = (code: CountryCode) => {\n const countryName = names.of(code) ?? code\n const callingCode = callingCodeOf(code)\n // The label is what the search matches: the name and the dial code both find it.\n return {\n value: code,\n label: `${countryName} +${callingCode}`,\n payload: { name: countryName, callingCode },\n }\n }\n const all = allowed.map(toItem).sort((a, b) => collator.compare(a.payload.name, b.payload.name))\n const preferred = (preferredCountries ?? []).filter((code) => allowed.includes(code))\n if (preferred.length === 0) return all\n return [\n { group: t.preferredLabel, items: preferred.map(toItem) },\n { group: t.allLabel, items: all.filter((item) => !preferred.includes(item.value)) },\n ]\n }, [locale, allowed, preferredCountries, t.preferredLabel, t.allLabel])\n\n const countryName = useMemo(\n () =>\n country\n ? (new Intl.DisplayNames([locale], { type: \"region\", fallback: \"code\" }).of(country) ??\n country)\n : null,\n [country, locale],\n )\n const placeholderText =\n typeof placeholder === \"function\"\n ? placeholder(country)\n : (placeholder ?? (country ? exampleOf(country) : undefined))\n const flagOf = (code: CountryCode) => (renderFlag ? renderFlag(code) : <Flag country={code} />)\n const locked = disabled || readOnly\n\n return (\n <Popover.Root\n open={open}\n onOpenChange={(details) => {\n if (details.open) picked.current = false\n setOpen(details.open)\n }}\n width=\"auto\"\n position=\"bottom-start\"\n // ~250 rows with their flags: only mount them while the list is open.\n lazyMount\n unmountOnExit\n // After a pick, the user's next move is to type the number.\n finalFocusEl={() => (picked.current ? inputRef.current : null)}\n >\n <FieldShell\n label={label}\n description={description}\n error={error}\n required={required}\n disabled={disabled}\n size={size}\n className={classNames?.field}\n classNames={{ label: classNames?.label }}\n >\n {/* The list hangs off the whole field, aligned to its edge, not off the trigger. */}\n <Popover.Anchor asChild>\n <InputBase\n variant={variant}\n size={size}\n invalid={isInvalid}\n disabled={disabled}\n readOnly={readOnly}\n classNames={{ root: classNames?.root }}\n // The country trigger is interactive, so it can't sit in the `aria-hidden` start slot.\n // It's a direct child that owns the start padding (see `countryTrigger`).\n className={cn(\"ps-0! overflow-clip\", className)}\n >\n <Popover.Trigger asChild>\n <button\n type=\"button\"\n disabled={locked}\n aria-label={t.triggerLabel(\n countryName && country ? `${countryName} +${callingCodeOf(country)}` : null,\n )}\n className={cn(\n countryTrigger,\n countryTriggerPadding[size],\n countryTriggerDivider[variant],\n classNames?.country,\n )}\n >\n {country ? flagOf(country) : icons.international}\n {country && (\n <span dir=\"ltr\" className=\"tabular-nums\">\n +{callingCodeOf(country)}\n </span>\n )}\n <span className={cn(popoverChevron, \"inline-flex\", open && \"rotate-180\")}>\n {icons.chevron}\n </span>\n </button>\n </Popover.Trigger>\n <PhoneInputControl\n ref={mergedRef}\n type=\"tel\"\n inputMode=\"tel\"\n autoComplete=\"tel\"\n // A phone number reads left to right in every script.\n dir=\"ltr\"\n value={text}\n placeholder={placeholderText}\n onChange={(event) => {\n const raw = event.currentTarget.value\n const caret = event.currentTarget.selectionStart ?? raw.length\n const count = significantBefore(raw, caret)\n const next = formatPhone(raw, country, count, resolved)\n // A code that just collapsed into the trigger took its characters with it, and\n // the country it resolved to came from the number.\n commit(next, Math.max(0, count - next.consumed), resolved || next.consumed > 0)\n }}\n onKeyDown={onKeyDown}\n onBlur={onBlur}\n testId={testId}\n {...props({\n disabled,\n readOnly,\n \"aria-invalid\": isInvalid,\n })}\n className={cn(inputControlClasses, \"rtl:text-right\", classNames?.input)}\n />\n {name != null && <input type=\"hidden\" name={name} value={current ?? \"\"} />}\n </InputBase>\n </Popover.Anchor>\n </FieldShell>\n <Popover.Content className={cn(\"w-72\", classNames?.list)}>\n <Popover.Body className=\"overflow-visible p-0\">\n <ComboboxList<CountryData>\n size=\"sm\"\n data={data}\n value={country}\n onChange={(next) => {\n if (next) pick(next)\n }}\n placeholder={t.searchPlaceholder}\n empty={t.empty}\n renderItem={(item) => (\n <>\n {flagOf(item.value)}\n <ArkCombobox.ItemText className=\"min-w-0 flex-1 truncate\">\n {item.payload?.name}\n </ArkCombobox.ItemText>\n <span dir=\"ltr\" className={cn(\"tabular-nums\", TEXT_COLOR_CLASSES.muted)}>\n +{item.payload?.callingCode}\n </span>\n <ArkCombobox.ItemIndicator className={popoverIndicator}>\n <CheckIcon />\n </ArkCombobox.ItemIndicator>\n </>\n )}\n />\n </Popover.Body>\n </Popover.Content>\n </Popover.Root>\n )\n}\n"]}
@@ -121,5 +121,5 @@ export type PhoneInputProps = Pick<FieldProps, "label" | "description" | "error"
121
121
  /** Replaces the default icons: `chevron`, `international`. */
122
122
  icons?: PhoneInputIcons;
123
123
  };
124
- export declare const PhoneInput: ({ value, defaultValue, onChange, country: countryProp, defaultCountry, onCountryChange, countries, preferredCountries, renderFlag, locale: localeProp, placeholder, name, invalid, disabled, readOnly, required, label, description, error, variant, size, ref, onBlur, className, classNames, testId, translations, icons: iconsProp, }: PhoneInputProps) => import("react").JSX.Element;
124
+ export declare const PhoneInput: ({ value, defaultValue, onChange, country: countryProp, defaultCountry, onCountryChange, countries, preferredCountries, renderFlag, locale: localeProp, placeholder, name, invalid, disabled: disabledProp, readOnly, required, label, description, error, variant, size, ref, onBlur, className, classNames, testId, translations, icons: iconsProp, }: PhoneInputProps) => import("react").JSX.Element;
125
125
  //# sourceMappingURL=phone-input.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"phone-input.d.ts","sourceRoot":"","sources":["../../../src/components/phone-input/phone-input.tsx"],"names":[],"mappings":"AAMA,OAAO,EAEL,KAAK,UAAU,EAEf,KAAK,SAAS,EACd,KAAK,GAAG,EAIT,MAAM,OAAO,CAAA;AAEd,OAAO,EAAE,KAAK,OAAO,EAA0B,MAAM,iBAAiB,CAAA;AAKtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAInD,OAAO,EAAE,KAAK,UAAU,EAA8B,MAAM,gBAAgB,CAAA;AAC5E,OAAO,EAAa,KAAK,SAAS,EAAE,KAAK,YAAY,EAAuB,MAAM,gBAAgB,CAAA;AAIlG,OAAO,EACL,KAAK,WAAW,EAajB,MAAM,SAAS,CAAA;AAEhB;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,YAAY,EAAE,WAAW,EAAE,CAAA;AAE3B,KAAK,oBAAoB,GAAG;IAC1B,uDAAuD;IACvD,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,gCAAgC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,wDAAwD;IACxD,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,kCAAkC;IAClC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,8BAA8B;IAC9B,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC;6BACyB;IACzB,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,KAAK,MAAM,CAAA;IACjD,wCAAwC;IACxC,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,gDAAgD;IAChD,KAAK,CAAC,EAAE,MAAM,C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AAC,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,KAAK,MAAM,GAAG,SAAS,CAAC,CAAA;IAC5E,sEAAsE;IACtE,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,4CAA4C;IAC5C,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,oEAAoE;IACpE,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,mEAAmE;IACnE,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,OAAO,CAAC,EAAE,YAAY,CAAA;IACtB,IAAI,CAAC,EAAE,SAAS,CAAA;IAChB,iDAAiD;IACjD,GAAG,CAAC,EAAE,GAAG,CAAC,gBAAgB,CAAC,CAAA;IAC3B,qEAAqE;IACrE,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,UAAU,CAAC,gBAAgB,CAAC,KAAK,IAAI,CAAA;IACtD,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,UAAU,CAAC,EAAE,oBAAoB,CAAA;IACjC,2FAA2F;IAC3F,YAAY,CAAC,EAAE,sBAAsB,CAAA;IACrC,8DAA8D;IAC9D,KAAK,CAAC,EAAE,eAAe,CAAA;CACxB,CAAA;AAuDH,eAAO,MAAM,UAAU,2VA6BpB,eAAe,gCA6QjB,CAAA"}
@@ -1,41 +1,43 @@
1
1
  "use client";
2
- import { useImageCropperContext, ImageCropper } from '../../chunk-5EOMSWNO.js';
3
- import '../../chunk-AKXALCUN.js';
4
- import { FileTrigger } from '../../chunk-3KARNPW4.js';
5
- import { Camera, useCamera, imageFile } from '../../chunk-2RQLPN4U.js';
6
- import '../../chunk-HX3LNK26.js';
2
+ import { useImageCropperContext, ImageCropper } from '../../chunk-MAM2X3MW.js';
3
+ import '../../chunk-D7SW2E24.js';
4
+ import { FileTrigger } from '../../chunk-WKIUMLRT.js';
5
+ import { Camera, useCamera, imageFile } from '../../chunk-JCNEW4WJ.js';
7
6
  import '../../chunk-K6YASO4L.js';
8
- import '../../chunk-IA6DCC3N.js';
7
+ import '../../chunk-HX3LNK26.js';
8
+ import '../../chunk-AUQPNDE5.js';
9
9
  import '../../chunk-TWNIAF7K.js';
10
+ import { Button } from '../../chunk-KZDMVOL6.js';
10
11
  import '../../chunk-J43LSYQO.js';
11
12
  import '../../chunk-7TDHT3QD.js';
12
- import '../../chunk-QRNQQIQM.js';
13
+ import '../../chunk-WJUY6YWF.js';
13
14
  import '../../chunk-5FDOOG4J.js';
14
- import '../../chunk-I4B3N3UX.js';
15
- import '../../chunk-X6DESK37.js';
15
+ import '../../chunk-HTVICHT4.js';
16
+ import '../../chunk-2RRTT4AF.js';
16
17
  import '../../chunk-KNGSO7A3.js';
17
18
  import '../../chunk-SKPM2FRX.js';
18
- import { Button } from '../../chunk-SP6LCCTZ.js';
19
19
  import { useObjectUrl } from '../../chunk-DTFSCR3U.js';
20
20
  import '../../chunk-EIBDLRAR.js';
21
21
  import '../../chunk-WG3BCIU4.js';
22
22
  import '../../chunk-CQ4M4BSF.js';
23
23
  import { useMediaQuery } from '../../chunk-HDYORQZN.js';
24
- import { useMergedRefs } from '../../chunk-HBWV5EPU.js';
25
24
  import '../../chunk-AHM6SGEU.js';
25
+ import '../../chunk-YUVKROMA.js';
26
+ import '../../chunk-TPOV3OCC.js';
27
+ import '../../chunk-SI7C3W5M.js';
28
+ import { useMergedRefs } from '../../chunk-HBWV5EPU.js';
26
29
  import { useDirectionCheck } from '../../chunk-OBSZ4NE2.js';
27
- import '../../chunk-RKCUXOU2.js';
28
- import '../../chunk-HWBFRDX7.js';
29
30
  import '../../chunk-V6PY7C6S.js';
30
31
  import '../../chunk-SLUOF7XW.js';
31
- import '../../chunk-B5YHYI7E.js';
32
+ import '../../chunk-ALANKV5Y.js';
33
+ import '../../chunk-NDI4HLQE.js';
32
34
  import '../../chunk-6B2GNPJP.js';
33
- import '../../chunk-PQZSTI3R.js';
34
- import '../../chunk-PMUCGFY5.js';
35
- import { useIsomorphicLayoutEffect } from '../../chunk-BUIHQJGE.js';
36
35
  import '../../chunk-6YNLRQ25.js';
37
36
  import { mergeIcons, iconStroke } from '../../chunk-XXOR34T4.js';
38
37
  import '../../chunk-W3XX7BYT.js';
38
+ import '../../chunk-PQZSTI3R.js';
39
+ import '../../chunk-PMUCGFY5.js';
40
+ import { useIsomorphicLayoutEffect } from '../../chunk-BUIHQJGE.js';
39
41
  import { composeChildren } from '../../chunk-R5LYFTHA.js';
40
42
  import { props } from '../../chunk-WYCMIIRR.js';
41
43
  import '../../chunk-C6NVU4F7.js';