@multiplatform.one/forms 7.7.6 → 7.10.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 (497) hide show
  1. package/dist/cjs/Button/index.cjs +1 -4
  2. package/dist/cjs/Button/index.native.js +5 -6
  3. package/dist/cjs/Button/index.native.js.map +1 -1
  4. package/dist/cjs/Chip/index.cjs +1 -1
  5. package/dist/cjs/Chip/index.native.js +1 -1
  6. package/dist/cjs/Chip/index.native.js.map +1 -1
  7. package/dist/cjs/FloatingPanel/index.cjs +59 -14
  8. package/dist/cjs/FloatingPanel/index.native.js +16 -7
  9. package/dist/cjs/FloatingPanel/index.native.js.map +1 -1
  10. package/dist/cjs/FloatingPanel/nestedAction.cjs +37 -0
  11. package/dist/cjs/FloatingPanel/nestedAction.native.js +42 -0
  12. package/dist/cjs/FloatingPanel/nestedAction.native.js.map +1 -0
  13. package/dist/cjs/InputParts/index.cjs +19 -8
  14. package/dist/cjs/InputParts/index.native.js +20 -11
  15. package/dist/cjs/InputParts/index.native.js.map +1 -1
  16. package/dist/cjs/Wheel/index.cjs +3 -3
  17. package/dist/cjs/Wheel/index.native.js +3 -3
  18. package/dist/cjs/Wheel/index.native.js.map +1 -1
  19. package/dist/cjs/fieldLayout.cjs +3 -3
  20. package/dist/cjs/fieldLayout.native.js +3 -3
  21. package/dist/cjs/fieldLayout.native.js.map +1 -1
  22. package/dist/cjs/fields/Checkbox/CheckboxFieldFrame.cjs +9 -2
  23. package/dist/cjs/fields/Checkbox/CheckboxFieldFrame.native.js +10 -1
  24. package/dist/cjs/fields/Checkbox/CheckboxFieldFrame.native.js.map +1 -1
  25. package/dist/cjs/fields/Combobox/index.cjs +36 -29
  26. package/dist/cjs/fields/Combobox/index.native.js +38 -38
  27. package/dist/cjs/fields/Combobox/index.native.js.map +1 -1
  28. package/dist/cjs/fields/DatePicker/Calendar.cjs +6 -1
  29. package/dist/cjs/fields/DatePicker/Calendar.native.js +6 -1
  30. package/dist/cjs/fields/DatePicker/Calendar.native.js.map +1 -1
  31. package/dist/cjs/fields/DatePicker/DateRangePicker.cjs +2 -2
  32. package/dist/cjs/fields/DatePicker/DateRangePicker.native.js +2 -2
  33. package/dist/cjs/fields/DatePicker/DateRangePicker.native.js.map +1 -1
  34. package/dist/cjs/fields/DatePicker/DatetimePicker.catalog.cjs +15 -12
  35. package/dist/cjs/fields/DatePicker/DatetimePicker.catalog.native.js +16 -12
  36. package/dist/cjs/fields/DatePicker/DatetimePicker.catalog.native.js.map +1 -1
  37. package/dist/cjs/fields/DatePicker/DatetimePicker.native.js +39 -14
  38. package/dist/cjs/fields/DatePicker/DatetimePicker.native.js.map +1 -1
  39. package/dist/cjs/fields/DatePicker/MonthPicker.cjs +10 -3
  40. package/dist/cjs/fields/DatePicker/MonthPicker.native.js +10 -3
  41. package/dist/cjs/fields/DatePicker/MonthPicker.native.js.map +1 -1
  42. package/dist/cjs/fields/DatePicker/MultiDatePicker.cjs +2 -2
  43. package/dist/cjs/fields/DatePicker/MultiDatePicker.native.js +2 -2
  44. package/dist/cjs/fields/DatePicker/MultiDatePicker.native.js.map +1 -1
  45. package/dist/cjs/fields/DatePicker/index.native.js +3 -0
  46. package/dist/cjs/fields/DatePicker/index.native.js.map +1 -1
  47. package/dist/cjs/fields/DatePicker/parts.cjs +26 -14
  48. package/dist/cjs/fields/DatePicker/parts.native.js +28 -14
  49. package/dist/cjs/fields/DatePicker/parts.native.js.map +1 -1
  50. package/dist/cjs/fields/FileUpload/index.cjs +6 -0
  51. package/dist/cjs/fields/FileUpload/index.native.js +6 -0
  52. package/dist/cjs/fields/FileUpload/index.native.js.map +1 -1
  53. package/dist/cjs/fields/Geolocation/GeolocationMap.native.js.map +1 -1
  54. package/dist/cjs/fields/Geolocation/geocoder.cjs +63 -0
  55. package/dist/cjs/fields/Geolocation/geocoder.native.js +68 -0
  56. package/dist/cjs/fields/Geolocation/geocoder.native.js.map +1 -0
  57. package/dist/cjs/fields/Geolocation/index.cjs +801 -152
  58. package/dist/cjs/fields/Geolocation/index.native.js +856 -167
  59. package/dist/cjs/fields/Geolocation/index.native.js.map +1 -1
  60. package/dist/cjs/fields/Geolocation/nativeSearchFocus.cjs +44 -0
  61. package/dist/cjs/fields/Geolocation/nativeSearchFocus.native.js +47 -0
  62. package/dist/cjs/fields/Geolocation/nativeSearchFocus.native.js.map +1 -0
  63. package/dist/cjs/fields/Icon/drawnSet.cjs +16 -3
  64. package/dist/cjs/fields/Icon/drawnSet.native.js +20 -3
  65. package/dist/cjs/fields/Icon/drawnSet.native.js.map +1 -1
  66. package/dist/cjs/fields/Icon/index.cjs +102 -27
  67. package/dist/cjs/fields/Icon/index.native.js +115 -31
  68. package/dist/cjs/fields/Icon/index.native.js.map +1 -1
  69. package/dist/cjs/fields/Input/index.cjs +5 -12
  70. package/dist/cjs/fields/Input/index.native.js +5 -13
  71. package/dist/cjs/fields/Input/index.native.js.map +1 -1
  72. package/dist/cjs/fields/PhoneInput/index.cjs +2 -2
  73. package/dist/cjs/fields/PhoneInput/index.native.js +2 -2
  74. package/dist/cjs/fields/PhoneInput/index.native.js.map +1 -1
  75. package/dist/cjs/fields/RadioGroup/index.cjs +34 -5
  76. package/dist/cjs/fields/RadioGroup/index.native.js +49 -7
  77. package/dist/cjs/fields/RadioGroup/index.native.js.map +1 -1
  78. package/dist/cjs/fields/SearchInput/index.cjs +8 -9
  79. package/dist/cjs/fields/SearchInput/index.native.js +8 -9
  80. package/dist/cjs/fields/SearchInput/index.native.js.map +1 -1
  81. package/dist/cjs/fields/Select/index.cjs +42 -11
  82. package/dist/cjs/fields/Select/index.native.js +52 -20
  83. package/dist/cjs/fields/Select/index.native.js.map +1 -1
  84. package/dist/cjs/fields/Stepper/index.cjs +144 -31
  85. package/dist/cjs/fields/Stepper/index.native.js +151 -31
  86. package/dist/cjs/fields/Stepper/index.native.js.map +1 -1
  87. package/dist/cjs/fields/ToggleGroup/index.cjs +35 -2
  88. package/dist/cjs/fields/ToggleGroup/index.native.js +42 -2
  89. package/dist/cjs/fields/ToggleGroup/index.native.js.map +1 -1
  90. package/dist/cjs/index.cjs +2 -0
  91. package/dist/cjs/index.native.js +2 -0
  92. package/dist/cjs/index.native.js.map +1 -1
  93. package/dist/cjs/shared/focusManagement.cjs +24 -11
  94. package/dist/cjs/shared/focusManagement.native.js +24 -11
  95. package/dist/cjs/shared/focusManagement.native.js.map +1 -1
  96. package/dist/cjs/shared/nativeA11y.cjs +57 -0
  97. package/dist/cjs/shared/nativeA11y.native.js +61 -0
  98. package/dist/cjs/shared/nativeA11y.native.js.map +1 -0
  99. package/dist/esm/Button/index.mjs +1 -4
  100. package/dist/esm/Button/index.mjs.map +1 -1
  101. package/dist/esm/Button/index.native.js +5 -6
  102. package/dist/esm/Button/index.native.js.map +1 -1
  103. package/dist/esm/Chip/index.mjs +1 -1
  104. package/dist/esm/Chip/index.mjs.map +1 -1
  105. package/dist/esm/Chip/index.native.js +1 -1
  106. package/dist/esm/Chip/index.native.js.map +1 -1
  107. package/dist/esm/FloatingPanel/index.mjs +58 -15
  108. package/dist/esm/FloatingPanel/index.mjs.map +1 -1
  109. package/dist/esm/FloatingPanel/index.native.js +15 -8
  110. package/dist/esm/FloatingPanel/index.native.js.map +1 -1
  111. package/dist/esm/FloatingPanel/nestedAction.mjs +11 -0
  112. package/dist/esm/FloatingPanel/nestedAction.mjs.map +1 -0
  113. package/dist/esm/FloatingPanel/nestedAction.native.js +13 -0
  114. package/dist/esm/FloatingPanel/nestedAction.native.js.map +1 -0
  115. package/dist/esm/InputParts/index.mjs +20 -9
  116. package/dist/esm/InputParts/index.mjs.map +1 -1
  117. package/dist/esm/InputParts/index.native.js +21 -12
  118. package/dist/esm/InputParts/index.native.js.map +1 -1
  119. package/dist/esm/Wheel/index.mjs +3 -3
  120. package/dist/esm/Wheel/index.mjs.map +1 -1
  121. package/dist/esm/Wheel/index.native.js +3 -3
  122. package/dist/esm/Wheel/index.native.js.map +1 -1
  123. package/dist/esm/fieldLayout.mjs +3 -3
  124. package/dist/esm/fieldLayout.mjs.map +1 -1
  125. package/dist/esm/fieldLayout.native.js +3 -3
  126. package/dist/esm/fieldLayout.native.js.map +1 -1
  127. package/dist/esm/fields/Checkbox/CheckboxFieldFrame.mjs +8 -1
  128. package/dist/esm/fields/Checkbox/CheckboxFieldFrame.mjs.map +1 -1
  129. package/dist/esm/fields/Checkbox/CheckboxFieldFrame.native.js +10 -1
  130. package/dist/esm/fields/Checkbox/CheckboxFieldFrame.native.js.map +1 -1
  131. package/dist/esm/fields/Combobox/index.mjs +36 -29
  132. package/dist/esm/fields/Combobox/index.mjs.map +1 -1
  133. package/dist/esm/fields/Combobox/index.native.js +38 -38
  134. package/dist/esm/fields/Combobox/index.native.js.map +1 -1
  135. package/dist/esm/fields/DatePicker/Calendar.mjs +6 -1
  136. package/dist/esm/fields/DatePicker/Calendar.mjs.map +1 -1
  137. package/dist/esm/fields/DatePicker/Calendar.native.js +6 -1
  138. package/dist/esm/fields/DatePicker/Calendar.native.js.map +1 -1
  139. package/dist/esm/fields/DatePicker/DateRangePicker.mjs +2 -2
  140. package/dist/esm/fields/DatePicker/DateRangePicker.mjs.map +1 -1
  141. package/dist/esm/fields/DatePicker/DateRangePicker.native.js +2 -2
  142. package/dist/esm/fields/DatePicker/DateRangePicker.native.js.map +1 -1
  143. package/dist/esm/fields/DatePicker/DatetimePicker.catalog.mjs +15 -12
  144. package/dist/esm/fields/DatePicker/DatetimePicker.catalog.mjs.map +1 -1
  145. package/dist/esm/fields/DatePicker/DatetimePicker.catalog.native.js +16 -12
  146. package/dist/esm/fields/DatePicker/DatetimePicker.catalog.native.js.map +1 -1
  147. package/dist/esm/fields/DatePicker/DatetimePicker.native.js +39 -14
  148. package/dist/esm/fields/DatePicker/DatetimePicker.native.js.map +1 -1
  149. package/dist/esm/fields/DatePicker/MonthPicker.mjs +10 -3
  150. package/dist/esm/fields/DatePicker/MonthPicker.mjs.map +1 -1
  151. package/dist/esm/fields/DatePicker/MonthPicker.native.js +10 -3
  152. package/dist/esm/fields/DatePicker/MonthPicker.native.js.map +1 -1
  153. package/dist/esm/fields/DatePicker/MultiDatePicker.mjs +2 -2
  154. package/dist/esm/fields/DatePicker/MultiDatePicker.mjs.map +1 -1
  155. package/dist/esm/fields/DatePicker/MultiDatePicker.native.js +2 -2
  156. package/dist/esm/fields/DatePicker/MultiDatePicker.native.js.map +1 -1
  157. package/dist/esm/fields/DatePicker/index.native.js +3 -0
  158. package/dist/esm/fields/DatePicker/index.native.js.map +1 -1
  159. package/dist/esm/fields/DatePicker/parts.mjs +28 -16
  160. package/dist/esm/fields/DatePicker/parts.mjs.map +1 -1
  161. package/dist/esm/fields/DatePicker/parts.native.js +30 -16
  162. package/dist/esm/fields/DatePicker/parts.native.js.map +1 -1
  163. package/dist/esm/fields/FileUpload/index.mjs +6 -0
  164. package/dist/esm/fields/FileUpload/index.mjs.map +1 -1
  165. package/dist/esm/fields/FileUpload/index.native.js +6 -0
  166. package/dist/esm/fields/FileUpload/index.native.js.map +1 -1
  167. package/dist/esm/fields/Geolocation/GeolocationMap.mjs.map +1 -1
  168. package/dist/esm/fields/Geolocation/GeolocationMap.native.js.map +1 -1
  169. package/dist/esm/fields/Geolocation/geocoder.mjs +33 -0
  170. package/dist/esm/fields/Geolocation/geocoder.mjs.map +1 -0
  171. package/dist/esm/fields/Geolocation/geocoder.native.js +35 -0
  172. package/dist/esm/fields/Geolocation/geocoder.native.js.map +1 -0
  173. package/dist/esm/fields/Geolocation/index.mjs +792 -149
  174. package/dist/esm/fields/Geolocation/index.mjs.map +1 -1
  175. package/dist/esm/fields/Geolocation/index.native.js +847 -164
  176. package/dist/esm/fields/Geolocation/index.native.js.map +1 -1
  177. package/dist/esm/fields/Geolocation/nativeSearchFocus.mjs +19 -0
  178. package/dist/esm/fields/Geolocation/nativeSearchFocus.mjs.map +1 -0
  179. package/dist/esm/fields/Geolocation/nativeSearchFocus.native.js +19 -0
  180. package/dist/esm/fields/Geolocation/nativeSearchFocus.native.js.map +1 -0
  181. package/dist/esm/fields/Icon/drawnSet.mjs +16 -3
  182. package/dist/esm/fields/Icon/drawnSet.mjs.map +1 -1
  183. package/dist/esm/fields/Icon/drawnSet.native.js +20 -3
  184. package/dist/esm/fields/Icon/drawnSet.native.js.map +1 -1
  185. package/dist/esm/fields/Icon/index.mjs +93 -18
  186. package/dist/esm/fields/Icon/index.mjs.map +1 -1
  187. package/dist/esm/fields/Icon/index.native.js +106 -22
  188. package/dist/esm/fields/Icon/index.native.js.map +1 -1
  189. package/dist/esm/fields/Input/index.mjs +5 -12
  190. package/dist/esm/fields/Input/index.mjs.map +1 -1
  191. package/dist/esm/fields/Input/index.native.js +5 -13
  192. package/dist/esm/fields/Input/index.native.js.map +1 -1
  193. package/dist/esm/fields/PhoneInput/index.mjs +2 -2
  194. package/dist/esm/fields/PhoneInput/index.mjs.map +1 -1
  195. package/dist/esm/fields/PhoneInput/index.native.js +2 -2
  196. package/dist/esm/fields/PhoneInput/index.native.js.map +1 -1
  197. package/dist/esm/fields/RadioGroup/index.mjs +34 -5
  198. package/dist/esm/fields/RadioGroup/index.mjs.map +1 -1
  199. package/dist/esm/fields/RadioGroup/index.native.js +49 -7
  200. package/dist/esm/fields/RadioGroup/index.native.js.map +1 -1
  201. package/dist/esm/fields/SearchInput/index.mjs +9 -10
  202. package/dist/esm/fields/SearchInput/index.mjs.map +1 -1
  203. package/dist/esm/fields/SearchInput/index.native.js +9 -10
  204. package/dist/esm/fields/SearchInput/index.native.js.map +1 -1
  205. package/dist/esm/fields/Select/index.mjs +42 -11
  206. package/dist/esm/fields/Select/index.mjs.map +1 -1
  207. package/dist/esm/fields/Select/index.native.js +52 -20
  208. package/dist/esm/fields/Select/index.native.js.map +1 -1
  209. package/dist/esm/fields/Stepper/index.mjs +145 -32
  210. package/dist/esm/fields/Stepper/index.mjs.map +1 -1
  211. package/dist/esm/fields/Stepper/index.native.js +152 -32
  212. package/dist/esm/fields/Stepper/index.native.js.map +1 -1
  213. package/dist/esm/fields/ToggleGroup/index.mjs +35 -2
  214. package/dist/esm/fields/ToggleGroup/index.mjs.map +1 -1
  215. package/dist/esm/fields/ToggleGroup/index.native.js +42 -2
  216. package/dist/esm/fields/ToggleGroup/index.native.js.map +1 -1
  217. package/dist/esm/index.mjs +2 -1
  218. package/dist/esm/index.mjs.map +1 -1
  219. package/dist/esm/index.native.js +2 -1
  220. package/dist/esm/index.native.js.map +1 -1
  221. package/dist/esm/shared/focusManagement.mjs +24 -11
  222. package/dist/esm/shared/focusManagement.mjs.map +1 -1
  223. package/dist/esm/shared/focusManagement.native.js +24 -11
  224. package/dist/esm/shared/focusManagement.native.js.map +1 -1
  225. package/dist/esm/shared/nativeA11y.mjs +31 -0
  226. package/dist/esm/shared/nativeA11y.mjs.map +1 -0
  227. package/dist/esm/shared/nativeA11y.native.js +32 -0
  228. package/dist/esm/shared/nativeA11y.native.js.map +1 -0
  229. package/dist/jsx/Button/index.mjs +1 -4
  230. package/dist/jsx/Button/index.mjs.map +1 -1
  231. package/dist/jsx/Button/index.native.js +5 -6
  232. package/dist/jsx/Button/index.native.js.map +1 -1
  233. package/dist/jsx/Chip/index.mjs +1 -1
  234. package/dist/jsx/Chip/index.mjs.map +1 -1
  235. package/dist/jsx/Chip/index.native.js +1 -1
  236. package/dist/jsx/Chip/index.native.js.map +1 -1
  237. package/dist/jsx/FloatingPanel/index.mjs +58 -15
  238. package/dist/jsx/FloatingPanel/index.mjs.map +1 -1
  239. package/dist/jsx/FloatingPanel/index.native.js +16 -7
  240. package/dist/jsx/FloatingPanel/index.native.js.map +1 -1
  241. package/dist/jsx/FloatingPanel/nestedAction.mjs +11 -0
  242. package/dist/jsx/FloatingPanel/nestedAction.mjs.map +1 -0
  243. package/dist/jsx/FloatingPanel/nestedAction.native.js +42 -0
  244. package/dist/jsx/FloatingPanel/nestedAction.native.js.map +1 -0
  245. package/dist/jsx/InputParts/index.mjs +20 -9
  246. package/dist/jsx/InputParts/index.mjs.map +1 -1
  247. package/dist/jsx/InputParts/index.native.js +20 -11
  248. package/dist/jsx/InputParts/index.native.js.map +1 -1
  249. package/dist/jsx/Wheel/index.mjs +3 -3
  250. package/dist/jsx/Wheel/index.mjs.map +1 -1
  251. package/dist/jsx/Wheel/index.native.js +3 -3
  252. package/dist/jsx/Wheel/index.native.js.map +1 -1
  253. package/dist/jsx/fieldLayout.mjs +3 -3
  254. package/dist/jsx/fieldLayout.mjs.map +1 -1
  255. package/dist/jsx/fieldLayout.native.js +3 -3
  256. package/dist/jsx/fieldLayout.native.js.map +1 -1
  257. package/dist/jsx/fields/Checkbox/CheckboxFieldFrame.mjs +8 -1
  258. package/dist/jsx/fields/Checkbox/CheckboxFieldFrame.mjs.map +1 -1
  259. package/dist/jsx/fields/Checkbox/CheckboxFieldFrame.native.js +10 -1
  260. package/dist/jsx/fields/Checkbox/CheckboxFieldFrame.native.js.map +1 -1
  261. package/dist/jsx/fields/Combobox/index.mjs +36 -29
  262. package/dist/jsx/fields/Combobox/index.mjs.map +1 -1
  263. package/dist/jsx/fields/Combobox/index.native.js +38 -38
  264. package/dist/jsx/fields/Combobox/index.native.js.map +1 -1
  265. package/dist/jsx/fields/DatePicker/Calendar.mjs +6 -1
  266. package/dist/jsx/fields/DatePicker/Calendar.mjs.map +1 -1
  267. package/dist/jsx/fields/DatePicker/Calendar.native.js +6 -1
  268. package/dist/jsx/fields/DatePicker/Calendar.native.js.map +1 -1
  269. package/dist/jsx/fields/DatePicker/DateRangePicker.mjs +2 -2
  270. package/dist/jsx/fields/DatePicker/DateRangePicker.mjs.map +1 -1
  271. package/dist/jsx/fields/DatePicker/DateRangePicker.native.js +2 -2
  272. package/dist/jsx/fields/DatePicker/DateRangePicker.native.js.map +1 -1
  273. package/dist/jsx/fields/DatePicker/DatetimePicker.catalog.mjs +15 -12
  274. package/dist/jsx/fields/DatePicker/DatetimePicker.catalog.mjs.map +1 -1
  275. package/dist/jsx/fields/DatePicker/DatetimePicker.catalog.native.js +16 -12
  276. package/dist/jsx/fields/DatePicker/DatetimePicker.catalog.native.js.map +1 -1
  277. package/dist/jsx/fields/DatePicker/DatetimePicker.native.js +39 -14
  278. package/dist/jsx/fields/DatePicker/DatetimePicker.native.js.map +1 -1
  279. package/dist/jsx/fields/DatePicker/MonthPicker.mjs +10 -3
  280. package/dist/jsx/fields/DatePicker/MonthPicker.mjs.map +1 -1
  281. package/dist/jsx/fields/DatePicker/MonthPicker.native.js +10 -3
  282. package/dist/jsx/fields/DatePicker/MonthPicker.native.js.map +1 -1
  283. package/dist/jsx/fields/DatePicker/MultiDatePicker.mjs +2 -2
  284. package/dist/jsx/fields/DatePicker/MultiDatePicker.mjs.map +1 -1
  285. package/dist/jsx/fields/DatePicker/MultiDatePicker.native.js +2 -2
  286. package/dist/jsx/fields/DatePicker/MultiDatePicker.native.js.map +1 -1
  287. package/dist/jsx/fields/DatePicker/index.native.js +3 -0
  288. package/dist/jsx/fields/DatePicker/index.native.js.map +1 -1
  289. package/dist/jsx/fields/DatePicker/parts.mjs +28 -16
  290. package/dist/jsx/fields/DatePicker/parts.mjs.map +1 -1
  291. package/dist/jsx/fields/DatePicker/parts.native.js +28 -14
  292. package/dist/jsx/fields/DatePicker/parts.native.js.map +1 -1
  293. package/dist/jsx/fields/FileUpload/index.mjs +6 -0
  294. package/dist/jsx/fields/FileUpload/index.mjs.map +1 -1
  295. package/dist/jsx/fields/FileUpload/index.native.js +6 -0
  296. package/dist/jsx/fields/FileUpload/index.native.js.map +1 -1
  297. package/dist/jsx/fields/Geolocation/GeolocationMap.mjs.map +1 -1
  298. package/dist/jsx/fields/Geolocation/GeolocationMap.native.js.map +1 -1
  299. package/dist/jsx/fields/Geolocation/geocoder.mjs +33 -0
  300. package/dist/jsx/fields/Geolocation/geocoder.mjs.map +1 -0
  301. package/dist/jsx/fields/Geolocation/geocoder.native.js +68 -0
  302. package/dist/jsx/fields/Geolocation/geocoder.native.js.map +1 -0
  303. package/dist/jsx/fields/Geolocation/index.mjs +792 -149
  304. package/dist/jsx/fields/Geolocation/index.mjs.map +1 -1
  305. package/dist/jsx/fields/Geolocation/index.native.js +856 -167
  306. package/dist/jsx/fields/Geolocation/index.native.js.map +1 -1
  307. package/dist/jsx/fields/Geolocation/nativeSearchFocus.mjs +19 -0
  308. package/dist/jsx/fields/Geolocation/nativeSearchFocus.mjs.map +1 -0
  309. package/dist/jsx/fields/Geolocation/nativeSearchFocus.native.js +47 -0
  310. package/dist/jsx/fields/Geolocation/nativeSearchFocus.native.js.map +1 -0
  311. package/dist/jsx/fields/Icon/drawnSet.mjs +16 -3
  312. package/dist/jsx/fields/Icon/drawnSet.mjs.map +1 -1
  313. package/dist/jsx/fields/Icon/drawnSet.native.js +20 -3
  314. package/dist/jsx/fields/Icon/drawnSet.native.js.map +1 -1
  315. package/dist/jsx/fields/Icon/index.mjs +93 -18
  316. package/dist/jsx/fields/Icon/index.mjs.map +1 -1
  317. package/dist/jsx/fields/Icon/index.native.js +115 -31
  318. package/dist/jsx/fields/Icon/index.native.js.map +1 -1
  319. package/dist/jsx/fields/Input/index.mjs +5 -12
  320. package/dist/jsx/fields/Input/index.mjs.map +1 -1
  321. package/dist/jsx/fields/Input/index.native.js +5 -13
  322. package/dist/jsx/fields/Input/index.native.js.map +1 -1
  323. package/dist/jsx/fields/PhoneInput/index.mjs +2 -2
  324. package/dist/jsx/fields/PhoneInput/index.mjs.map +1 -1
  325. package/dist/jsx/fields/PhoneInput/index.native.js +2 -2
  326. package/dist/jsx/fields/PhoneInput/index.native.js.map +1 -1
  327. package/dist/jsx/fields/RadioGroup/index.mjs +34 -5
  328. package/dist/jsx/fields/RadioGroup/index.mjs.map +1 -1
  329. package/dist/jsx/fields/RadioGroup/index.native.js +49 -7
  330. package/dist/jsx/fields/RadioGroup/index.native.js.map +1 -1
  331. package/dist/jsx/fields/SearchInput/index.mjs +9 -10
  332. package/dist/jsx/fields/SearchInput/index.mjs.map +1 -1
  333. package/dist/jsx/fields/SearchInput/index.native.js +8 -9
  334. package/dist/jsx/fields/SearchInput/index.native.js.map +1 -1
  335. package/dist/jsx/fields/Select/index.mjs +42 -11
  336. package/dist/jsx/fields/Select/index.mjs.map +1 -1
  337. package/dist/jsx/fields/Select/index.native.js +52 -20
  338. package/dist/jsx/fields/Select/index.native.js.map +1 -1
  339. package/dist/jsx/fields/Stepper/index.mjs +145 -32
  340. package/dist/jsx/fields/Stepper/index.mjs.map +1 -1
  341. package/dist/jsx/fields/Stepper/index.native.js +151 -31
  342. package/dist/jsx/fields/Stepper/index.native.js.map +1 -1
  343. package/dist/jsx/fields/ToggleGroup/index.mjs +35 -2
  344. package/dist/jsx/fields/ToggleGroup/index.mjs.map +1 -1
  345. package/dist/jsx/fields/ToggleGroup/index.native.js +42 -2
  346. package/dist/jsx/fields/ToggleGroup/index.native.js.map +1 -1
  347. package/dist/jsx/index.js +2 -1
  348. package/dist/jsx/index.js.map +1 -1
  349. package/dist/jsx/index.mjs +2 -1
  350. package/dist/jsx/index.mjs.map +1 -1
  351. package/dist/jsx/index.native.js +2 -0
  352. package/dist/jsx/index.native.js.map +1 -1
  353. package/dist/jsx/shared/focusManagement.mjs +24 -11
  354. package/dist/jsx/shared/focusManagement.mjs.map +1 -1
  355. package/dist/jsx/shared/focusManagement.native.js +24 -11
  356. package/dist/jsx/shared/focusManagement.native.js.map +1 -1
  357. package/dist/jsx/shared/nativeA11y.mjs +31 -0
  358. package/dist/jsx/shared/nativeA11y.mjs.map +1 -0
  359. package/dist/jsx/shared/nativeA11y.native.js +61 -0
  360. package/dist/jsx/shared/nativeA11y.native.js.map +1 -0
  361. package/package.json +9 -7
  362. package/src/Button/Button.fontWeight.spec.tsx +75 -0
  363. package/src/Button/Button.labelInk.spec.tsx +21 -18
  364. package/src/Button/Button.outlinedChannel.spec.tsx +46 -0
  365. package/src/Button/Button.sizeLadder.spec.tsx +4 -3
  366. package/src/Button/Button.stories.tsx +20 -0
  367. package/src/Button/index.tsx +30 -7
  368. package/src/Chip/Chip.spec.tsx +3 -1
  369. package/src/Chip/index.tsx +1 -5
  370. package/src/FieldGroup.stories.tsx +3 -7
  371. package/src/FieldLayout.stories.tsx +75 -12
  372. package/src/Fieldset.stories.tsx +3 -7
  373. package/src/FloatingPanel/FloatingPanel.native.spec.tsx +54 -0
  374. package/src/FloatingPanel/FloatingPanel.spec.tsx +109 -0
  375. package/src/FloatingPanel/index.native.tsx +24 -7
  376. package/src/FloatingPanel/index.tsx +80 -13
  377. package/src/FloatingPanel/nestedAction.spec.ts +36 -0
  378. package/src/FloatingPanel/nestedAction.ts +15 -0
  379. package/src/FloatingPanel/panelWidthContract.spec.ts +12 -15
  380. package/src/FormGrid.stories.tsx +5 -11
  381. package/src/FormsIntegration.stories.tsx +2 -6
  382. package/src/InputParts/InputButton.spec.tsx +16 -0
  383. package/src/InputParts/index.tsx +34 -7
  384. package/src/InputParts/layoutGap.spec.tsx +43 -0
  385. package/src/Wheel/Wheel.spec.tsx +16 -0
  386. package/src/Wheel/index.tsx +3 -3
  387. package/src/fieldFamilyStories.radius.spec.tsx +118 -0
  388. package/src/fieldLayout.spec.tsx +42 -1
  389. package/src/fieldLayout.tsx +9 -9
  390. package/src/fields/Barcode/Barcode.spec.tsx +2 -0
  391. package/src/fields/Checkbox/CheckboxFieldFrame.spec.tsx +18 -0
  392. package/src/fields/Checkbox/CheckboxFieldFrame.tsx +6 -1
  393. package/src/fields/Combobox/Combobox.spec.tsx +48 -1
  394. package/src/fields/Combobox/index.tsx +53 -39
  395. package/src/fields/DatePicker/Calendar.tsx +4 -1
  396. package/src/fields/DatePicker/DatePicker.stories.tsx +22 -1
  397. package/src/fields/DatePicker/DateRangePicker.tsx +4 -2
  398. package/src/fields/DatePicker/DatetimePicker.catalog.tsx +21 -19
  399. package/src/fields/DatePicker/DatetimePicker.native.spec.tsx +144 -0
  400. package/src/fields/DatePicker/DatetimePicker.native.tsx +57 -32
  401. package/src/fields/DatePicker/DatetimePicker.stories.tsx +22 -0
  402. package/src/fields/DatePicker/MonthPicker.tsx +8 -3
  403. package/src/fields/DatePicker/MultiDatePicker.tsx +4 -2
  404. package/src/fields/DatePicker/index.native.tsx +1 -0
  405. package/src/fields/DatePicker/parts.spec.tsx +56 -0
  406. package/src/fields/DatePicker/parts.tsx +33 -12
  407. package/src/fields/FileUpload/FileUpload.spec.tsx +29 -0
  408. package/src/fields/FileUpload/index.tsx +6 -0
  409. package/src/fields/Geolocation/Geolocation.spec.tsx +287 -35
  410. package/src/fields/Geolocation/Geolocation.stories.tsx +141 -7
  411. package/src/fields/Geolocation/GeolocationMap.native.tsx +3 -0
  412. package/src/fields/Geolocation/GeolocationMap.tsx +4 -0
  413. package/src/fields/Geolocation/geocoder.spec.ts +59 -0
  414. package/src/fields/Geolocation/geocoder.ts +84 -0
  415. package/src/fields/Geolocation/geocoderSeam.spec.tsx +203 -0
  416. package/src/fields/Geolocation/index.tsx +912 -180
  417. package/src/fields/Geolocation/nativeSearchFocus.spec.ts +34 -0
  418. package/src/fields/Geolocation/nativeSearchFocus.ts +19 -0
  419. package/src/fields/Geolocation/salvage.spec.tsx +398 -0
  420. package/src/fields/Geolocation/storyProviders.spec.tsx +44 -0
  421. package/src/fields/Icon/Icon.spec.tsx +215 -1
  422. package/src/fields/Icon/Icon.stories.tsx +9 -1
  423. package/src/fields/Icon/drawnSet.tsx +44 -4
  424. package/src/fields/Icon/index.tsx +118 -18
  425. package/src/fields/Input/Input.copy.spec.tsx +1 -0
  426. package/src/fields/Input/Input.spec.tsx +50 -0
  427. package/src/fields/Input/Input.stories.tsx +1 -1
  428. package/src/fields/Input/index.tsx +7 -13
  429. package/src/fields/PhoneInput/index.tsx +2 -2
  430. package/src/fields/RadioGroup/RadioGroup.native.spec.tsx +67 -0
  431. package/src/fields/RadioGroup/index.tsx +82 -8
  432. package/src/fields/SearchInput/SearchInput.spec.tsx +14 -0
  433. package/src/fields/SearchInput/index.tsx +5 -6
  434. package/src/fields/Select/Select.spec.tsx +54 -0
  435. package/src/fields/Select/index.tsx +52 -17
  436. package/src/fields/Stepper/Stepper.spec.tsx +34 -1
  437. package/src/fields/Stepper/index.tsx +193 -33
  438. package/src/fields/ToggleGroup/ToggleGroup.native.spec.tsx +73 -0
  439. package/src/fields/ToggleGroup/ToggleGroup.spec.tsx +49 -0
  440. package/src/fields/ToggleGroup/index.tsx +76 -1
  441. package/src/index.ts +9 -0
  442. package/src/shared/focusManagement.spec.tsx +68 -0
  443. package/src/shared/focusManagement.ts +20 -10
  444. package/src/shared/nativeA11y.spec.ts +64 -0
  445. package/src/shared/nativeA11y.ts +80 -0
  446. package/types/Button/index.d.ts +22 -3
  447. package/types/Button/index.d.ts.map +1 -1
  448. package/types/Chip/index.d.ts.map +1 -1
  449. package/types/FloatingPanel/index.d.ts +11 -1
  450. package/types/FloatingPanel/index.d.ts.map +1 -1
  451. package/types/FloatingPanel/index.native.d.ts +2 -1
  452. package/types/FloatingPanel/index.native.d.ts.map +1 -1
  453. package/types/FloatingPanel/nestedAction.d.ts +13 -0
  454. package/types/FloatingPanel/nestedAction.d.ts.map +1 -0
  455. package/types/InputParts/index.d.ts.map +1 -1
  456. package/types/fields/Checkbox/CheckboxFieldFrame.d.ts +46 -2
  457. package/types/fields/Checkbox/CheckboxFieldFrame.d.ts.map +1 -1
  458. package/types/fields/Checkbox/index.d.ts +3 -3
  459. package/types/fields/Combobox/index.d.ts +3 -1
  460. package/types/fields/Combobox/index.d.ts.map +1 -1
  461. package/types/fields/DatePicker/Calendar.d.ts.map +1 -1
  462. package/types/fields/DatePicker/DateRangePicker.d.ts.map +1 -1
  463. package/types/fields/DatePicker/DatetimePicker.catalog.d.ts.map +1 -1
  464. package/types/fields/DatePicker/DatetimePicker.native.d.ts.map +1 -1
  465. package/types/fields/DatePicker/MonthPicker.d.ts.map +1 -1
  466. package/types/fields/DatePicker/MultiDatePicker.d.ts.map +1 -1
  467. package/types/fields/DatePicker/index.native.d.ts.map +1 -1
  468. package/types/fields/DatePicker/parts.d.ts.map +1 -1
  469. package/types/fields/FileUpload/index.d.ts.map +1 -1
  470. package/types/fields/Geolocation/GeolocationMap.d.ts +4 -0
  471. package/types/fields/Geolocation/GeolocationMap.d.ts.map +1 -1
  472. package/types/fields/Geolocation/GeolocationMap.native.d.ts +3 -0
  473. package/types/fields/Geolocation/GeolocationMap.native.d.ts.map +1 -1
  474. package/types/fields/Geolocation/geocoder.d.ts +53 -0
  475. package/types/fields/Geolocation/geocoder.d.ts.map +1 -0
  476. package/types/fields/Geolocation/index.d.ts +18 -2
  477. package/types/fields/Geolocation/index.d.ts.map +1 -1
  478. package/types/fields/Geolocation/nativeSearchFocus.d.ts +8 -0
  479. package/types/fields/Geolocation/nativeSearchFocus.d.ts.map +1 -0
  480. package/types/fields/Icon/drawnSet.d.ts.map +1 -1
  481. package/types/fields/Icon/index.d.ts.map +1 -1
  482. package/types/fields/Input/index.d.ts.map +1 -1
  483. package/types/fields/PhoneInput/index.d.ts.map +1 -1
  484. package/types/fields/RadioGroup/index.d.ts +30 -3
  485. package/types/fields/RadioGroup/index.d.ts.map +1 -1
  486. package/types/fields/SearchInput/index.d.ts.map +1 -1
  487. package/types/fields/Select/index.d.ts.map +1 -1
  488. package/types/fields/Stepper/index.d.ts.map +1 -1
  489. package/types/fields/ToggleGroup/index.d.ts +31 -2
  490. package/types/fields/ToggleGroup/index.d.ts.map +1 -1
  491. package/types/index.d.ts +2 -0
  492. package/types/index.d.ts.map +1 -1
  493. package/types/shared/focusManagement.d.ts +2 -2
  494. package/types/shared/focusManagement.d.ts.map +1 -1
  495. package/types/shared/nativeA11y.d.ts +61 -0
  496. package/types/shared/nativeA11y.d.ts.map +1 -0
  497. package/src/router.d.ts +0 -16
@@ -1,20 +1,35 @@
1
- import { ensureFocusVisibleRing, useResolvedKnobs } from "@multiplatform.one/theme";
2
- import { NavigationArrowIcon } from "@phosphor-icons/react";
3
- import { useCallback, useEffect, useRef, useState } from "react";
4
- import { Spinner, Text, View, XStack, YStack, isWeb } from "tamagui";
1
+ import { ensureFocusVisibleRing, pressTargetHitSlop, useResolvedKnobs, useGlyphColor } from "@multiplatform.one/theme";
2
+ import { MagnifyingGlassIcon, MapPinIcon, NavigationArrowIcon, XIcon } from "@phosphor-icons/react";
3
+ import { useCallback, useEffect, useId, useRef, useState } from "react";
4
+ import { ScrollView, Spinner, Text, View, XStack, YStack, isWeb } from "tamagui";
5
5
  import { AdaptivePopup } from "../../AdaptivePopup/index.mjs";
6
6
  import { Button } from "../../Button/index.mjs";
7
7
  import { Field, FieldLayout } from "../../fieldLayout.mjs";
8
- import { FloatingPanel } from "../../FloatingPanel/index.mjs";
9
- import { GeolocationMap } from "./GeolocationMap.mjs";
10
- import { detectGeoShape, formatGeoValue, parseGeoValue } from "./geoValue.mjs";
8
+ import { FloatingPanel, useViewportGtSm } from "../../FloatingPanel/index.mjs";
11
9
  import { Input as InputParts } from "../../InputParts/index.mjs";
12
10
  import { Skeleton } from "../../Skeleton/index.mjs";
11
+ import { GeolocationMap } from "./GeolocationMap.mjs";
12
+ import { createNativeSearchFocus } from "./nativeSearchFocus.mjs";
13
+ import { detectGeoShape, formatGeoValue, parseGeoValue } from "./geoValue.mjs";
13
14
  import { queryPermissionState } from "../../shared/capabilityPreflight.mjs";
14
15
  import { formCommonColors, formInputColors } from "../../shared/colorRamps.mjs";
15
16
  import { t } from "../../shared/t.mjs";
17
+ import { pressSlopProps } from "../../shared/pressSlopProps.mjs";
18
+ import { useIsInTableCell } from "../../shared/tableCellContext.mjs";
19
+ import { zIndex } from "../../shared/zIndex.mjs";
16
20
  import { clampRadiusForLargeComponent, getFieldError, getFieldHeight, mergeFieldHandler, useFormField, useResolvedValidators } from "../../shared/utils.mjs";
17
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
21
+ import { clampLat, clampLng, formatCoordPair, formatPlace, parseLatLngPair, resolveGeocoder } from "./geocoder.mjs";
22
+ import { clampLat as clampLat2, clampLng as clampLng2, formatCoordPair as formatCoordPair2, formatPlace as formatPlace2, parseLatLngPair as parseLatLngPair2, resolveGeocoder as resolveGeocoder2 } from "./geocoder.mjs";
23
+ import { jsx, jsxs } from "react/jsx-runtime";
24
+ function coordinateKey({
25
+ lat,
26
+ lng
27
+ }) {
28
+ return `${lat},${lng}`;
29
+ }
30
+ const SEARCH_DEBOUNCE_MS = 300;
31
+ const COORD_LINE_HEIGHT = 28;
32
+ const RESULTS_PANEL_SHADOW = "0px 8px 28px rgba(0,0,0,0.12), 0px 2px 6px rgba(0,0,0,0.04)";
18
33
  async function preflightGeolocation() {
19
34
  if (typeof navigator === "undefined" || !navigator.geolocation) {
20
35
  const insecure = typeof window !== "undefined" && window.isSecureContext === false;
@@ -47,15 +62,6 @@ function mapGeolocationError(err) {
47
62
  }
48
63
  return err.message || t("Failed to get location");
49
64
  }
50
- function clampLat(val) {
51
- return Math.max(-90, Math.min(90, val));
52
- }
53
- function clampLng(val) {
54
- return Math.max(-180, Math.min(180, val));
55
- }
56
- function formatCoordChip(lat, lng) {
57
- return `${lat.toFixed(4)}, ${lng.toFixed(4)}`;
58
- }
59
65
  function tryParseCoord(text, clamp) {
60
66
  const trimmed = text.trim();
61
67
  if (trimmed === "" || trimmed === "-" || trimmed === "." || trimmed === "-.") return void 0;
@@ -210,8 +216,132 @@ function ExpandedMapView({
210
216
  });
211
217
  }
212
218
  const overlayFocusRing = ensureFocusVisibleRing({
213
- outlineOffset: -2
219
+ outlineOffset: 0
214
220
  });
221
+ function ResultRow({
222
+ testID,
223
+ label,
224
+ description,
225
+ onPress,
226
+ disabled
227
+ }) {
228
+ return /* @__PURE__ */jsxs(YStack, {
229
+ testID,
230
+ role: "option",
231
+ "aria-selected": false,
232
+ "aria-disabled": disabled || void 0,
233
+ ...(isWeb ? {
234
+ tabIndex: disabled ? -1 : 0,
235
+ onKeyDown: event => {
236
+ if (disabled) return;
237
+ if (event.key === "Enter" || event.key === " ") {
238
+ event.preventDefault();
239
+ onPress();
240
+ } else if (event.key === "ArrowDown" || event.key === "ArrowUp") {
241
+ event.preventDefault();
242
+ const rows = [...(event.currentTarget.parentElement?.querySelectorAll("[role='option']:not([aria-disabled='true'])") ?? [])];
243
+ const index = rows.indexOf(event.currentTarget);
244
+ rows[(index + (event.key === "ArrowDown" ? 1 : -1) + rows.length) % rows.length]?.focus();
245
+ }
246
+ }
247
+ } : {}),
248
+ minHeight: description ? 62 : 44,
249
+ justifyContent: "center",
250
+ paddingHorizontal: "$3",
251
+ paddingVertical: description ? "$2" : 0,
252
+ cursor: disabled ? "not-allowed" : "pointer",
253
+ hoverStyle: disabled ? void 0 : {
254
+ backgroundColor: "$color3"
255
+ },
256
+ pressStyle: disabled ? void 0 : {
257
+ backgroundColor: "$color3"
258
+ },
259
+ onPress: disabled ? void 0 : onPress,
260
+ opacity: disabled ? 0.5 : 1,
261
+ children: [/* @__PURE__ */jsx(Text, {
262
+ fontSize: "$4",
263
+ lineHeight: 25,
264
+ color: "$color12",
265
+ children: label
266
+ }), description ? /* @__PURE__ */jsx(Text, {
267
+ fontSize: "$3",
268
+ lineHeight: 24,
269
+ color: formCommonColors.muted,
270
+ children: description
271
+ }) : null]
272
+ });
273
+ }
274
+ function StatusRow({
275
+ children,
276
+ testID
277
+ }) {
278
+ return /* @__PURE__ */jsx(XStack, {
279
+ testID,
280
+ minHeight: 44,
281
+ alignItems: "center",
282
+ paddingHorizontal: "$3",
283
+ role: "status",
284
+ children: /* @__PURE__ */jsx(Text, {
285
+ fontSize: "$4",
286
+ lineHeight: 25,
287
+ color: formCommonColors.muted,
288
+ children
289
+ })
290
+ });
291
+ }
292
+ function SearchResultsList({
293
+ listId,
294
+ status,
295
+ query,
296
+ results,
297
+ pair,
298
+ onLocate,
299
+ onPick,
300
+ onPickPair,
301
+ locateDisabled
302
+ }) {
303
+ const showLocate = status === "idle" || status === "results" || pair != null;
304
+ return /* @__PURE__ */jsxs(YStack, {
305
+ testID: "geolocation-results",
306
+ id: listId,
307
+ overflow: "hidden",
308
+ ...(isWeb ?
309
+ // role="listbox" is a valid ARIA role but outside RN's `Role` union;
310
+ // this web-only bag forwards it to the DOM node (house Record cast).
311
+ {
312
+ role: "listbox"
313
+ } : void 0),
314
+ children: [showLocate ? /* @__PURE__ */jsx(ResultRow, {
315
+ testID: "geolocation-use-location",
316
+ label: t("Use my current location"),
317
+ onPress: onLocate,
318
+ disabled: locateDisabled
319
+ }) : null, status === "searching" ? /* @__PURE__ */jsx(StatusRow, {
320
+ testID: "geolocation-search-status",
321
+ children: t("Searching\u2026")
322
+ }) : null, status === "error" ? /* @__PURE__ */jsx(StatusRow, {
323
+ testID: "geolocation-search-status",
324
+ children: t("Search is unavailable \u2014 check your connection")
325
+ }) : null, status === "empty" && !pair ? /* @__PURE__ */jsx(StatusRow, {
326
+ testID: "geolocation-search-status",
327
+ children: t('No places match "{{query}}"', {
328
+ query
329
+ })
330
+ }) : null, pair ? /* @__PURE__ */jsx(ResultRow, {
331
+ testID: "geolocation-coord-result",
332
+ label: t("Go to {{pair}}", {
333
+ pair: formatCoordPair(pair.lat, pair.lng)
334
+ }),
335
+ description: t("Exact coordinates \u2014 no address"),
336
+ onPress: () => onPickPair(pair.lat, pair.lng)
337
+ }) : null, status === "results" ? results.map((result, index) => /* @__PURE__ */jsx(ResultRow, {
338
+ testID: `geolocation-result-${index}`,
339
+ label: result.label,
340
+ description: result.description,
341
+ onPress: () => onPick(result)
342
+ }, `${result.lat},${result.lng},${index}`)) : null]
343
+ });
344
+ }
215
345
  function GeoMapSurface({
216
346
  id,
217
347
  coordinates,
@@ -251,7 +381,7 @@ function GeoMapSurface({
251
381
  };
252
382
  const handleMapKeyDown = event => {
253
383
  if (!interactive) return;
254
- if (event.key === "Enter") {
384
+ if (event.key === "Enter" && hasValue) {
255
385
  event.preventDefault();
256
386
  setCoordsOpen(true);
257
387
  return;
@@ -271,7 +401,68 @@ function GeoMapSurface({
271
401
  disabled,
272
402
  knobProps
273
403
  }) : null;
274
- return /* @__PURE__ */jsxs(Fragment, {
404
+ const coordLine = readOnly || disabled ? /* @__PURE__ */jsx(XStack, {
405
+ testID: "geolocation-coordline",
406
+ alignItems: "center",
407
+ minHeight: COORD_LINE_HEIGHT,
408
+ paddingHorizontal: "$2",
409
+ hitSlop: pressTargetHitSlop(COORD_LINE_HEIGHT),
410
+ children: /* @__PURE__ */jsx(Text, {
411
+ fontFamily: "$mono",
412
+ fontSize: 12,
413
+ lineHeight: 22,
414
+ color: formCommonColors.muted,
415
+ children: hasValue ? formatCoordPair(mapLat, mapLng) : t("Enter coordinates")
416
+ })
417
+ }) : /* @__PURE__ */jsx(FloatingPanel, {
418
+ open: coordsOpen,
419
+ onOpenChange: handleCoordsOpenChange,
420
+ disabled,
421
+ fitContent: false,
422
+ sizing: "fill",
423
+ contentPadding: "none",
424
+ trigger: /* @__PURE__ */jsx(XStack, {
425
+ testID: "geolocation-coordline",
426
+ alignItems: "center",
427
+ minHeight: COORD_LINE_HEIGHT,
428
+ paddingHorizontal: "$2",
429
+ cursor: "pointer",
430
+ ...pressSlopProps(COORD_LINE_HEIGHT, true),
431
+ hoverStyle: {
432
+ backgroundColor: "$color3"
433
+ },
434
+ focusVisibleStyle: overlayFocusRing,
435
+ ...(isWeb ? {
436
+ tabIndex: 0,
437
+ role: "button",
438
+ "aria-label": t("Edit coordinates"),
439
+ onKeyDown: event => {
440
+ if (event.key === "Enter" || event.key === " ") {
441
+ event.preventDefault();
442
+ setCoordsOpen(true);
443
+ }
444
+ }
445
+ } : {}),
446
+ children: /* @__PURE__ */jsx(Text, {
447
+ fontFamily: "$mono",
448
+ fontSize: 12,
449
+ lineHeight: 22,
450
+ color: formCommonColors.muted,
451
+ children: hasValue ? formatCoordPair(mapLat, mapLng) : t("Enter coordinates")
452
+ })
453
+ }),
454
+ children: /* @__PURE__ */jsx(CoordinatesPanel, {
455
+ lat: mapLat,
456
+ lng: mapLng,
457
+ knobProps,
458
+ required,
459
+ hasError,
460
+ flushRef: coordsFlushRef,
461
+ onCommit: onCommitCoordinates
462
+ })
463
+ });
464
+ return /* @__PURE__ */jsxs(YStack, {
465
+ gap: "$2",
275
466
  children: [/* @__PURE__ */jsxs(YStack, {
276
467
  testID: "geolocation-map",
277
468
  id,
@@ -293,7 +484,7 @@ function GeoMapSurface({
293
484
  tabIndex: 0,
294
485
  role: "application",
295
486
  "aria-label": t("Location map"),
296
- "aria-valuetext": hasValue ? formatCoordChip(mapLat, mapLng) : t("No location set"),
487
+ "aria-valuetext": hasValue ? formatCoordPair(mapLat, mapLng) : t("No location set"),
297
488
  onKeyDown: handleMapKeyDown
298
489
  } : {}),
299
490
  children: [customMap ?? /* @__PURE__ */jsx(GeolocationMap, {
@@ -304,59 +495,34 @@ function GeoMapSurface({
304
495
  disabled,
305
496
  readOnly,
306
497
  hasValue
307
- }), readOnly ? /* @__PURE__ */jsx(View, {
498
+ }), !hasValue && !locateErrorOpen ? /* @__PURE__ */jsxs(YStack, {
499
+ testID: "geolocation-empty",
308
500
  position: "absolute",
309
- top: "$2",
310
- insetInlineStart: "$2",
501
+ top: 0,
502
+ right: 0,
503
+ bottom: 0,
504
+ left: 0,
311
505
  zIndex: 2,
312
- backgroundColor: "$background",
313
- opacity: 0.92,
314
- paddingHorizontal: "$2",
315
- paddingVertical: "$1",
316
- ...knobProps.borderRadius,
317
- children: /* @__PURE__ */jsx(Text, {
318
- testID: "geolocation-coords-chip",
319
- fontSize: "$1",
506
+ alignItems: "center",
507
+ justifyContent: "center",
508
+ gap: "$2",
509
+ pointerEvents: "box-none",
510
+ children: [/* @__PURE__ */jsx(Text, {
320
511
  ...knobProps.body,
321
512
  color: formCommonColors.muted,
322
- children: hasValue ? formatCoordChip(mapLat, mapLng) : t("No location set")
323
- })
324
- }) : /* @__PURE__ */jsx(View, {
325
- position: "absolute",
326
- top: "$2",
327
- insetInlineStart: "$2",
328
- zIndex: 2,
329
- children: /* @__PURE__ */jsx(FloatingPanel, {
330
- open: coordsOpen,
331
- onOpenChange: handleCoordsOpenChange,
332
- disabled,
333
- fitContent: true,
334
- sizing: "fill",
335
- contentPadding: "none",
336
- trigger: /* @__PURE__ */jsx(Button, {
337
- size: "$2",
338
- disabled,
339
- backgroundColor: "$background",
340
- opacity: 0.92,
341
- testID: "geolocation-coords-chip",
342
- "aria-label": t("Edit coordinates"),
343
- focusVisibleStyle: overlayFocusRing,
344
- onPress: isWeb && !disabled ? () => setCoordsOpen(true) : void 0,
345
- children: /* @__PURE__ */jsx(Button.Text, {
346
- children: hasValue ? formatCoordChip(mapLat, mapLng) : t("Set location")
347
- })
348
- }),
349
- children: /* @__PURE__ */jsx(CoordinatesPanel, {
350
- lat: mapLat,
351
- lng: mapLng,
352
- knobProps,
353
- required,
354
- hasError,
355
- flushRef: coordsFlushRef,
356
- onCommit: onCommitCoordinates
513
+ pointerEvents: "none",
514
+ children: t("No location set")
515
+ }), !readOnly && !disabled ? /* @__PURE__ */jsx(Button, {
516
+ size: "$4",
517
+ onPress: onUseMyLocation,
518
+ disabled: locating,
519
+ testID: "geolocation-empty-locate",
520
+ "aria-label": t("Use my current location"),
521
+ children: /* @__PURE__ */jsx(Button.Text, {
522
+ children: t("Use my current location")
357
523
  })
358
- })
359
- }), handleExpand && expandIcon && /* @__PURE__ */jsx(View, {
524
+ }) : null]
525
+ }) : null, handleExpand && expandIcon && /* @__PURE__ */jsx(View, {
360
526
  position: "absolute",
361
527
  top: "$2",
362
528
  insetInlineEnd: "$2",
@@ -367,9 +533,9 @@ function GeoMapSurface({
367
533
  disabled,
368
534
  onPress: handleExpand,
369
535
  backgroundColor: "$background",
370
- opacity: 0.92,
371
536
  "aria-label": t("Expand map"),
372
537
  focusVisibleStyle: overlayFocusRing,
538
+ hitSlop: pressTargetHitSlop(32),
373
539
  children: expandIcon
374
540
  })
375
541
  }), !readOnly && !locateErrorOpen && /* @__PURE__ */jsx(View, {
@@ -383,12 +549,12 @@ function GeoMapSurface({
383
549
  disabled: disabled || locating,
384
550
  onPress: onUseMyLocation,
385
551
  backgroundColor: "$background",
386
- opacity: 0.92,
387
552
  icon: locating ? /* @__PURE__ */jsx(Spinner, {
388
553
  size: "small"
389
554
  }) : locationIcon,
390
555
  "aria-label": locating ? t("Locating") : t("Locate"),
391
- focusVisibleStyle: overlayFocusRing
556
+ focusVisibleStyle: overlayFocusRing,
557
+ hitSlop: pressTargetHitSlop(32)
392
558
  })
393
559
  }), locateErrorOpen && /* @__PURE__ */jsxs(YStack, {
394
560
  testID: "geolocation-locate-panel",
@@ -423,7 +589,7 @@ function GeoMapSurface({
423
589
  })]
424
590
  })]
425
591
  })]
426
- }), expandIcon && /* @__PURE__ */jsx(AdaptivePopup, {
592
+ }), coordLine, expandIcon && /* @__PURE__ */jsx(AdaptivePopup, {
427
593
  open: expanded,
428
594
  onOpenChange: setExpanded,
429
595
  title: t("Select Location"),
@@ -439,9 +605,45 @@ function GeoMapSurface({
439
605
  })]
440
606
  });
441
607
  }
442
- const defaultLocationIcon = /* @__PURE__ */jsx(NavigationArrowIcon, {
443
- size: 16
444
- });
608
+ function CellFace({
609
+ address,
610
+ coordinates,
611
+ onOpen
612
+ }) {
613
+ const glyphColor = useGlyphColor();
614
+ const text = address ? address : coordinates ? formatCoordPair(coordinates.lat, coordinates.lng) : t("No location set");
615
+ return /* @__PURE__ */jsxs(XStack, {
616
+ testID: "geolocation-cell-face",
617
+ ...(isWeb && onOpen ? {
618
+ tabIndex: 0,
619
+ role: "button",
620
+ "aria-label": t("Edit location"),
621
+ onKeyDown: event => {
622
+ if (event.key === "Enter" || event.key === " ") {
623
+ event.preventDefault();
624
+ onOpen();
625
+ }
626
+ }
627
+ } : {}),
628
+ alignItems: "center",
629
+ gap: "$2",
630
+ minHeight: 44,
631
+ minWidth: 0,
632
+ flex: 1,
633
+ children: [/* @__PURE__ */jsx(MapPinIcon, {
634
+ size: 14,
635
+ color: glyphColor
636
+ }), /* @__PURE__ */jsx(Text, {
637
+ fontSize: "$3",
638
+ lineHeight: 24,
639
+ color: "$color12",
640
+ numberOfLines: 1,
641
+ flex: 1,
642
+ minWidth: 0,
643
+ children: text
644
+ })]
645
+ });
646
+ }
445
647
  function Geolocation({
446
648
  name,
447
649
  form: formProp,
@@ -459,11 +661,14 @@ function Geolocation({
459
661
  onBlur,
460
662
  disabled,
461
663
  readOnly,
462
- locationIcon = defaultLocationIcon,
664
+ locationIcon,
463
665
  expandIcon,
464
666
  renderMap,
465
667
  skeleton,
466
- compact
668
+ compact,
669
+ geocode: geocodeProp,
670
+ reverseGeocode: reverseGeocodeProp,
671
+ geocoder
467
672
  }) {
468
673
  const {
469
674
  resolvedForm,
@@ -475,13 +680,81 @@ function Geolocation({
475
680
  compact
476
681
  });
477
682
  const resolvedValidators = useResolvedValidators(required, validators, label, name);
683
+ const glyphColor = useGlyphColor();
684
+ const resolvedLocationIcon = locationIcon === void 0 ? /* @__PURE__ */jsx(NavigationArrowIcon, {
685
+ size: 16,
686
+ color: glyphColor
687
+ }) : locationIcon;
688
+ const inTableCell = useIsInTableCell();
689
+ const viewportGtSm = useViewportGtSm();
690
+ const shouldUseSheet = !isWeb || !viewportGtSm;
691
+ const {
692
+ geocode,
693
+ reverseGeocode
694
+ } = resolveGeocoder({
695
+ geocode: geocodeProp,
696
+ reverseGeocode: reverseGeocodeProp,
697
+ geocoder
698
+ });
699
+ const searchEnabled = Boolean(geocode) && !disabled && !readOnly;
700
+ const listId = useId();
478
701
  const [locatePhase, setLocatePhase] = useState("idle");
479
702
  const [locateError, setLocateError] = useState(null);
480
703
  const [preflightError, setPreflightError] = useState();
704
+ const [address, setAddress] = useState(null);
705
+ const [query, setQuery] = useState("");
706
+ const [resultsOpen, setResultsOpen] = useState(false);
707
+ const [searchStatus, setSearchStatus] = useState("idle");
708
+ const [results, setResults] = useState([]);
709
+ const [cellOpen, setCellOpen] = useState(false);
481
710
  const preflightingRef = useRef(false);
482
711
  const onValueChangeRef = useRef(() => {});
483
712
  const currentValueRef = useRef("");
713
+ const searchGenRef = useRef(0);
714
+ const reverseGenRef = useRef(0);
715
+ const searchRootRef = useRef(null);
716
+ const searchInputRef = useRef(null);
717
+ const sheetSearchInputRef = useRef(null);
718
+ const closingSearchRef = useRef(false);
719
+ const [nativeSearchFocus] = useState(createNativeSearchFocus);
720
+ const skipResultsReturnFocusRef = useRef(true);
721
+ const closeSearch = useCallback((restoreFocus = true) => {
722
+ if (!isWeb) nativeSearchFocus.dismiss();
723
+ closingSearchRef.current = true;
724
+ setResultsOpen(false);
725
+ if (isWeb && restoreFocus) searchInputRef.current?.focus({
726
+ preventScroll: true
727
+ });
728
+ closingSearchRef.current = false;
729
+ }, [nativeSearchFocus]);
730
+ const queryIsAddressRef = useRef(true);
731
+ const selectedPlaceRef = useRef(null);
732
+ const locateGenRef = useRef(0);
733
+ const interactiveRef = useRef(!disabled && !readOnly);
734
+ interactiveRef.current = !disabled && !readOnly;
735
+ const cancelLocate = useCallback(() => {
736
+ ++locateGenRef.current;
737
+ setLocatePhase("idle");
738
+ setLocateError(null);
739
+ }, []);
740
+ useEffect(() => {
741
+ if (disabled || readOnly) cancelLocate();
742
+ }, [disabled, readOnly, cancelLocate]);
743
+ useEffect(() => () => {
744
+ ++locateGenRef.current;
745
+ ++reverseGenRef.current;
746
+ ++searchGenRef.current;
747
+ }, []);
748
+ const applyAddress = useCallback((next, intoQuery) => {
749
+ setAddress(next);
750
+ if (intoQuery) {
751
+ queryIsAddressRef.current = true;
752
+ setQuery(next?.label ?? "");
753
+ }
754
+ }, []);
484
755
  const requestPosition = useCallback(() => {
756
+ if (!interactiveRef.current) return;
757
+ const gen = ++locateGenRef.current;
485
758
  if (!navigator?.geolocation) {
486
759
  setLocateError(t("Geolocation unavailable: not supported in this browser."));
487
760
  setLocatePhase("error");
@@ -490,6 +763,9 @@ function Geolocation({
490
763
  setLocatePhase("locating");
491
764
  setLocateError(null);
492
765
  navigator.geolocation.getCurrentPosition(position => {
766
+ if (gen !== locateGenRef.current || !interactiveRef.current) return;
767
+ selectedPlaceRef.current = null;
768
+ queryIsAddressRef.current = true;
493
769
  const lat = clampLat(position.coords.latitude);
494
770
  const lng = clampLng(position.coords.longitude);
495
771
  const previous = currentValueRef.current;
@@ -499,20 +775,25 @@ function Geolocation({
499
775
  }, detectGeoShape(previous), previous));
500
776
  setLocatePhase("idle");
501
777
  setLocateError(null);
778
+ closeSearch();
779
+ setCellOpen(false);
502
780
  }, err => {
781
+ if (gen !== locateGenRef.current || !interactiveRef.current) return;
503
782
  setLocateError(mapGeolocationError(err));
504
783
  setLocatePhase("error");
505
784
  }, {
506
785
  enableHighAccuracy: true,
507
786
  timeout: 1e4
508
787
  });
509
- }, []);
788
+ }, [closeSearch]);
510
789
  const startLocate = useCallback(async () => {
511
790
  if (disabled || readOnly) return;
512
791
  if (preflightingRef.current || locatePhase === "locating") return;
513
792
  preflightingRef.current = true;
793
+ const gen = ++locateGenRef.current;
514
794
  try {
515
795
  const result = await preflightGeolocation();
796
+ if (gen !== locateGenRef.current || !interactiveRef.current) return;
516
797
  if (result.ok) {
517
798
  setPreflightError(void 0);
518
799
  requestPosition();
@@ -525,12 +806,108 @@ function Geolocation({
525
806
  preflightingRef.current = false;
526
807
  }
527
808
  }, [disabled, readOnly, locatePhase, requestPosition]);
809
+ const runReverse = useCallback(async (lat, lng) => {
810
+ const gen = ++reverseGenRef.current;
811
+ if (lat === void 0 || lng === void 0) {
812
+ selectedPlaceRef.current = null;
813
+ applyAddress(null, queryIsAddressRef.current);
814
+ return;
815
+ }
816
+ const key = coordinateKey({
817
+ lat,
818
+ lng
819
+ });
820
+ const selected = selectedPlaceRef.current;
821
+ if (selected?.key === key) {
822
+ applyAddress({
823
+ key,
824
+ label: formatPlace(selected.place)
825
+ }, queryIsAddressRef.current);
826
+ return;
827
+ }
828
+ applyAddress(null, queryIsAddressRef.current);
829
+ if (!reverseGeocode) {
830
+ return;
831
+ }
832
+ try {
833
+ const result = await reverseGeocode({
834
+ lat,
835
+ lng
836
+ });
837
+ if (gen !== reverseGenRef.current) return;
838
+ applyAddress(result ? {
839
+ key,
840
+ label: formatPlace(result)
841
+ } : null, queryIsAddressRef.current);
842
+ } catch {
843
+ if (gen !== reverseGenRef.current) return;
844
+ applyAddress(null, queryIsAddressRef.current);
845
+ }
846
+ }, [reverseGeocode, applyAddress]);
847
+ const runSearch = useCallback(async text => {
848
+ if (!geocode) return;
849
+ const gen = ++searchGenRef.current;
850
+ setSearchStatus("searching");
851
+ try {
852
+ const next = await geocode({
853
+ query: text
854
+ });
855
+ if (gen !== searchGenRef.current) return;
856
+ setResults(next);
857
+ setSearchStatus(next.length > 0 ? "results" : "empty");
858
+ } catch {
859
+ if (gen !== searchGenRef.current) return;
860
+ setResults([]);
861
+ setSearchStatus("error");
862
+ }
863
+ }, [geocode]);
864
+ useEffect(() => {
865
+ ++searchGenRef.current;
866
+ if (!searchEnabled || !resultsOpen) return;
867
+ const trimmed = query.trim();
868
+ if (queryIsAddressRef.current) return;
869
+ if (!trimmed) {
870
+ setSearchStatus("idle");
871
+ setResults([]);
872
+ return;
873
+ }
874
+ if (parseLatLngPair(trimmed)) {
875
+ setSearchStatus("idle");
876
+ setResults([]);
877
+ return;
878
+ }
879
+ const handle = setTimeout(() => {
880
+ void runSearch(trimmed);
881
+ }, SEARCH_DEBOUNCE_MS);
882
+ return () => {
883
+ clearTimeout(handle);
884
+ ++searchGenRef.current;
885
+ };
886
+ }, [query, resultsOpen, searchEnabled, runSearch]);
887
+ useEffect(() => {
888
+ if (!resultsOpen || shouldUseSheet) return;
889
+ const onDoc = event => {
890
+ const root = searchRootRef.current;
891
+ if (root && event.target instanceof Node && root.contains(event.target)) return;
892
+ closeSearch(false);
893
+ };
894
+ const onKey = event => {
895
+ if (event.key === "Escape") closeSearch();
896
+ };
897
+ document.addEventListener("mousedown", onDoc);
898
+ document.addEventListener("keydown", onKey);
899
+ return () => {
900
+ document.removeEventListener("mousedown", onDoc);
901
+ document.removeEventListener("keydown", onKey);
902
+ };
903
+ }, [resultsOpen, shouldUseSheet, closeSearch]);
528
904
  const makeHandlers = useCallback((currentValue, onValueChange) => {
529
905
  onValueChangeRef.current = onValueChange;
530
906
  currentValueRef.current = currentValue;
531
907
  const coordinates = parseGeoValue(currentValue);
532
908
  const shape = detectGeoShape(currentValue);
533
909
  const write = (lat, lng) => {
910
+ cancelLocate();
534
911
  onValueChange(formatGeoValue({
535
912
  lat: clampLat(lat),
536
913
  lng: clampLng(lng)
@@ -538,51 +915,294 @@ function Geolocation({
538
915
  };
539
916
  return {
540
917
  coordinates,
541
- onCommitCoordinates: write,
542
- onMapChange: write,
918
+ onCommitCoordinates: (lat, lng) => {
919
+ write(lat, lng);
920
+ selectedPlaceRef.current = null;
921
+ queryIsAddressRef.current = true;
922
+ },
923
+ onMapChange: (lat, lng) => {
924
+ write(lat, lng);
925
+ selectedPlaceRef.current = null;
926
+ queryIsAddressRef.current = true;
927
+ },
543
928
  onUseMyLocation: () => {
544
929
  void startLocate();
545
930
  },
546
931
  onRetryLocate: () => {
547
932
  requestPosition();
548
933
  },
549
- onCloseLocate: () => {
550
- setLocatePhase("idle");
551
- setLocateError(null);
934
+ onCloseLocate: cancelLocate,
935
+ onPick: result => {
936
+ ++reverseGenRef.current;
937
+ const place = {
938
+ ...result,
939
+ lat: clampLat(result.lat),
940
+ lng: clampLng(result.lng)
941
+ };
942
+ selectedPlaceRef.current = {
943
+ key: coordinateKey(place),
944
+ place
945
+ };
946
+ write(result.lat, result.lng);
947
+ queryIsAddressRef.current = true;
948
+ setQuery(formatPlace(result));
949
+ closeSearch();
950
+ setCellOpen(false);
951
+ setSearchStatus("idle");
952
+ },
953
+ onPickPair: (lat, lng) => {
954
+ write(lat, lng);
955
+ selectedPlaceRef.current = null;
956
+ queryIsAddressRef.current = true;
957
+ closeSearch();
958
+ setCellOpen(false);
959
+ setSearchStatus("idle");
960
+ },
961
+ onClear: () => {
962
+ cancelLocate();
963
+ ++searchGenRef.current;
964
+ ++reverseGenRef.current;
965
+ selectedPlaceRef.current = null;
966
+ onValueChange("");
967
+ applyAddress(null, true);
968
+ setQuery("");
969
+ setResults([]);
970
+ setSearchStatus("idle");
552
971
  }
553
972
  };
554
- }, [startLocate, requestPosition]);
973
+ }, [startLocate, requestPosition, cancelLocate, applyAddress, closeSearch]);
555
974
  const mapHeight = getFieldHeight(size ?? knobProps.sizeToken, compact ? 4 : 5);
556
- if (skeleton) {
557
- return /* @__PURE__ */jsx(FieldLayout, {
558
- id,
559
- label,
560
- size,
561
- knobProps,
562
- children: /* @__PURE__ */jsx(Skeleton, {
563
- variant: "rounded",
564
- width: "100%",
565
- height: mapHeight
975
+ const displayError = error || preflightError;
976
+ const renderSearch = (handlers, opts = {}) => {
977
+ const showClear = Boolean(query) && !disabled && !readOnly;
978
+ const inputRef = opts.sheetHeader ? sheetSearchInputRef : searchInputRef;
979
+ const activateNativeSearch = (focusInput = false) => {
980
+ nativeSearchFocus.activate();
981
+ if (!searchEnabled || opts.editingCell) return;
982
+ const nativeInput = inputRef.current;
983
+ if (nativeInput?.isFocused?.()) setResultsOpen(true);else if (focusInput) nativeInput?.focus();
984
+ };
985
+ const clearSearch = () => {
986
+ handlers.onClear();
987
+ closingSearchRef.current = true;
988
+ if (isWeb) inputRef.current?.focus({
989
+ preventScroll: true
990
+ });
991
+ closingSearchRef.current = false;
992
+ };
993
+ return /* @__PURE__ */jsx(InputParts, {
994
+ size: size || knobProps.sizeToken,
995
+ children: /* @__PURE__ */jsxs(InputParts.Box, {
996
+ disabled: disabled || !searchEnabled,
997
+ style: {
998
+ overflow: "visible"
999
+ },
1000
+ ...(opts.sheetHeader ? {
1001
+ borderWidth: 0,
1002
+ borderBottomWidth: 1,
1003
+ borderRadius: 0
1004
+ } : {}),
1005
+ children: [/* @__PURE__ */jsx(InputParts.Section, {
1006
+ children: /* @__PURE__ */jsx(InputParts.Icon, {
1007
+ adornment: "leading",
1008
+ children: /* @__PURE__ */jsx(MagnifyingGlassIcon, {
1009
+ size: 16
1010
+ })
1011
+ })
1012
+ }), /* @__PURE__ */jsx(InputParts.Section, {
1013
+ children: /* @__PURE__ */jsx(InputParts.Area, {
1014
+ ref: inputRef,
1015
+ value: query,
1016
+ disabled: disabled || !searchEnabled,
1017
+ placeholder: t("Search address or place"),
1018
+ "aria-label": t("Search for a location"),
1019
+ role: "combobox",
1020
+ "aria-haspopup": "listbox",
1021
+ "aria-expanded": resultsOpen,
1022
+ "aria-controls": listId,
1023
+ "aria-autocomplete": "list",
1024
+ "data-testid": "geolocation-search",
1025
+ onChangeText: text => {
1026
+ if (!isWeb) nativeSearchFocus.activate();
1027
+ ++searchGenRef.current;
1028
+ queryIsAddressRef.current = false;
1029
+ setResults([]);
1030
+ setSearchStatus("idle");
1031
+ setQuery(text);
1032
+ if (searchEnabled) setResultsOpen(true);
1033
+ },
1034
+ onKeyDown: event => {
1035
+ if (event.key === "ArrowDown") {
1036
+ if (searchEnabled) setResultsOpen(true);
1037
+ event.preventDefault();
1038
+ document.getElementById(listId)?.querySelector("[role='option']:not([aria-disabled='true'])")?.focus();
1039
+ }
1040
+ },
1041
+ onClick: () => {
1042
+ if (searchEnabled) setResultsOpen(true);
1043
+ },
1044
+ ...(!isWeb ? {
1045
+ onPressIn: () => activateNativeSearch(),
1046
+ onAccessibilityTap: () => activateNativeSearch(true),
1047
+ onBlur: () => nativeSearchFocus.blur(!!opts.sheetHeader, resultsOpen)
1048
+ } : {}),
1049
+ onFocus: () => {
1050
+ if (searchEnabled && !opts.editingCell && !closingSearchRef.current && (isWeb || nativeSearchFocus.canOpen(!!opts.sheetHeader))) setResultsOpen(true);
1051
+ }
1052
+ })
1053
+ }), showClear ? /* @__PURE__ */jsx(InputParts.Section, {
1054
+ children: /* @__PURE__ */jsx(InputParts.Button, {
1055
+ glyphRing: true,
1056
+ onPress: clearSearch,
1057
+ onKeyDown: event => {
1058
+ if (event.key === "Enter" || event.key === " ") {
1059
+ event.preventDefault();
1060
+ event.stopPropagation();
1061
+ clearSearch();
1062
+ }
1063
+ },
1064
+ "aria-label": t("Clear location"),
1065
+ testID: "geolocation-search-clear",
1066
+ children: /* @__PURE__ */jsx(InputParts.Icon, {
1067
+ children: /* @__PURE__ */jsx(XIcon, {
1068
+ size: 14
1069
+ })
1070
+ })
1071
+ })
1072
+ }) : null]
566
1073
  })
567
1074
  });
568
- }
569
- const displayError = error || preflightError;
570
- if (!resolvedForm || !name) {
571
- const handlers = makeHandlers(value || "", v => onChange?.(v));
572
- return /* @__PURE__ */jsx(FieldLayout, {
573
- id,
574
- label,
575
- labelProps,
576
- error: displayError,
577
- helperText,
578
- required,
579
- size,
580
- knobProps,
581
- onBlur,
582
- disabled,
583
- children: /* @__PURE__ */jsx(GeoMapSurface, {
1075
+ };
1076
+ const renderResults = handlers => /* @__PURE__ */jsx(SearchResultsList, {
1077
+ listId,
1078
+ status: searchStatus,
1079
+ query: query.trim(),
1080
+ results,
1081
+ pair: parseLatLngPair(query),
1082
+ onLocate: handlers.onUseMyLocation,
1083
+ onPick: handlers.onPick,
1084
+ onPickPair: handlers.onPickPair,
1085
+ locateDisabled: disabled || locatePhase === "locating"
1086
+ });
1087
+ const renderFormBody = (currentValue, onValueChange, editingCell = false, resolvedError = displayError) => {
1088
+ const handlers = makeHandlers(currentValue, onValueChange);
1089
+ const coordinates = handlers.coordinates;
1090
+ const key = coordinates ? coordinateKey(coordinates) : null;
1091
+ const selected = selectedPlaceRef.current;
1092
+ const displayAddress = (selected?.key === key ? formatPlace(selected.place) : null) ?? (address?.key === key ? address.label : null) ?? (coordinates ? formatCoordPair(coordinates.lat, coordinates.lng) : null);
1093
+ if (inTableCell && !editingCell) {
1094
+ const face = /* @__PURE__ */jsx(CellFace, {
1095
+ address: displayAddress,
1096
+ coordinates,
1097
+ onOpen: !disabled && !readOnly ? () => setCellOpen(true) : void 0
1098
+ });
1099
+ if (readOnly || disabled) return face;
1100
+ return /* @__PURE__ */jsx(FloatingPanel, {
1101
+ open: cellOpen,
1102
+ onOpenChange: setCellOpen,
1103
+ disabled,
1104
+ fitContent: false,
1105
+ contentPadding: "none",
1106
+ trigger: face,
1107
+ children: /* @__PURE__ */jsx(YStack, {
1108
+ minWidth: 260,
1109
+ maxWidth: 420,
1110
+ children: renderFormBody(currentValue, onValueChange, true, resolvedError)
1111
+ })
1112
+ });
1113
+ }
1114
+ if (readOnly) {
1115
+ return /* @__PURE__ */jsxs(YStack, {
1116
+ gap: "$2",
1117
+ children: [/* @__PURE__ */jsxs(XStack, {
1118
+ testID: "geolocation-readonly-address",
1119
+ alignItems: "center",
1120
+ gap: "$2",
1121
+ minHeight: 25,
1122
+ children: [/* @__PURE__ */jsx(MapPinIcon, {
1123
+ size: 14,
1124
+ color: glyphColor
1125
+ }), /* @__PURE__ */jsx(Text, {
1126
+ fontSize: "$4",
1127
+ lineHeight: 25,
1128
+ color: "$color12",
1129
+ children: displayAddress ?? t("No location set")
1130
+ })]
1131
+ }), /* @__PURE__ */jsx(GeoMapSurface, {
1132
+ id,
1133
+ coordinates,
1134
+ onCommitCoordinates: handlers.onCommitCoordinates,
1135
+ onUseMyLocation: handlers.onUseMyLocation,
1136
+ onRetryLocate: handlers.onRetryLocate,
1137
+ onCloseLocate: handlers.onCloseLocate,
1138
+ onMapChange: handlers.onMapChange,
1139
+ disabled: !!disabled,
1140
+ readOnly: true,
1141
+ locatePhase,
1142
+ locateError,
1143
+ knobProps,
1144
+ locationIcon: resolvedLocationIcon,
1145
+ expandIcon,
1146
+ renderMap,
1147
+ required,
1148
+ hasError: !!resolvedError,
1149
+ mapHeight
1150
+ })]
1151
+ });
1152
+ }
1153
+ const resultsPanel = resultsOpen && searchEnabled ? shouldUseSheet ? /* @__PURE__ */jsx(FloatingPanel, {
1154
+ open: resultsOpen,
1155
+ onOpenChange: open => open ? setResultsOpen(true) : closeSearch(),
1156
+ onNativeShow: () => sheetSearchInputRef.current?.focus(),
1157
+ skipReturnFocusRef: skipResultsReturnFocusRef,
1158
+ sheet: true,
1159
+ sheetFill: true,
1160
+ scrollable: true,
1161
+ contentPadding: "none",
1162
+ header: renderSearch(handlers, {
1163
+ sheetHeader: true
1164
+ }),
1165
+ trigger: /* @__PURE__ */jsx(View, {
1166
+ testID: "geolocation-sheet-trigger",
1167
+ height: 1,
1168
+ width: "100%"
1169
+ }),
1170
+ children: /* @__PURE__ */jsx(YStack, {
1171
+ testID: "geolocation-results-sheet",
1172
+ children: renderResults(handlers)
1173
+ })
1174
+ }) : /* @__PURE__ */jsx(YStack, {
1175
+ position: "absolute",
1176
+ top: "100%",
1177
+ left: 0,
1178
+ right: 0,
1179
+ zIndex: zIndex.dropdown,
1180
+ backgroundColor: "$color1",
1181
+ borderWidth: 1,
1182
+ borderColor: formInputColors.border.base,
1183
+ borderRadius: knobProps.borderRadius.borderRadius,
1184
+ overflow: "hidden",
1185
+ style: {
1186
+ boxShadow: RESULTS_PANEL_SHADOW
1187
+ },
1188
+ children: /* @__PURE__ */jsx(ScrollView, {
1189
+ maxHeight: mapHeight * 1.5,
1190
+ children: renderResults(handlers)
1191
+ })
1192
+ }) : null;
1193
+ return /* @__PURE__ */jsxs(YStack, {
1194
+ gap: "$2",
1195
+ children: [/* @__PURE__ */jsxs(YStack, {
1196
+ ref: searchRootRef,
1197
+ position: "relative",
1198
+ testID: "geolocation-search-anchor",
1199
+ "data-sheet": shouldUseSheet ? "true" : "false",
1200
+ children: [renderSearch(handlers, {
1201
+ editingCell
1202
+ }), resultsPanel]
1203
+ }), /* @__PURE__ */jsx(GeoMapSurface, {
584
1204
  id,
585
- coordinates: handlers.coordinates,
1205
+ coordinates,
586
1206
  onCommitCoordinates: handlers.onCommitCoordinates,
587
1207
  onUseMyLocation: handlers.onUseMyLocation,
588
1208
  onRetryLocate: handlers.onRetryLocate,
@@ -593,15 +1213,58 @@ function Geolocation({
593
1213
  locatePhase,
594
1214
  locateError,
595
1215
  knobProps,
596
- locationIcon,
1216
+ locationIcon: resolvedLocationIcon,
597
1217
  expandIcon,
598
1218
  renderMap,
599
1219
  required,
600
- hasError: !!displayError,
1220
+ hasError: !!resolvedError,
601
1221
  mapHeight
1222
+ })]
1223
+ });
1224
+ };
1225
+ if (skeleton) {
1226
+ return /* @__PURE__ */jsx(FieldLayout, {
1227
+ id,
1228
+ label,
1229
+ size,
1230
+ knobProps,
1231
+ children: /* @__PURE__ */jsxs(YStack, {
1232
+ gap: "$2",
1233
+ children: [/* @__PURE__ */jsx(Skeleton, {
1234
+ variant: "rounded",
1235
+ width: "100%",
1236
+ height: 44
1237
+ }), /* @__PURE__ */jsx(Skeleton, {
1238
+ variant: "rounded",
1239
+ width: "100%",
1240
+ height: mapHeight
1241
+ })]
602
1242
  })
603
1243
  });
604
1244
  }
1245
+ const wrap = (currentValue, onValueChange, resolvedError, fieldBlur) => {
1246
+ const coordinates = parseGeoValue(currentValue);
1247
+ const taughtHelper = helperText ?? (!coordinates && !readOnly ? t("Search, tap the map, or use your location.") : void 0);
1248
+ return /* @__PURE__ */jsxs(FieldLayout, {
1249
+ id,
1250
+ label,
1251
+ labelProps,
1252
+ error: resolvedError ?? displayError,
1253
+ helperText: inTableCell ? void 0 : taughtHelper,
1254
+ required,
1255
+ size,
1256
+ knobProps,
1257
+ onBlur: fieldBlur ?? onBlur,
1258
+ disabled,
1259
+ children: [/* @__PURE__ */jsx(GeolocationValueSync, {
1260
+ value: currentValue,
1261
+ runReverse
1262
+ }), renderFormBody(currentValue, onValueChange, false, resolvedError)]
1263
+ });
1264
+ };
1265
+ if (!resolvedForm || !name) {
1266
+ return wrap(value || "", v => onChange?.(v));
1267
+ }
605
1268
  return /* @__PURE__ */jsx(Field, {
606
1269
  form: resolvedForm,
607
1270
  name,
@@ -609,44 +1272,24 @@ function Geolocation({
609
1272
  validators: resolvedValidators,
610
1273
  children: field => {
611
1274
  const resolvedError = getFieldError(field, displayError);
612
- const handlers = makeHandlers(field.state.value || "", v => {
1275
+ return wrap(field.state.value || "", v => {
613
1276
  field.handleChange(v);
614
1277
  onChange?.(v);
615
- });
616
- return /* @__PURE__ */jsx(FieldLayout, {
617
- id,
618
- label,
619
- labelProps,
620
- error: resolvedError,
621
- helperText,
622
- required,
623
- size,
624
- knobProps,
625
- onBlur: mergeFieldHandler(field, "handleBlur", onBlur),
626
- disabled,
627
- children: /* @__PURE__ */jsx(GeoMapSurface, {
628
- id,
629
- coordinates: handlers.coordinates,
630
- onCommitCoordinates: handlers.onCommitCoordinates,
631
- onUseMyLocation: handlers.onUseMyLocation,
632
- onRetryLocate: handlers.onRetryLocate,
633
- onCloseLocate: handlers.onCloseLocate,
634
- onMapChange: handlers.onMapChange,
635
- disabled: !!disabled,
636
- readOnly: !!readOnly,
637
- locatePhase,
638
- locateError,
639
- knobProps,
640
- locationIcon,
641
- expandIcon,
642
- renderMap,
643
- required,
644
- hasError: !!resolvedError,
645
- mapHeight
646
- })
647
- });
1278
+ }, resolvedError, mergeFieldHandler(field, "handleBlur", onBlur));
648
1279
  }
649
1280
  });
650
1281
  }
651
- export { Geolocation, preflightGeolocation };
1282
+ function GeolocationValueSync({
1283
+ value,
1284
+ runReverse
1285
+ }) {
1286
+ const coords = parseGeoValue(value);
1287
+ const key = coords ? coordinateKey(coords) : "";
1288
+ useEffect(() => {
1289
+ const next = parseGeoValue(value);
1290
+ void runReverse(next?.lat, next?.lng);
1291
+ }, [key, value, runReverse]);
1292
+ return null;
1293
+ }
1294
+ export { Geolocation, clampLat2 as clampLat, clampLng2 as clampLng, formatCoordPair2 as formatCoordPair, formatPlace2 as formatPlace, parseLatLngPair2 as parseLatLngPair, preflightGeolocation, resolveGeocoder2 as resolveGeocoder };
652
1295
  //# sourceMappingURL=index.mjs.map