@pega/cosmos-react-core 8.8.0 → 9.0.0-build.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 (615) hide show
  1. package/lib/components/AppShell/AppHeader.d.ts.map +1 -1
  2. package/lib/components/AppShell/AppHeader.js +4 -1
  3. package/lib/components/AppShell/AppHeader.js.map +1 -1
  4. package/lib/components/AppShell/NavigationListItemWrapper.d.ts.map +1 -1
  5. package/lib/components/AppShell/NavigationListItemWrapper.js +3 -4
  6. package/lib/components/AppShell/NavigationListItemWrapper.js.map +1 -1
  7. package/lib/components/AppShell/ThemeSwitcher.d.ts +9 -0
  8. package/lib/components/AppShell/ThemeSwitcher.d.ts.map +1 -0
  9. package/lib/components/AppShell/ThemeSwitcher.js +58 -0
  10. package/lib/components/AppShell/ThemeSwitcher.js.map +1 -0
  11. package/lib/components/AppShell/ThemeSwitcher.test-ids.d.ts +2 -0
  12. package/lib/components/AppShell/ThemeSwitcher.test-ids.d.ts.map +1 -0
  13. package/lib/components/AppShell/ThemeSwitcher.test-ids.js +3 -0
  14. package/lib/components/AppShell/ThemeSwitcher.test-ids.js.map +1 -0
  15. package/lib/components/Avatar/Avatar.d.ts.map +1 -1
  16. package/lib/components/Avatar/Avatar.js +10 -4
  17. package/lib/components/Avatar/Avatar.js.map +1 -1
  18. package/lib/components/Banner/Banner.js +1 -1
  19. package/lib/components/Banner/Banner.js.map +1 -1
  20. package/lib/components/ComboBox/ComboBox.d.ts.map +1 -1
  21. package/lib/components/ComboBox/ComboBox.js +9 -4
  22. package/lib/components/ComboBox/ComboBox.js.map +1 -1
  23. package/lib/components/ComboBox/ComboBox.types.d.ts +5 -0
  24. package/lib/components/ComboBox/ComboBox.types.d.ts.map +1 -1
  25. package/lib/components/ComboBox/ComboBox.types.js.map +1 -1
  26. package/lib/components/CompositeInput/CompositeInput.d.ts.map +1 -1
  27. package/lib/components/CompositeInput/CompositeInput.js +6 -10
  28. package/lib/components/CompositeInput/CompositeInput.js.map +1 -1
  29. package/lib/components/Configuration/Configuration.d.ts +6 -0
  30. package/lib/components/Configuration/Configuration.d.ts.map +1 -1
  31. package/lib/components/Configuration/Configuration.js +5 -1
  32. package/lib/components/Configuration/Configuration.js.map +1 -1
  33. package/lib/components/CreditCard/CreditCardInput.d.ts +1 -1
  34. package/lib/components/CreditCard/CreditCardInput.js +1 -1
  35. package/lib/components/CreditCard/CreditCardInput.js.map +1 -1
  36. package/lib/components/Currency/CurrencyInput.d.ts.map +1 -1
  37. package/lib/components/Currency/CurrencyInput.js +2 -2
  38. package/lib/components/Currency/CurrencyInput.js.map +1 -1
  39. package/lib/components/DateTime/Input/DateInput.d.ts.map +1 -1
  40. package/lib/components/DateTime/Input/DateInput.js +3 -3
  41. package/lib/components/DateTime/Input/DateInput.js.map +1 -1
  42. package/lib/components/DateTime/Input/DateRangeInput.d.ts.map +1 -1
  43. package/lib/components/DateTime/Input/DateRangeInput.js +1 -1
  44. package/lib/components/DateTime/Input/DateRangeInput.js.map +1 -1
  45. package/lib/components/DateTime/Input/DateTime.styles.d.ts.map +1 -1
  46. package/lib/components/DateTime/Input/DateTime.styles.js +0 -4
  47. package/lib/components/DateTime/Input/DateTime.styles.js.map +1 -1
  48. package/lib/components/DateTime/Input/DateTimeInput.d.ts.map +1 -1
  49. package/lib/components/DateTime/Input/DateTimeInput.js +17 -2
  50. package/lib/components/DateTime/Input/DateTimeInput.js.map +1 -1
  51. package/lib/components/DateTime/Input/Duration/DurationInput.d.ts.map +1 -1
  52. package/lib/components/DateTime/Input/Duration/DurationInput.js +3 -1
  53. package/lib/components/DateTime/Input/Duration/DurationInput.js.map +1 -1
  54. package/lib/components/DateTime/Input/MonthInput.d.ts.map +1 -1
  55. package/lib/components/DateTime/Input/MonthInput.js +2 -2
  56. package/lib/components/DateTime/Input/MonthInput.js.map +1 -1
  57. package/lib/components/DateTime/Input/QuarterInput.d.ts.map +1 -1
  58. package/lib/components/DateTime/Input/QuarterInput.js +2 -2
  59. package/lib/components/DateTime/Input/QuarterInput.js.map +1 -1
  60. package/lib/components/DateTime/Input/TimeInput.d.ts.map +1 -1
  61. package/lib/components/DateTime/Input/TimeInput.js +2 -2
  62. package/lib/components/DateTime/Input/TimeInput.js.map +1 -1
  63. package/lib/components/DateTime/Input/TimeRangeInput.d.ts.map +1 -1
  64. package/lib/components/DateTime/Input/TimeRangeInput.js +1 -1
  65. package/lib/components/DateTime/Input/TimeRangeInput.js.map +1 -1
  66. package/lib/components/DateTime/Input/WeekInput.d.ts.map +1 -1
  67. package/lib/components/DateTime/Input/WeekInput.js +3 -3
  68. package/lib/components/DateTime/Input/WeekInput.js.map +1 -1
  69. package/lib/components/Dialog/Dialog.types.d.ts +4 -0
  70. package/lib/components/Dialog/Dialog.types.d.ts.map +1 -1
  71. package/lib/components/Dialog/Dialog.types.js.map +1 -1
  72. package/lib/components/Dialog/FormDialog.d.ts.map +1 -1
  73. package/lib/components/Dialog/FormDialog.js +7 -2
  74. package/lib/components/Dialog/FormDialog.js.map +1 -1
  75. package/lib/components/Dialog/InfoDialog.js +1 -1
  76. package/lib/components/Dialog/InfoDialog.js.map +1 -1
  77. package/lib/components/FieldGroup/FieldGroupList.d.ts.map +1 -1
  78. package/lib/components/FieldGroup/FieldGroupList.js +4 -2
  79. package/lib/components/FieldGroup/FieldGroupList.js.map +1 -1
  80. package/lib/components/FieldGroup/FieldGroupList.utils.d.ts +1 -1
  81. package/lib/components/FieldGroup/FieldGroupList.utils.js +2 -2
  82. package/lib/components/FieldGroup/FieldGroupList.utils.js.map +1 -1
  83. package/lib/components/FieldValueList/FieldValueList.d.ts.map +1 -1
  84. package/lib/components/FieldValueList/FieldValueList.js +8 -5
  85. package/lib/components/FieldValueList/FieldValueList.js.map +1 -1
  86. package/lib/components/File/FileInput.d.ts.map +1 -1
  87. package/lib/components/File/FileInput.js +2 -1
  88. package/lib/components/File/FileInput.js.map +1 -1
  89. package/lib/components/File/FileItem.d.ts.map +1 -1
  90. package/lib/components/File/FileItem.js +2 -2
  91. package/lib/components/File/FileItem.js.map +1 -1
  92. package/lib/components/FormField/FormField.d.ts.map +1 -1
  93. package/lib/components/FormField/FormField.js +3 -2
  94. package/lib/components/FormField/FormField.js.map +1 -1
  95. package/lib/components/Fullscreen/Fullscreen.d.ts.map +1 -1
  96. package/lib/components/Fullscreen/Fullscreen.js +1 -0
  97. package/lib/components/Fullscreen/Fullscreen.js.map +1 -1
  98. package/lib/components/Icon/Icon.d.ts.map +1 -1
  99. package/lib/components/Icon/Icon.js +7 -6
  100. package/lib/components/Icon/Icon.js.map +1 -1
  101. package/lib/components/Icon/streamline-icons/archive-solid.icon.d.ts +5 -0
  102. package/lib/components/Icon/streamline-icons/archive-solid.icon.d.ts.map +1 -0
  103. package/lib/components/Icon/streamline-icons/archive-solid.icon.js +7 -0
  104. package/lib/components/Icon/streamline-icons/archive-solid.icon.js.map +1 -0
  105. package/lib/components/Icon/streamline-icons/archive.icon.d.ts +5 -0
  106. package/lib/components/Icon/streamline-icons/archive.icon.d.ts.map +1 -0
  107. package/lib/components/Icon/streamline-icons/archive.icon.js +7 -0
  108. package/lib/components/Icon/streamline-icons/archive.icon.js.map +1 -0
  109. package/lib/components/Icon/streamline-icons/article-solid.icon.d.ts +5 -0
  110. package/lib/components/Icon/streamline-icons/article-solid.icon.d.ts.map +1 -0
  111. package/lib/components/Icon/streamline-icons/article-solid.icon.js +7 -0
  112. package/lib/components/Icon/streamline-icons/article-solid.icon.js.map +1 -0
  113. package/lib/components/Icon/streamline-icons/article.icon.d.ts +5 -0
  114. package/lib/components/Icon/streamline-icons/article.icon.d.ts.map +1 -0
  115. package/lib/components/Icon/streamline-icons/article.icon.js +7 -0
  116. package/lib/components/Icon/streamline-icons/article.icon.js.map +1 -0
  117. package/lib/components/Icon/streamline-icons/bell-solid.icon.d.ts +5 -0
  118. package/lib/components/Icon/streamline-icons/bell-solid.icon.d.ts.map +1 -0
  119. package/lib/components/Icon/streamline-icons/bell-solid.icon.js +7 -0
  120. package/lib/components/Icon/streamline-icons/bell-solid.icon.js.map +1 -0
  121. package/lib/components/Icon/streamline-icons/browser-site.icon.d.ts +5 -0
  122. package/lib/components/Icon/streamline-icons/browser-site.icon.d.ts.map +1 -0
  123. package/lib/components/Icon/streamline-icons/browser-site.icon.js +7 -0
  124. package/lib/components/Icon/streamline-icons/browser-site.icon.js.map +1 -0
  125. package/lib/components/Icon/streamline-icons/circle-mixed-right.icon.d.ts +5 -0
  126. package/lib/components/Icon/streamline-icons/circle-mixed-right.icon.d.ts.map +1 -0
  127. package/lib/components/Icon/streamline-icons/circle-mixed-right.icon.js +7 -0
  128. package/lib/components/Icon/streamline-icons/circle-mixed-right.icon.js.map +1 -0
  129. package/lib/components/Icon/streamline-icons/circle-stacked-mixed.icon.d.ts +5 -0
  130. package/lib/components/Icon/streamline-icons/circle-stacked-mixed.icon.d.ts.map +1 -0
  131. package/lib/components/Icon/streamline-icons/circle-stacked-mixed.icon.js +7 -0
  132. package/lib/components/Icon/streamline-icons/circle-stacked-mixed.icon.js.map +1 -0
  133. package/lib/components/Icon/streamline-icons/circle-stacked.icon.d.ts +5 -0
  134. package/lib/components/Icon/streamline-icons/circle-stacked.icon.d.ts.map +1 -0
  135. package/lib/components/Icon/streamline-icons/circle-stacked.icon.js +7 -0
  136. package/lib/components/Icon/streamline-icons/circle-stacked.icon.js.map +1 -0
  137. package/lib/components/Icon/streamline-icons/cloud-nodes.icon.d.ts +5 -0
  138. package/lib/components/Icon/streamline-icons/cloud-nodes.icon.d.ts.map +1 -0
  139. package/lib/components/Icon/streamline-icons/cloud-nodes.icon.js +7 -0
  140. package/lib/components/Icon/streamline-icons/cloud-nodes.icon.js.map +1 -0
  141. package/lib/components/Icon/streamline-icons/condition-critical.icon.d.ts +5 -0
  142. package/lib/components/Icon/streamline-icons/condition-critical.icon.d.ts.map +1 -0
  143. package/lib/components/Icon/streamline-icons/condition-critical.icon.js +7 -0
  144. package/lib/components/Icon/streamline-icons/condition-critical.icon.js.map +1 -0
  145. package/lib/components/Icon/streamline-icons/condition-satisfactory.icon.d.ts +5 -0
  146. package/lib/components/Icon/streamline-icons/condition-satisfactory.icon.d.ts.map +1 -0
  147. package/lib/components/Icon/streamline-icons/condition-satisfactory.icon.js +7 -0
  148. package/lib/components/Icon/streamline-icons/condition-satisfactory.icon.js.map +1 -0
  149. package/lib/components/Icon/streamline-icons/disc-document.icon.d.ts +5 -0
  150. package/lib/components/Icon/streamline-icons/disc-document.icon.d.ts.map +1 -0
  151. package/lib/components/Icon/streamline-icons/disc-document.icon.js +7 -0
  152. package/lib/components/Icon/streamline-icons/disc-document.icon.js.map +1 -0
  153. package/lib/components/Icon/streamline-icons/disc-nodes.icon.d.ts +5 -0
  154. package/lib/components/Icon/streamline-icons/disc-nodes.icon.d.ts.map +1 -0
  155. package/lib/components/Icon/streamline-icons/disc-nodes.icon.js +7 -0
  156. package/lib/components/Icon/streamline-icons/disc-nodes.icon.js.map +1 -0
  157. package/lib/components/Icon/streamline-icons/document-doc.icon.d.ts +5 -0
  158. package/lib/components/Icon/streamline-icons/document-doc.icon.d.ts.map +1 -0
  159. package/lib/components/Icon/streamline-icons/document-doc.icon.js +7 -0
  160. package/lib/components/Icon/streamline-icons/document-doc.icon.js.map +1 -0
  161. package/lib/components/Icon/streamline-icons/document-json.icon.d.ts +5 -0
  162. package/lib/components/Icon/streamline-icons/document-json.icon.d.ts.map +1 -0
  163. package/lib/components/Icon/streamline-icons/document-json.icon.js +7 -0
  164. package/lib/components/Icon/streamline-icons/document-json.icon.js.map +1 -0
  165. package/lib/components/Icon/streamline-icons/document-xls.icon.d.ts +5 -0
  166. package/lib/components/Icon/streamline-icons/document-xls.icon.d.ts.map +1 -0
  167. package/lib/components/Icon/streamline-icons/document-xls.icon.js +7 -0
  168. package/lib/components/Icon/streamline-icons/document-xls.icon.js.map +1 -0
  169. package/lib/components/Icon/streamline-icons/documents.icon.d.ts +5 -0
  170. package/lib/components/Icon/streamline-icons/documents.icon.d.ts.map +1 -0
  171. package/lib/components/Icon/streamline-icons/documents.icon.js +7 -0
  172. package/lib/components/Icon/streamline-icons/documents.icon.js.map +1 -0
  173. package/lib/components/Icon/streamline-icons/field-cursor.icon.js +1 -1
  174. package/lib/components/Icon/streamline-icons/field-cursor.icon.js.map +1 -1
  175. package/lib/components/Icon/streamline-icons/filter-on.icon.d.ts +5 -0
  176. package/lib/components/Icon/streamline-icons/filter-on.icon.d.ts.map +1 -0
  177. package/lib/components/Icon/streamline-icons/filter-on.icon.js +7 -0
  178. package/lib/components/Icon/streamline-icons/filter-on.icon.js.map +1 -0
  179. package/lib/components/Icon/streamline-icons/freeze-column.icon.d.ts +5 -0
  180. package/lib/components/Icon/streamline-icons/freeze-column.icon.d.ts.map +1 -0
  181. package/lib/components/Icon/streamline-icons/freeze-column.icon.js +7 -0
  182. package/lib/components/Icon/streamline-icons/freeze-column.icon.js.map +1 -0
  183. package/lib/components/Icon/streamline-icons/galaxy.icon.d.ts +5 -0
  184. package/lib/components/Icon/streamline-icons/galaxy.icon.d.ts.map +1 -0
  185. package/lib/components/Icon/streamline-icons/galaxy.icon.js +7 -0
  186. package/lib/components/Icon/streamline-icons/galaxy.icon.js.map +1 -0
  187. package/lib/components/Icon/streamline-icons/grid-solid.icon.d.ts +5 -0
  188. package/lib/components/Icon/streamline-icons/grid-solid.icon.d.ts.map +1 -0
  189. package/lib/components/Icon/streamline-icons/grid-solid.icon.js +7 -0
  190. package/lib/components/Icon/streamline-icons/grid-solid.icon.js.map +1 -0
  191. package/lib/components/Icon/streamline-icons/grid.icon.d.ts +5 -0
  192. package/lib/components/Icon/streamline-icons/grid.icon.d.ts.map +1 -0
  193. package/lib/components/Icon/streamline-icons/grid.icon.js +7 -0
  194. package/lib/components/Icon/streamline-icons/grid.icon.js.map +1 -0
  195. package/lib/components/Icon/streamline-icons/language-pack.icon.d.ts +5 -0
  196. package/lib/components/Icon/streamline-icons/language-pack.icon.d.ts.map +1 -0
  197. package/lib/components/Icon/streamline-icons/language-pack.icon.js +7 -0
  198. package/lib/components/Icon/streamline-icons/language-pack.icon.js.map +1 -0
  199. package/lib/components/Icon/streamline-icons/layout.icon.d.ts +5 -0
  200. package/lib/components/Icon/streamline-icons/layout.icon.d.ts.map +1 -0
  201. package/lib/components/Icon/streamline-icons/layout.icon.js +7 -0
  202. package/lib/components/Icon/streamline-icons/layout.icon.js.map +1 -0
  203. package/lib/components/Icon/streamline-icons/lock-closed.icon.d.ts +5 -0
  204. package/lib/components/Icon/streamline-icons/lock-closed.icon.d.ts.map +1 -0
  205. package/lib/components/Icon/streamline-icons/lock-closed.icon.js +7 -0
  206. package/lib/components/Icon/streamline-icons/lock-closed.icon.js.map +1 -0
  207. package/lib/components/Icon/streamline-icons/mail-solid.icon.d.ts +5 -0
  208. package/lib/components/Icon/streamline-icons/mail-solid.icon.d.ts.map +1 -0
  209. package/lib/components/Icon/streamline-icons/mail-solid.icon.js +7 -0
  210. package/lib/components/Icon/streamline-icons/mail-solid.icon.js.map +1 -0
  211. package/lib/components/Icon/streamline-icons/mail.icon.d.ts.map +1 -1
  212. package/lib/components/Icon/streamline-icons/mail.icon.js +1 -1
  213. package/lib/components/Icon/streamline-icons/mail.icon.js.map +1 -1
  214. package/lib/components/Icon/streamline-icons/mobius.icon.d.ts +5 -0
  215. package/lib/components/Icon/streamline-icons/mobius.icon.d.ts.map +1 -0
  216. package/lib/components/Icon/streamline-icons/mobius.icon.js +7 -0
  217. package/lib/components/Icon/streamline-icons/mobius.icon.js.map +1 -0
  218. package/lib/components/Icon/streamline-icons/phone-in-solid.icon.d.ts +5 -0
  219. package/lib/components/Icon/streamline-icons/phone-in-solid.icon.d.ts.map +1 -0
  220. package/lib/components/Icon/streamline-icons/phone-in-solid.icon.js +7 -0
  221. package/lib/components/Icon/streamline-icons/phone-in-solid.icon.js.map +1 -0
  222. package/lib/components/Icon/streamline-icons/picture-solid.icon.d.ts +5 -0
  223. package/lib/components/Icon/streamline-icons/picture-solid.icon.d.ts.map +1 -0
  224. package/lib/components/Icon/streamline-icons/picture-solid.icon.js +7 -0
  225. package/lib/components/Icon/streamline-icons/picture-solid.icon.js.map +1 -0
  226. package/lib/components/Icon/streamline-icons/plug-connect.icon.d.ts +5 -0
  227. package/lib/components/Icon/streamline-icons/plug-connect.icon.d.ts.map +1 -0
  228. package/lib/components/Icon/streamline-icons/plug-connect.icon.js +7 -0
  229. package/lib/components/Icon/streamline-icons/plug-connect.icon.js.map +1 -0
  230. package/lib/components/Icon/streamline-icons/return.icon.d.ts +5 -0
  231. package/lib/components/Icon/streamline-icons/return.icon.d.ts.map +1 -0
  232. package/lib/components/Icon/streamline-icons/return.icon.js +7 -0
  233. package/lib/components/Icon/streamline-icons/return.icon.js.map +1 -0
  234. package/lib/components/Icon/streamline-icons/robot-solid.icon.d.ts +5 -0
  235. package/lib/components/Icon/streamline-icons/robot-solid.icon.d.ts.map +1 -0
  236. package/lib/components/Icon/streamline-icons/robot-solid.icon.js +7 -0
  237. package/lib/components/Icon/streamline-icons/robot-solid.icon.js.map +1 -0
  238. package/lib/components/Icon/streamline-icons/shapes.icon.d.ts +5 -0
  239. package/lib/components/Icon/streamline-icons/shapes.icon.d.ts.map +1 -0
  240. package/lib/components/Icon/streamline-icons/shapes.icon.js +7 -0
  241. package/lib/components/Icon/streamline-icons/shapes.icon.js.map +1 -0
  242. package/lib/components/Icon/streamline-icons/share-case.icon.d.ts +5 -0
  243. package/lib/components/Icon/streamline-icons/share-case.icon.d.ts.map +1 -0
  244. package/lib/components/Icon/streamline-icons/share-case.icon.js +7 -0
  245. package/lib/components/Icon/streamline-icons/share-case.icon.js.map +1 -0
  246. package/lib/components/Icon/streamline-icons/share-document.icon.d.ts +5 -0
  247. package/lib/components/Icon/streamline-icons/share-document.icon.d.ts.map +1 -0
  248. package/lib/components/Icon/streamline-icons/share-document.icon.js +7 -0
  249. package/lib/components/Icon/streamline-icons/share-document.icon.js.map +1 -0
  250. package/lib/components/Icon/streamline-icons/shield-lock.icon.d.ts +5 -0
  251. package/lib/components/Icon/streamline-icons/shield-lock.icon.d.ts.map +1 -0
  252. package/lib/components/Icon/streamline-icons/shield-lock.icon.js +7 -0
  253. package/lib/components/Icon/streamline-icons/shield-lock.icon.js.map +1 -0
  254. package/lib/components/Icon/streamline-icons/slideshow-solid.icon.d.ts +5 -0
  255. package/lib/components/Icon/streamline-icons/slideshow-solid.icon.d.ts.map +1 -0
  256. package/lib/components/Icon/streamline-icons/slideshow-solid.icon.js +7 -0
  257. package/lib/components/Icon/streamline-icons/slideshow-solid.icon.js.map +1 -0
  258. package/lib/components/Icon/streamline-icons/speaker-on-sold.icon.d.ts +5 -0
  259. package/lib/components/Icon/streamline-icons/speaker-on-sold.icon.d.ts.map +1 -0
  260. package/lib/components/Icon/streamline-icons/speaker-on-sold.icon.js +7 -0
  261. package/lib/components/Icon/streamline-icons/speaker-on-sold.icon.js.map +1 -0
  262. package/lib/components/Icon/streamline-icons/speaker-on.icon.d.ts +5 -0
  263. package/lib/components/Icon/streamline-icons/speaker-on.icon.d.ts.map +1 -0
  264. package/lib/components/Icon/streamline-icons/speaker-on.icon.js +7 -0
  265. package/lib/components/Icon/streamline-icons/speaker-on.icon.js.map +1 -0
  266. package/lib/components/Icon/streamline-icons/table-disc.icon.d.ts +5 -0
  267. package/lib/components/Icon/streamline-icons/table-disc.icon.d.ts.map +1 -0
  268. package/lib/components/Icon/streamline-icons/table-disc.icon.js +7 -0
  269. package/lib/components/Icon/streamline-icons/table-disc.icon.js.map +1 -0
  270. package/lib/components/Icon/streamline-icons/translate.icon.d.ts +5 -0
  271. package/lib/components/Icon/streamline-icons/translate.icon.d.ts.map +1 -0
  272. package/lib/components/Icon/streamline-icons/translate.icon.js +7 -0
  273. package/lib/components/Icon/streamline-icons/translate.icon.js.map +1 -0
  274. package/lib/components/Icon/streamline-icons/user-check-solid.icon.d.ts +5 -0
  275. package/lib/components/Icon/streamline-icons/user-check-solid.icon.d.ts.map +1 -0
  276. package/lib/components/Icon/streamline-icons/user-check-solid.icon.js +7 -0
  277. package/lib/components/Icon/streamline-icons/user-check-solid.icon.js.map +1 -0
  278. package/lib/components/Icon/streamline-icons/user-close-solid.icon.d.ts +5 -0
  279. package/lib/components/Icon/streamline-icons/user-close-solid.icon.d.ts.map +1 -0
  280. package/lib/components/Icon/streamline-icons/user-close-solid.icon.js +7 -0
  281. package/lib/components/Icon/streamline-icons/user-close-solid.icon.js.map +1 -0
  282. package/lib/components/Icon/streamline-icons/user-close.icon.d.ts +5 -0
  283. package/lib/components/Icon/streamline-icons/user-close.icon.d.ts.map +1 -0
  284. package/lib/components/Icon/streamline-icons/user-close.icon.js +7 -0
  285. package/lib/components/Icon/streamline-icons/user-close.icon.js.map +1 -0
  286. package/lib/components/Icon/streamline-icons/user-female-solid.icon.d.ts +5 -0
  287. package/lib/components/Icon/streamline-icons/user-female-solid.icon.d.ts.map +1 -0
  288. package/lib/components/Icon/streamline-icons/user-female-solid.icon.js +7 -0
  289. package/lib/components/Icon/streamline-icons/user-female-solid.icon.js.map +1 -0
  290. package/lib/components/Icon/streamline-icons/user-female.icon.d.ts +5 -0
  291. package/lib/components/Icon/streamline-icons/user-female.icon.d.ts.map +1 -0
  292. package/lib/components/Icon/streamline-icons/user-female.icon.js +7 -0
  293. package/lib/components/Icon/streamline-icons/user-female.icon.js.map +1 -0
  294. package/lib/components/Icon/streamline-icons/user-list-solid.icon.d.ts +5 -0
  295. package/lib/components/Icon/streamline-icons/user-list-solid.icon.d.ts.map +1 -0
  296. package/lib/components/Icon/streamline-icons/user-list-solid.icon.js +7 -0
  297. package/lib/components/Icon/streamline-icons/user-list-solid.icon.js.map +1 -0
  298. package/lib/components/Icon/streamline-icons/user-list.icon.d.ts +5 -0
  299. package/lib/components/Icon/streamline-icons/user-list.icon.d.ts.map +1 -0
  300. package/lib/components/Icon/streamline-icons/user-list.icon.js +7 -0
  301. package/lib/components/Icon/streamline-icons/user-list.icon.js.map +1 -0
  302. package/lib/components/Icon/streamline-icons/user-plus-solid.icon.d.ts +5 -0
  303. package/lib/components/Icon/streamline-icons/user-plus-solid.icon.d.ts.map +1 -0
  304. package/lib/components/Icon/streamline-icons/user-plus-solid.icon.js +7 -0
  305. package/lib/components/Icon/streamline-icons/user-plus-solid.icon.js.map +1 -0
  306. package/lib/components/Icon/streamline-icons/user-plus.icon.d.ts +5 -0
  307. package/lib/components/Icon/streamline-icons/user-plus.icon.d.ts.map +1 -0
  308. package/lib/components/Icon/streamline-icons/user-plus.icon.js +7 -0
  309. package/lib/components/Icon/streamline-icons/user-plus.icon.js.map +1 -0
  310. package/lib/components/Icon/streamline-icons/user-question-mark-solid.icon.d.ts +5 -0
  311. package/lib/components/Icon/streamline-icons/user-question-mark-solid.icon.d.ts.map +1 -0
  312. package/lib/components/Icon/streamline-icons/user-question-mark-solid.icon.js +7 -0
  313. package/lib/components/Icon/streamline-icons/user-question-mark-solid.icon.js.map +1 -0
  314. package/lib/components/Icon/streamline-icons/user-question-mark.icon.d.ts +5 -0
  315. package/lib/components/Icon/streamline-icons/user-question-mark.icon.d.ts.map +1 -0
  316. package/lib/components/Icon/streamline-icons/user-question-mark.icon.js +7 -0
  317. package/lib/components/Icon/streamline-icons/user-question-mark.icon.js.map +1 -0
  318. package/lib/components/Icon/streamline-icons/user-search-solid.icon.d.ts +5 -0
  319. package/lib/components/Icon/streamline-icons/user-search-solid.icon.d.ts.map +1 -0
  320. package/lib/components/Icon/streamline-icons/user-search-solid.icon.js +7 -0
  321. package/lib/components/Icon/streamline-icons/user-search-solid.icon.js.map +1 -0
  322. package/lib/components/Icon/streamline-icons/user-search.icon.d.ts +5 -0
  323. package/lib/components/Icon/streamline-icons/user-search.icon.d.ts.map +1 -0
  324. package/lib/components/Icon/streamline-icons/user-search.icon.js +7 -0
  325. package/lib/components/Icon/streamline-icons/user-search.icon.js.map +1 -0
  326. package/lib/components/Icon/streamline-icons/user-star-solid.icon.d.ts +5 -0
  327. package/lib/components/Icon/streamline-icons/user-star-solid.icon.d.ts.map +1 -0
  328. package/lib/components/Icon/streamline-icons/user-star-solid.icon.js +7 -0
  329. package/lib/components/Icon/streamline-icons/user-star-solid.icon.js.map +1 -0
  330. package/lib/components/Icon/streamline-icons/user-star.icon.js +2 -2
  331. package/lib/components/Icon/streamline-icons/user-star.icon.js.map +1 -1
  332. package/lib/components/Icon/streamline-icons/users-solid.icon.d.ts +5 -0
  333. package/lib/components/Icon/streamline-icons/users-solid.icon.d.ts.map +1 -0
  334. package/lib/components/Icon/streamline-icons/users-solid.icon.js +7 -0
  335. package/lib/components/Icon/streamline-icons/users-solid.icon.js.map +1 -0
  336. package/lib/components/Icon/streamline-icons/users.icon.d.ts +5 -0
  337. package/lib/components/Icon/streamline-icons/users.icon.d.ts.map +1 -0
  338. package/lib/components/Icon/streamline-icons/users.icon.js +7 -0
  339. package/lib/components/Icon/streamline-icons/users.icon.js.map +1 -0
  340. package/lib/components/Icon/streamline-icons/versions.icon.d.ts +5 -0
  341. package/lib/components/Icon/streamline-icons/versions.icon.d.ts.map +1 -0
  342. package/lib/components/Icon/streamline-icons/versions.icon.js +7 -0
  343. package/lib/components/Icon/streamline-icons/versions.icon.js.map +1 -0
  344. package/lib/components/Icon/streamline-icons/video-off.icon.d.ts +5 -0
  345. package/lib/components/Icon/streamline-icons/video-off.icon.d.ts.map +1 -0
  346. package/lib/components/Icon/streamline-icons/video-off.icon.js +7 -0
  347. package/lib/components/Icon/streamline-icons/video-off.icon.js.map +1 -0
  348. package/lib/components/Icon/streamline-icons/video-solid.icon.d.ts +5 -0
  349. package/lib/components/Icon/streamline-icons/video-solid.icon.d.ts.map +1 -0
  350. package/lib/components/Icon/streamline-icons/video-solid.icon.js +7 -0
  351. package/lib/components/Icon/streamline-icons/video-solid.icon.js.map +1 -0
  352. package/lib/components/Icon/streamline-icons/video.icon.d.ts +5 -0
  353. package/lib/components/Icon/streamline-icons/video.icon.d.ts.map +1 -0
  354. package/lib/components/Icon/streamline-icons/video.icon.js +7 -0
  355. package/lib/components/Icon/streamline-icons/video.icon.js.map +1 -0
  356. package/lib/components/Icon/streamline-icons/voicemail.icon.d.ts +5 -0
  357. package/lib/components/Icon/streamline-icons/voicemail.icon.d.ts.map +1 -0
  358. package/lib/components/Icon/streamline-icons/voicemail.icon.js +7 -0
  359. package/lib/components/Icon/streamline-icons/voicemail.icon.js.map +1 -0
  360. package/lib/components/Icon/streamline-icons/vr-solid.icon.d.ts +5 -0
  361. package/lib/components/Icon/streamline-icons/vr-solid.icon.d.ts.map +1 -0
  362. package/lib/components/Icon/streamline-icons/vr-solid.icon.js +7 -0
  363. package/lib/components/Icon/streamline-icons/vr-solid.icon.js.map +1 -0
  364. package/lib/components/Icon/streamline-icons/vr.icon.d.ts +5 -0
  365. package/lib/components/Icon/streamline-icons/vr.icon.d.ts.map +1 -0
  366. package/lib/components/Icon/streamline-icons/vr.icon.js +7 -0
  367. package/lib/components/Icon/streamline-icons/vr.icon.js.map +1 -0
  368. package/lib/components/Icon/streamline-icons/walkie-solid.icon.d.ts +5 -0
  369. package/lib/components/Icon/streamline-icons/walkie-solid.icon.d.ts.map +1 -0
  370. package/lib/components/Icon/streamline-icons/walkie-solid.icon.js +7 -0
  371. package/lib/components/Icon/streamline-icons/walkie-solid.icon.js.map +1 -0
  372. package/lib/components/Icon/streamline-icons/walkie.icon.d.ts +5 -0
  373. package/lib/components/Icon/streamline-icons/walkie.icon.d.ts.map +1 -0
  374. package/lib/components/Icon/streamline-icons/walkie.icon.js +7 -0
  375. package/lib/components/Icon/streamline-icons/walkie.icon.js.map +1 -0
  376. package/lib/components/Icon/streamline-icons/wallet-solid.icon.d.ts +5 -0
  377. package/lib/components/Icon/streamline-icons/wallet-solid.icon.d.ts.map +1 -0
  378. package/lib/components/Icon/streamline-icons/wallet-solid.icon.js +7 -0
  379. package/lib/components/Icon/streamline-icons/wallet-solid.icon.js.map +1 -0
  380. package/lib/components/Icon/streamline-icons/wallet.icon.d.ts +5 -0
  381. package/lib/components/Icon/streamline-icons/wallet.icon.d.ts.map +1 -0
  382. package/lib/components/Icon/streamline-icons/wallet.icon.js +7 -0
  383. package/lib/components/Icon/streamline-icons/wallet.icon.js.map +1 -0
  384. package/lib/components/Icon/streamline-icons/watch-solid.icon.d.ts +5 -0
  385. package/lib/components/Icon/streamline-icons/watch-solid.icon.d.ts.map +1 -0
  386. package/lib/components/Icon/streamline-icons/watch-solid.icon.js +7 -0
  387. package/lib/components/Icon/streamline-icons/watch-solid.icon.js.map +1 -0
  388. package/lib/components/Icon/streamline-icons/watch.icon.d.ts +5 -0
  389. package/lib/components/Icon/streamline-icons/watch.icon.d.ts.map +1 -0
  390. package/lib/components/Icon/streamline-icons/watch.icon.js +7 -0
  391. package/lib/components/Icon/streamline-icons/watch.icon.js.map +1 -0
  392. package/lib/components/Icon/streamline-icons/waypoint-solid.icon.d.ts +5 -0
  393. package/lib/components/Icon/streamline-icons/waypoint-solid.icon.d.ts.map +1 -0
  394. package/lib/components/Icon/streamline-icons/waypoint-solid.icon.js +7 -0
  395. package/lib/components/Icon/streamline-icons/waypoint-solid.icon.js.map +1 -0
  396. package/lib/components/Icon/streamline-icons/waypoint.icon.d.ts +5 -0
  397. package/lib/components/Icon/streamline-icons/waypoint.icon.d.ts.map +1 -0
  398. package/lib/components/Icon/streamline-icons/waypoint.icon.js +7 -0
  399. package/lib/components/Icon/streamline-icons/waypoint.icon.js.map +1 -0
  400. package/lib/components/Icon/streamline-icons/webcam-solid.icon.d.ts +5 -0
  401. package/lib/components/Icon/streamline-icons/webcam-solid.icon.d.ts.map +1 -0
  402. package/lib/components/Icon/streamline-icons/webcam-solid.icon.js +7 -0
  403. package/lib/components/Icon/streamline-icons/webcam-solid.icon.js.map +1 -0
  404. package/lib/components/Icon/streamline-icons/webcam.icon.d.ts +5 -0
  405. package/lib/components/Icon/streamline-icons/webcam.icon.d.ts.map +1 -0
  406. package/lib/components/Icon/streamline-icons/webcam.icon.js +7 -0
  407. package/lib/components/Icon/streamline-icons/webcam.icon.js.map +1 -0
  408. package/lib/components/Icon/streamline-icons/whatsapp.icon.d.ts +5 -0
  409. package/lib/components/Icon/streamline-icons/whatsapp.icon.d.ts.map +1 -0
  410. package/lib/components/Icon/streamline-icons/whatsapp.icon.js +7 -0
  411. package/lib/components/Icon/streamline-icons/whatsapp.icon.js.map +1 -0
  412. package/lib/components/Icon/streamline-icons/wifi-none.icon.d.ts +5 -0
  413. package/lib/components/Icon/streamline-icons/wifi-none.icon.d.ts.map +1 -0
  414. package/lib/components/Icon/streamline-icons/wifi-none.icon.js +7 -0
  415. package/lib/components/Icon/streamline-icons/wifi-none.icon.js.map +1 -0
  416. package/lib/components/Icon/streamline-icons/wifi-off.icon.d.ts +5 -0
  417. package/lib/components/Icon/streamline-icons/wifi-off.icon.d.ts.map +1 -0
  418. package/lib/components/Icon/streamline-icons/wifi-off.icon.js +7 -0
  419. package/lib/components/Icon/streamline-icons/wifi-off.icon.js.map +1 -0
  420. package/lib/components/Icon/streamline-icons/wizard-solid.icon.d.ts +5 -0
  421. package/lib/components/Icon/streamline-icons/wizard-solid.icon.d.ts.map +1 -0
  422. package/lib/components/Icon/streamline-icons/wizard-solid.icon.js +7 -0
  423. package/lib/components/Icon/streamline-icons/wizard-solid.icon.js.map +1 -0
  424. package/lib/components/Icon/streamline-icons/wizard.icon.d.ts +5 -0
  425. package/lib/components/Icon/streamline-icons/wizard.icon.d.ts.map +1 -0
  426. package/lib/components/Icon/streamline-icons/wizard.icon.js +7 -0
  427. package/lib/components/Icon/streamline-icons/wizard.icon.js.map +1 -0
  428. package/lib/components/Icon/streamline-icons/wrench-solid.icon.d.ts +5 -0
  429. package/lib/components/Icon/streamline-icons/wrench-solid.icon.d.ts.map +1 -0
  430. package/lib/components/Icon/streamline-icons/wrench-solid.icon.js +7 -0
  431. package/lib/components/Icon/streamline-icons/wrench-solid.icon.js.map +1 -0
  432. package/lib/components/Icon/streamline-icons/wrench.icon.d.ts +5 -0
  433. package/lib/components/Icon/streamline-icons/wrench.icon.d.ts.map +1 -0
  434. package/lib/components/Icon/streamline-icons/wrench.icon.js +7 -0
  435. package/lib/components/Icon/streamline-icons/wrench.icon.js.map +1 -0
  436. package/lib/components/Icon/streamlineIconNames.d.ts +1 -1
  437. package/lib/components/Icon/streamlineIconNames.d.ts.map +1 -1
  438. package/lib/components/Icon/streamlineIconNames.js +82 -0
  439. package/lib/components/Icon/streamlineIconNames.js.map +1 -1
  440. package/lib/components/IconPicker/IconPicker.d.ts +4 -4
  441. package/lib/components/IconPicker/IconPicker.d.ts.map +1 -1
  442. package/lib/components/IconPicker/IconPicker.js +19 -25
  443. package/lib/components/IconPicker/IconPicker.js.map +1 -1
  444. package/lib/components/Input/Input.js +1 -1
  445. package/lib/components/Input/Input.js.map +1 -1
  446. package/lib/components/Input/Input.styles.d.ts.map +1 -1
  447. package/lib/components/Input/Input.styles.js +2 -17
  448. package/lib/components/Input/Input.styles.js.map +1 -1
  449. package/lib/components/Lightbox/Lightbox.d.ts +1 -1
  450. package/lib/components/Lightbox/Lightbox.d.ts.map +1 -1
  451. package/lib/components/Lightbox/Lightbox.js +9 -3
  452. package/lib/components/Lightbox/Lightbox.js.map +1 -1
  453. package/lib/components/Lightbox/Lightbox.test-ids.d.ts +1 -1
  454. package/lib/components/Lightbox/Lightbox.test-ids.d.ts.map +1 -1
  455. package/lib/components/Lightbox/Lightbox.test-ids.js +1 -0
  456. package/lib/components/Lightbox/Lightbox.test-ids.js.map +1 -1
  457. package/lib/components/ListToolbar/ListToolbar.d.ts.map +1 -1
  458. package/lib/components/ListToolbar/ListToolbar.js +100 -39
  459. package/lib/components/ListToolbar/ListToolbar.js.map +1 -1
  460. package/lib/components/ListToolbar/ListToolbar.styles.d.ts.map +1 -1
  461. package/lib/components/ListToolbar/ListToolbar.styles.js +11 -16
  462. package/lib/components/ListToolbar/ListToolbar.styles.js.map +1 -1
  463. package/lib/components/ListToolbar/ListToolbar.types.d.ts +7 -3
  464. package/lib/components/ListToolbar/ListToolbar.types.d.ts.map +1 -1
  465. package/lib/components/ListToolbar/ListToolbar.types.js.map +1 -1
  466. package/lib/components/Location/CurrentLocationButton.d.ts.map +1 -1
  467. package/lib/components/Location/CurrentLocationButton.js +4 -2
  468. package/lib/components/Location/CurrentLocationButton.js.map +1 -1
  469. package/lib/components/Location/GoogleMapsAPI.d.ts +43 -0
  470. package/lib/components/Location/GoogleMapsAPI.d.ts.map +1 -0
  471. package/lib/components/Location/GoogleMapsAPI.js +244 -0
  472. package/lib/components/Location/GoogleMapsAPI.js.map +1 -0
  473. package/lib/components/Location/Location.types.d.ts +3 -2
  474. package/lib/components/Location/Location.types.d.ts.map +1 -1
  475. package/lib/components/Location/Location.types.js.map +1 -1
  476. package/lib/components/Location/LocationAPI.types.d.ts +23 -0
  477. package/lib/components/Location/LocationAPI.types.d.ts.map +1 -0
  478. package/lib/components/Location/LocationAPI.types.js +2 -0
  479. package/lib/components/Location/LocationAPI.types.js.map +1 -0
  480. package/lib/components/Location/LocationDisplay.d.ts.map +1 -1
  481. package/lib/components/Location/LocationDisplay.js +5 -3
  482. package/lib/components/Location/LocationDisplay.js.map +1 -1
  483. package/lib/components/Location/LocationInput.d.ts.map +1 -1
  484. package/lib/components/Location/LocationInput.js +25 -22
  485. package/lib/components/Location/LocationInput.js.map +1 -1
  486. package/lib/components/Location/LocationView.d.ts.map +1 -1
  487. package/lib/components/Location/LocationView.js +8 -5
  488. package/lib/components/Location/LocationView.js.map +1 -1
  489. package/lib/components/Location/index.d.ts +2 -1
  490. package/lib/components/Location/index.d.ts.map +1 -1
  491. package/lib/components/Location/index.js +2 -1
  492. package/lib/components/Location/index.js.map +1 -1
  493. package/lib/components/Location/utils.d.ts +3 -19
  494. package/lib/components/Location/utils.d.ts.map +1 -1
  495. package/lib/components/Location/utils.js +7 -161
  496. package/lib/components/Location/utils.js.map +1 -1
  497. package/lib/components/Modal/Modal.styles.js +5 -5
  498. package/lib/components/Modal/Modal.styles.js.map +1 -1
  499. package/lib/components/MultiStepForm/MultiStepForm.d.ts.map +1 -1
  500. package/lib/components/MultiStepForm/MultiStepForm.js +1 -6
  501. package/lib/components/MultiStepForm/MultiStepForm.js.map +1 -1
  502. package/lib/components/Number/NumberInput.d.ts.map +1 -1
  503. package/lib/components/Number/NumberInput.js +3 -1
  504. package/lib/components/Number/NumberInput.js.map +1 -1
  505. package/lib/components/Number/NumberRangeInput.d.ts.map +1 -1
  506. package/lib/components/Number/NumberRangeInput.js +3 -1
  507. package/lib/components/Number/NumberRangeInput.js.map +1 -1
  508. package/lib/components/PageTemplates/GridLayout/EditorBackground.js +1 -1
  509. package/lib/components/PageTemplates/GridLayout/EditorBackground.js.map +1 -1
  510. package/lib/components/PageTemplates/GridLayout/GridLayoutEditor.js +1 -1
  511. package/lib/components/PageTemplates/GridLayout/GridLayoutEditor.js.map +1 -1
  512. package/lib/components/PageTemplates/GridLayout/GridLayoutViewer.d.ts +5 -0
  513. package/lib/components/PageTemplates/GridLayout/GridLayoutViewer.d.ts.map +1 -1
  514. package/lib/components/PageTemplates/GridLayout/GridLayoutViewer.js +2 -2
  515. package/lib/components/PageTemplates/GridLayout/GridLayoutViewer.js.map +1 -1
  516. package/lib/components/PageTemplates/GridLayout/config.d.ts +1 -1
  517. package/lib/components/PageTemplates/GridLayout/config.d.ts.map +1 -1
  518. package/lib/components/PageTemplates/GridLayout/config.js +3 -3
  519. package/lib/components/PageTemplates/GridLayout/config.js.map +1 -1
  520. package/lib/components/PageTemplates/PageTemplates.d.ts +6 -1
  521. package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
  522. package/lib/components/PageTemplates/PageTemplates.js +17 -8
  523. package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
  524. package/lib/components/Phone/PhoneInput.d.ts.map +1 -1
  525. package/lib/components/Phone/PhoneInput.js +2 -2
  526. package/lib/components/Phone/PhoneInput.js.map +1 -1
  527. package/lib/components/Popover/Popover.styles.d.ts.map +1 -1
  528. package/lib/components/Popover/Popover.styles.js +18 -8
  529. package/lib/components/Popover/Popover.styles.js.map +1 -1
  530. package/lib/components/Popover/modifiers.d.ts.map +1 -1
  531. package/lib/components/Popover/modifiers.js +10 -0
  532. package/lib/components/Popover/modifiers.js.map +1 -1
  533. package/lib/components/RadioCheck/RadioCheck.d.ts.map +1 -1
  534. package/lib/components/RadioCheck/RadioCheck.js +5 -8
  535. package/lib/components/RadioCheck/RadioCheck.js.map +1 -1
  536. package/lib/components/Switch/Switch.d.ts.map +1 -1
  537. package/lib/components/Switch/Switch.js +5 -13
  538. package/lib/components/Switch/Switch.js.map +1 -1
  539. package/lib/components/Tabs/TabPanel.d.ts.map +1 -1
  540. package/lib/components/Tabs/TabPanel.js +1 -0
  541. package/lib/components/Tabs/TabPanel.js.map +1 -1
  542. package/lib/components/Toaster/Toaster.d.ts.map +1 -1
  543. package/lib/components/Toaster/Toaster.js +9 -5
  544. package/lib/components/Toaster/Toaster.js.map +1 -1
  545. package/lib/components/Toaster/Toaster.types.d.ts +3 -3
  546. package/lib/components/Toaster/Toaster.types.d.ts.map +1 -1
  547. package/lib/components/Toaster/Toaster.types.js.map +1 -1
  548. package/lib/components/Tooltip/Tooltip.d.ts.map +1 -1
  549. package/lib/components/Tooltip/Tooltip.js +3 -1
  550. package/lib/components/Tooltip/Tooltip.js.map +1 -1
  551. package/lib/hooks/index.d.ts +1 -0
  552. package/lib/hooks/index.d.ts.map +1 -1
  553. package/lib/hooks/index.js +1 -0
  554. package/lib/hooks/index.js.map +1 -1
  555. package/lib/hooks/useAbortController.d.ts +7 -0
  556. package/lib/hooks/useAbortController.d.ts.map +1 -0
  557. package/lib/hooks/useAbortController.js +21 -0
  558. package/lib/hooks/useAbortController.js.map +1 -0
  559. package/lib/hooks/useBreakpoint.d.ts.map +1 -1
  560. package/lib/hooks/useBreakpoint.js +5 -2
  561. package/lib/hooks/useBreakpoint.js.map +1 -1
  562. package/lib/hooks/useI18n.d.ts +156 -0
  563. package/lib/hooks/useI18n.d.ts.map +1 -1
  564. package/lib/hooks/useItemIntersection.d.ts +1 -1
  565. package/lib/hooks/useItemIntersection.js +2 -2
  566. package/lib/hooks/useItemIntersection.js.map +1 -1
  567. package/lib/hooks/useThemeMode.d.ts +10 -0
  568. package/lib/hooks/useThemeMode.d.ts.map +1 -0
  569. package/lib/hooks/useThemeMode.js +11 -0
  570. package/lib/hooks/useThemeMode.js.map +1 -0
  571. package/lib/i18n/default.d.ts +160 -0
  572. package/lib/i18n/default.d.ts.map +1 -1
  573. package/lib/i18n/default.js +173 -2
  574. package/lib/i18n/default.js.map +1 -1
  575. package/lib/i18n/i18n.d.ts +156 -0
  576. package/lib/i18n/i18n.d.ts.map +1 -1
  577. package/lib/styles/GlobalStyle.d.ts +2 -2
  578. package/lib/styles/GlobalStyle.d.ts.map +1 -1
  579. package/lib/styles/GlobalStyle.js +5 -3
  580. package/lib/styles/GlobalStyle.js.map +1 -1
  581. package/lib/styles/animations.d.ts +9 -0
  582. package/lib/styles/animations.d.ts.map +1 -0
  583. package/lib/styles/animations.js +78 -0
  584. package/lib/styles/animations.js.map +1 -0
  585. package/lib/styles/gradients.d.ts +2 -0
  586. package/lib/styles/gradients.d.ts.map +1 -1
  587. package/lib/styles/gradients.js +4 -1
  588. package/lib/styles/gradients.js.map +1 -1
  589. package/lib/styles/index.d.ts +1 -0
  590. package/lib/styles/index.d.ts.map +1 -1
  591. package/lib/styles/index.js +1 -0
  592. package/lib/styles/index.js.map +1 -1
  593. package/lib/styles/utils.d.ts +1 -1
  594. package/lib/styles/utils.d.ts.map +1 -1
  595. package/lib/styles/utils.js +1 -1
  596. package/lib/styles/utils.js.map +1 -1
  597. package/lib/theme/index.d.ts +2 -0
  598. package/lib/theme/index.d.ts.map +1 -1
  599. package/lib/theme/index.js +2 -0
  600. package/lib/theme/index.js.map +1 -1
  601. package/lib/theme/theme.d.ts +150 -0
  602. package/lib/theme/theme.d.ts.map +1 -1
  603. package/lib/theme/themeDefinition.json +82 -0
  604. package/lib/theme/themeOverrides.schema.json +102 -0
  605. package/lib/theme/themes/studioDarkTheme.json +240 -0
  606. package/lib/theme/themes/studioTheme.json +240 -0
  607. package/lib/utils/debounce.d.ts +4 -1
  608. package/lib/utils/debounce.d.ts.map +1 -1
  609. package/lib/utils/debounce.js +18 -2
  610. package/lib/utils/debounce.js.map +1 -1
  611. package/lib/utils/getFocusables.d.ts +4 -2
  612. package/lib/utils/getFocusables.d.ts.map +1 -1
  613. package/lib/utils/getFocusables.js +9 -7
  614. package/lib/utils/getFocusables.js.map +1 -1
  615. package/package.json +2 -2
@@ -28,8 +28,8 @@ export const StyledViewSelector = styled.button(({ theme, required }) => {
28
28
 
29
29
  ${StyledText} {
30
30
  white-space: nowrap;
31
- font-size: ${fontSizes[theme.components.text.h3['font-size']]};
32
- font-weight: ${theme.components.text.h3['font-weight']};
31
+ font-size: ${fontSizes[theme.components.text.h2['font-size']]};
32
+ font-weight: ${theme.components.text.h2['font-weight']};
33
33
  line-height: ${hitAreaMouse};
34
34
  word-break: break-word;
35
35
  @media (pointer: coarse) {
@@ -91,22 +91,20 @@ export const StyledErrorIcon = styled(Icon)(({ theme }) => css `
91
91
  StyledErrorIcon.defaultProps = defaultThemeProp;
92
92
  export const StyledHeadingText = styled(Text)(({ theme, required }) => {
93
93
  const { urgent } = theme.base.palette;
94
- const hitAreaMouse = theme.base['hit-area']['mouse-min'];
95
- const hitAreaFinger = theme.base['hit-area']['finger-min'];
94
+ const hitAreaCompact = theme.base['hit-area'].compact;
96
95
  return css `
97
96
  min-width: 0;
98
97
  position: relative;
99
- line-height: ${hitAreaMouse};
98
+ line-height: ${hitAreaCompact};
100
99
  word-break: break-word;
101
100
  display: flex;
102
101
  align-items: center;
102
+
103
103
  ${required &&
104
104
  css `
105
105
  padding-inline-end: calc(1.5 * ${theme.base.spacing});
106
106
  `}
107
- @media (pointer: coarse) {
108
- line-height: ${hitAreaFinger};
109
- }
107
+
110
108
  &::after {
111
109
  display: ${required ? 'inline' : 'none'};
112
110
  content: '\\00a0*';
@@ -120,20 +118,17 @@ export const StyledHeadingText = styled(Text)(({ theme, required }) => {
120
118
  ${StyledErrorIcon} {
121
119
  margin-inline-end: calc(0.5 * ${theme.base.spacing});
122
120
  }
121
+
122
+ ${StyledText} {
123
+ line-height: ${hitAreaCompact};
124
+ }
123
125
  `;
124
126
  });
125
127
  StyledHeadingText.defaultProps = defaultThemeProp;
126
128
  export const StyledCountMeta = styled(Text)(({ theme }) => {
127
- const hitAreaMouse = theme.base['hit-area']['mouse-min'];
128
- const hitAreaFinger = theme.base['hit-area']['finger-min'];
129
129
  return css `
130
- line-height: ${hitAreaMouse};
131
130
  white-space: nowrap;
132
131
  margin-inline-end: ${theme.base.spacing};
133
-
134
- @media (pointer: coarse) {
135
- line-height: ${hitAreaFinger};
136
- }
137
132
  `;
138
133
  });
139
134
  StyledCountMeta.defaultProps = defaultThemeProp;
@@ -146,7 +141,7 @@ export const StyledInfo = styled.div(({ status, theme: { components: { 'form-fie
146
141
  `);
147
142
  StyledInfo.defaultProps = defaultThemeProp;
148
143
  export const StyledSearchContainer = styled(Flex)(({ theme }) => css `
149
- margin-block: ${theme.base.spacing};
144
+ margin-block: calc(0.5 * ${theme.base.spacing});
150
145
 
151
146
  ${StyledSearchInput} {
152
147
  max-width: 100%;
@@ -1 +1 @@
1
- {"version":3,"file":"ListToolbar.styles.js","sourceRoot":"","sources":["../../../src/components/ListToolbar/ListToolbar.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,IAAI,EAAE,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,MAAM,EAAE,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACjD,OA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E,EACL,UAAU,EAAE,EAAE,YAAY,EAAE,SAAS,EAAE,EACxC,EACF,EAAE,EAAE,CAAC,GAAG,CAAA;MACL,MAAM;IACR,SAAS,CAAC,MAAM,CAAC;IACjB,GAAG,CAAA;eACQ,SAAS,CAAC,MAAM,CAAC,CAAC,cAAc,CAAC;KAC3C;GACF,CACF,CAAC;AAEF,UAAU,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE3C,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,IAAI,CAAC,CAC/C,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,GAAG,CAAA;oBACA,KAAK,CAAC,IAAI,CAAC,OAAO;;MAEhC,iBAAiB;;;GAGpB,CACF,CAAC;AAEF,qBAAqB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEtD,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,UAAU,CAAC,CAChD,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,GAAG,CAAA;iBACH,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,EAAE;GAC5C,CACF,CAAC;AAEF,gBAAgB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport type { FormControlProps } from '../FormControl';\nimport Icon from '../Icon';\nimport Flex from '../Flex';\nimport { StyledSearchInput } from '../SearchInput';\nimport Text, { StyledText } from '../Text';\nimport { defaultThemeProp } from '../../theme';\nimport { calculateFontSize } from '../../styles';\nimport type { FontSize } from '../../styles';\nimport Button, { StyledButton } from '../Button';\nimport FormDialog from '../Dialog/FormDialog';\nimport InfoDialog from '../Dialog/InfoDialog';\n\nexport const StyledExpandSearchButton = styled(Button)``;\nStyledExpandSearchButton.defaultProps = defaultThemeProp;\n\nexport const StyledSearchForm = styled.div`\n ${StyledSearchInput} {\n flex-grow: 1;\n max-width: min(100%, 40ch);\n }\n`;\n\nexport const StyledViewSelector = styled.button<{ required: boolean }>(({ theme, required }) => {\n const fontSizes = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n const { urgent } = theme.base.palette;\n const hitAreaMouse = theme.base['hit-area']['mouse-min'];\n const hitAreaFinger = theme.base['hit-area']['finger-min'];\n\n return css`\n flex-shrink: initial;\n white-space: initial;\n max-width: 100%;\n\n ${StyledText} {\n white-space: nowrap;\n font-size: ${fontSizes[theme.components.text.h3['font-size'] as FontSize]};\n font-weight: ${theme.components.text.h3['font-weight']};\n line-height: ${hitAreaMouse};\n word-break: break-word;\n @media (pointer: coarse) {\n line-height: ${hitAreaFinger};\n }\n }\n\n ${StyledText}::after {\n display: ${required ? 'inline-block' : 'none'};\n content: '\\\\00a0*';\n vertical-align: top;\n color: ${urgent};\n }\n `;\n});\n\nStyledViewSelector.defaultProps = defaultThemeProp;\n\nexport const StyledListToolbar = styled.div<{ isSmallOrAbove: boolean }>(\n ({ theme, isSmallOrAbove }) => {\n return css`\n width: 100%;\n margin-block-end: calc(0.5 * ${theme.base.spacing});\n\n ${isSmallOrAbove &&\n css`\n ${StyledExpandSearchButton} {\n margin-inline-start: calc(0.5 * ${theme.base.spacing});\n }\n\n ${StyledSearchInput} {\n margin-inline-start: ${theme.base.spacing};\n\n input {\n min-width: 20ch;\n }\n }\n `}\n `;\n }\n);\n\nStyledListToolbar.defaultProps = defaultThemeProp;\n\nexport const StyledListToolbarDialog = styled(FormDialog)(({ theme }) => {\n return css`\n min-width: min(${theme.base['content-width'].lg}, calc(100% - 2rem));\n max-width: calc(100vw - 4 * ${theme.base.spacing});\n `;\n});\n\nStyledListToolbarDialog.defaultProps = defaultThemeProp;\n\nexport const StyledListToolbarContent = styled(Flex)(({ theme }) => {\n return css`\n ${StyledButton} + ${StyledButton} {\n margin-inline-start: 0;\n }\n border-radius: calc(0.25 * ${theme.base['border-radius']});\n `;\n});\n\nStyledListToolbarContent.defaultProps = defaultThemeProp;\n\nexport const StyledErrorIcon = styled(Icon)(\n ({ theme }) => css`\n color: ${theme.base.palette.urgent};\n margin-inline-end: ${theme.base.spacing};\n `\n);\n\nStyledErrorIcon.defaultProps = defaultThemeProp;\n\nexport const StyledHeadingText = styled(Text)<{ required?: boolean }>(({ theme, required }) => {\n const { urgent } = theme.base.palette;\n const hitAreaMouse = theme.base['hit-area']['mouse-min'];\n const hitAreaFinger = theme.base['hit-area']['finger-min'];\n\n return css`\n min-width: 0;\n position: relative;\n line-height: ${hitAreaMouse};\n word-break: break-word;\n display: flex;\n align-items: center;\n ${required &&\n css`\n padding-inline-end: calc(1.5 * ${theme.base.spacing});\n `}\n @media (pointer: coarse) {\n line-height: ${hitAreaFinger};\n }\n &::after {\n display: ${required ? 'inline' : 'none'};\n content: '\\\\00a0*';\n vertical-align: top;\n color: ${urgent};\n position: absolute;\n inset-inline-end: 0;\n inset-block-start: 0;\n }\n\n ${StyledErrorIcon} {\n margin-inline-end: calc(0.5 * ${theme.base.spacing});\n }\n `;\n});\n\nStyledHeadingText.defaultProps = defaultThemeProp;\n\nexport const StyledCountMeta = styled(Text)(({ theme }) => {\n const hitAreaMouse = theme.base['hit-area']['mouse-min'];\n const hitAreaFinger = theme.base['hit-area']['finger-min'];\n\n return css`\n line-height: ${hitAreaMouse};\n white-space: nowrap;\n margin-inline-end: ${theme.base.spacing};\n\n @media (pointer: coarse) {\n line-height: ${hitAreaFinger};\n }\n `;\n});\n\nStyledCountMeta.defaultProps = defaultThemeProp;\n\nexport const StyledInfo = styled.div<Pick<FormControlProps, 'status'>>(\n ({\n status,\n theme: {\n components: { 'form-field': formField }\n }\n }) => css`\n ${status &&\n formField[status] &&\n css`\n color: ${formField[status]['status-color']};\n `}\n `\n);\n\nStyledInfo.defaultProps = defaultThemeProp;\n\nexport const StyledSearchContainer = styled(Flex)(\n ({ theme }) => css`\n margin-block: ${theme.base.spacing};\n\n ${StyledSearchInput} {\n max-width: 100%;\n }\n `\n);\n\nStyledSearchContainer.defaultProps = defaultThemeProp;\n\nexport const StyledInfoDialog = styled(InfoDialog)(\n ({ theme }) => css`\n max-width: ${theme.base['content-width'].sm};\n `\n);\n\nStyledInfoDialog.defaultProps = defaultThemeProp;\n"]}
1
+ {"version":3,"file":"ListToolbar.styles.js","sourceRoot":"","sources":["../../../src/components/ListToolbar/ListToolbar.styles.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,IAAI,EAAE,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,MAAM,EAAE,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACjD,OAAO,UAAU,MAAM,sBAAsB,CAAC;AAC9C,OAAO,UAAU,MAAM,sBAAsB,CAAC;AAE9C,MAAM,CAAC,MAAM,wBAAwB,GAAG,MAAM,CAAC,MAAM,CAAC,CAAA,EAAE,CAAC;AACzD,wBAAwB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEzD,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAA;IACtC,iBAAiB;;;;CAIpB,CAAC;AAEF,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,MAAM,CAAwB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC7F,MAAM,SAAS,GAAG,iBAAiB,CAAC,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC;IACvF,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC;IACtC,MAAM,YAAY,GAAG,KA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AAM,eAAe,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IACxD,OAAO,GAAG,CAAA;;yBAEa,KAAK,CAAC,IAAI,CAAC,OAAO;GACxC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEhD,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,GAAG,CAClC,CAAC,EACC,MAAM,EACN,KAAK,EAAE,EACL,UAAU,EAAE,EAAE,YAAY,EAAE,SAAS,EAAE,EACxC,EACF,EAAE,EAAE,CAAC,GAAG,CAAA;MACL,MAAM;IACR,SAAS,CAAC,MAAM,CAAC;IACjB,GAAG,CAAA;eACQ,SAAS,CAAC,MAAM,CAAC,CAAC,cAAc,CAAC;KAC3C;GACF,CACF,CAAC;AAEF,UAAU,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE3C,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,IAAI,CAAC,CAC/C,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,GAAG,CAAA;+BACW,KAAK,CAAC,IAAI,CAAC,OAAO;;MAE3C,iBAAiB;;;GAGpB,CACF,CAAC;AAEF,qBAAqB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEtD,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,UAAU,CAAC,CAChD,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,GAAG,CAAA;iBACH,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,EAAE;GAC5C,CACF,CAAC;AAEF,gBAAgB,CAAC,YAAY,GAAG,gBAAgB,CAAC","sourcesContent":["import styled, { css } from 'styled-components';\n\nimport type { FormControlProps } from '../FormControl';\nimport Icon from '../Icon';\nimport Flex from '../Flex';\nimport { StyledSearchInput } from '../SearchInput';\nimport Text, { StyledText } from '../Text';\nimport { defaultThemeProp } from '../../theme';\nimport { calculateFontSize } from '../../styles';\nimport type { FontSize } from '../../styles';\nimport Button, { StyledButton } from '../Button';\nimport FormDialog from '../Dialog/FormDialog';\nimport InfoDialog from '../Dialog/InfoDialog';\n\nexport const StyledExpandSearchButton = styled(Button)``;\nStyledExpandSearchButton.defaultProps = defaultThemeProp;\n\nexport const StyledSearchForm = styled.div`\n ${StyledSearchInput} {\n flex-grow: 1;\n max-width: min(100%, 40ch);\n }\n`;\n\nexport const StyledViewSelector = styled.button<{ required: boolean }>(({ theme, required }) => {\n const fontSizes = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n const { urgent } = theme.base.palette;\n const hitAreaMouse = theme.base['hit-area']['mouse-min'];\n const hitAreaFinger = theme.base['hit-area']['finger-min'];\n\n return css`\n flex-shrink: initial;\n white-space: initial;\n max-width: 100%;\n\n ${StyledText} {\n white-space: nowrap;\n font-size: ${fontSizes[theme.components.text.h2['font-size'] as FontSize]};\n font-weight: ${theme.components.text.h2['font-weight']};\n line-height: ${hitAreaMouse};\n word-break: break-word;\n @media (pointer: coarse) {\n line-height: ${hitAreaFinger};\n }\n }\n\n ${StyledText}::after {\n display: ${required ? 'inline-block' : 'none'};\n content: '\\\\00a0*';\n vertical-align: top;\n color: ${urgent};\n }\n `;\n});\n\nStyledViewSelector.defaultProps = defaultThemeProp;\n\nexport const StyledListToolbar = styled.div<{ isSmallOrAbove: boolean }>(\n ({ theme, isSmallOrAbove }) => {\n return css`\n width: 100%;\n margin-block-end: calc(0.5 * ${theme.base.spacing});\n\n ${isSmallOrAbove &&\n css`\n ${StyledExpandSearchButton} {\n margin-inline-start: calc(0.5 * ${theme.base.spacing});\n }\n\n ${StyledSearchInput} {\n margin-inline-start: ${theme.base.spacing};\n\n input {\n min-width: 20ch;\n }\n }\n `}\n `;\n }\n);\n\nStyledListToolbar.defaultProps = defaultThemeProp;\n\nexport const StyledListToolbarDialog = styled(FormDialog)(({ theme }) => {\n return css`\n min-width: min(${theme.base['content-width'].lg}, calc(100% - 2rem));\n max-width: calc(100vw - 4 * ${theme.base.spacing});\n `;\n});\n\nStyledListToolbarDialog.defaultProps = defaultThemeProp;\n\nexport const StyledListToolbarContent = styled(Flex)(({ theme }) => {\n return css`\n ${StyledButton} + ${StyledButton} {\n margin-inline-start: 0;\n }\n border-radius: calc(0.25 * ${theme.base['border-radius']});\n `;\n});\n\nStyledListToolbarContent.defaultProps = defaultThemeProp;\n\nexport const StyledErrorIcon = styled(Icon)(\n ({ theme }) => css`\n color: ${theme.base.palette.urgent};\n margin-inline-end: ${theme.base.spacing};\n `\n);\n\nStyledErrorIcon.defaultProps = defaultThemeProp;\n\nexport const StyledHeadingText = styled(Text)<{ required?: boolean }>(({ theme, required }) => {\n const { urgent } = theme.base.palette;\n const hitAreaCompact = theme.base['hit-area'].compact;\n\n return css`\n min-width: 0;\n position: relative;\n line-height: ${hitAreaCompact};\n word-break: break-word;\n display: flex;\n align-items: center;\n\n ${required &&\n css`\n padding-inline-end: calc(1.5 * ${theme.base.spacing});\n `}\n\n &::after {\n display: ${required ? 'inline' : 'none'};\n content: '\\\\00a0*';\n vertical-align: top;\n color: ${urgent};\n position: absolute;\n inset-inline-end: 0;\n inset-block-start: 0;\n }\n\n ${StyledErrorIcon} {\n margin-inline-end: calc(0.5 * ${theme.base.spacing});\n }\n\n ${StyledText} {\n line-height: ${hitAreaCompact};\n }\n `;\n});\n\nStyledHeadingText.defaultProps = defaultThemeProp;\n\nexport const StyledCountMeta = styled(Text)(({ theme }) => {\n return css`\n white-space: nowrap;\n margin-inline-end: ${theme.base.spacing};\n `;\n});\n\nStyledCountMeta.defaultProps = defaultThemeProp;\n\nexport const StyledInfo = styled.div<Pick<FormControlProps, 'status'>>(\n ({\n status,\n theme: {\n components: { 'form-field': formField }\n }\n }) => css`\n ${status &&\n formField[status] &&\n css`\n color: ${formField[status]['status-color']};\n `}\n `\n);\n\nStyledInfo.defaultProps = defaultThemeProp;\n\nexport const StyledSearchContainer = styled(Flex)(\n ({ theme }) => css`\n margin-block: calc(0.5 * ${theme.base.spacing});\n\n ${StyledSearchInput} {\n max-width: 100%;\n }\n `\n);\n\nStyledSearchContainer.defaultProps = defaultThemeProp;\n\nexport const StyledInfoDialog = styled(InfoDialog)(\n ({ theme }) => css`\n max-width: ${theme.base['content-width'].sm};\n `\n);\n\nStyledInfoDialog.defaultProps = defaultThemeProp;\n"]}
@@ -1,4 +1,4 @@
1
- import type { MouseEvent, Ref, ComponentType, ReactNode, MouseEventHandler } from 'react';
1
+ import type { MouseEvent, Ref, ComponentType, ReactNode } from 'react';
2
2
  import type { SearchInputProps } from '../SearchInput';
3
3
  import type { MenuGroupProps, MenuProps } from '../Menu';
4
4
  import type { Action, BaseProps, DeferInfer, ExcludeStrict, HeadingTag, TestIdProp } from '../../types';
@@ -95,19 +95,23 @@ export interface ListToolbarProps extends BaseProps, TestIdProp {
95
95
  /** value which holds the status of the wrap */
96
96
  enabled?: boolean;
97
97
  /** Callback that will fire to wrap the content when that button is clicked. */
98
- onClick: MouseEventHandler<HTMLButtonElement>;
98
+ onClick: (e: MouseEvent) => void;
99
99
  };
100
100
  /** Props related to the Search Input. */
101
101
  search?: SearchInputProps;
102
102
  /** Total returned results related for a given search. Optional indication of a selected item count. */
103
103
  count?: {
104
- total?: number;
104
+ total: number;
105
105
  /**
106
106
  * If true renders + next to total number.
107
107
  * @default false
108
108
  */
109
109
  totalHasMore?: boolean;
110
110
  selected?: number;
111
+ } | {
112
+ selected: number;
113
+ total?: never;
114
+ totalHasMore?: never;
111
115
  };
112
116
  /** Additional actions region */
113
117
  additionalActions?: ReactNode;
@@ -1 +1 @@
1
- {"version":3,"file":"ListToolbar.types.d.ts","sourceRoot":"","sources":["../../../src/components/ListToolbar/ListToolbar.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,aAAa,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE1F,OAAO,KAAK,EAAE,gBAAgB,EA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OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,+EAA+E;QAC/E,OAAO,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;KAClC,CAAC;IACF,yCAAyC;IACzC,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,uGAAuG;IACvG,KAAK,CAAC,EACF;QACE,KAAK,EAAE,MAAM,CAAC;QACd;;;WAGG;QACH,YAAY,CAAC,EAAE,OAAO,CAAC;QACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,GACD;QACE,QAAQ,EAAE,MAAM,CAAC;QACjB,KAAK,CAAC,EAAE,KAAK,CAAC;QACd,YAAY,CAAC,EAAE,KAAK,CAAC;KACtB,CAAC;IACN,gCAAgC;IAChC,iBAAiB,CAAC,EAAE,SAAS,CAAC;IAC9B,2DAA2D;IAC3D,MAAM,CAAC,EAAE,sBAAsB,GAAG,eAAe,CAAC;IAClD,yDAAyD;IACzD,IAAI,CAAC,EAAE,sBAAsB,GAAG,eAAe,CAAC;IAChD,0DAA0D;IAC1D,KAAK,CAAC,EAAE,sBAAsB,GAAG,eAAe,CAAC;IACjD,iCAAiC;IACjC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,0CAA0C;IAC1C,gBAAgB,CAAC,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC;IAC1C,oCAAoC;IACpC,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B"}
@@ -1 +1 @@
1
- {"version":3,"file":"ListToolbar.types.js","sourceRoot":"","sources":["../../../src/components/ListToolbar/ListToolbar.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { MouseEvent, Ref, ComponentType, ReactNode, MouseEventHandler } from 'react';\n\nimport type { SearchInputProps } from '../SearchInput';\nimport type { MenuGroupProps, MenuProps } from '../Menu';\nimport type {\n Action,\n BaseProps,\n DeferInfer,\n ExcludeStrict,\n HeadingTag,\n TestIdProp\n} from '../../types';\nimport type { AvatarProps } from '../Avatar';\nimport type { FormControlProps } from '../FormControl';\n\nexport interface ViewProps {\n /** Unique, stable identifier of this view. */\n id: string;\n /** Label text of this view. */\n text: string;\n /** Flag indicating whether this view is currently selected. */\n selected: boolean;\n /** A count to assist with number of associated items. */\n count?: number;\n /** A visual to assist identifying an item. */\n visual?: Pick<AvatarProps, 'name' | 'icon' | 'imageSrc' | 'status'>;\n}\n\nexport interface ViewGroupProps {\n /** Label text of the group. */\n text: MenuGroupProps['label'];\n /** Array of items belonging to the group. */\n items: ViewProps[];\n}\n\nexport interface ViewSelectorProps {\n /** A list of pre-defined data views. */\n views: (ViewProps | ViewGroupProps)[];\n /** Called when a view is selected. */\n onViewSelect: MenuProps['onItemClick'];\n /** Determines which view is the default. */\n defaultId?: string;\n /** Determines which view is the default in the app. */\n appDefaultId?: string;\n}\n\nexport interface QueryOption {\n /** A count representing the number of applied conditions within the query option. */\n count?: number;\n}\n\nexport interface QueryOptionDialogProps<P extends object = any> extends QueryOption {\n /** A component to render the content portion of the query option dialog. */\n renderer: ComponentType<P>;\n /**\n * A props object that will be passed to the content renderer.\n */\n rendererProps?: DeferInfer<P>;\n /**\n * Called when the user explicitly or implicitly cancels(closes) the query dialog.\n * Returning false will block the dialog from closing.\n */\n onCancel: () => boolean | void;\n /**\n * Called when the user explicitly applies the query option conditions.\n * Returning false will block the dialog from closing.\n */\n onSubmit: () => boolean | void;\n}\n\n/** Optionally provide query option presets. */\nexport interface PresetMenuProps extends QueryOption {\n /** Mode defining whether menu selection is single or multi mode. */\n mode?: ExcludeStrict<MenuProps['mode'], 'action'>;\n /** Items of the menu. */\n items: { id: string; text: string; selected: boolean; icon?: string }[];\n /** Callback invoked on item selection. Passes the item id as an argument. */\n onItemClick: MenuProps['onItemClick'];\n}\nexport type QueryOptionId = 'filter' | 'sort' | 'group';\n\nexport interface ListToolbarProps extends BaseProps, TestIdProp {\n /** Renders a simple text name of table */\n name: string;\n /**\n * Uses specific heading tag for header.\n * @default h3\n */\n headingTag?: HeadingTag;\n /** Renders a simple view heading text or view selection menu. */\n viewSelector?: ViewSelectorProps;\n /** Props related to list used as a form control. */\n formControlProps?: Pick<FormControlProps, 'required' | 'additionalInfo' | 'info' | 'status'>;\n /** Props related to new item creation button. */\n createNew?: {\n /** Label of the new item creation button. */\n label?: string;\n /** Callback that will render a Create new button and is fired when that button is clicked. */\n onClick: (e: MouseEvent) => void;\n };\n /** Props related to keyboard instructions. */\n keyboardInstructions?: ReactNode;\n /** Props related to wrap button. */\n wrap?: {\n /** value which holds the status of the wrap */\n enabled?: boolean;\n /** Callback that will fire to wrap the content when that button is clicked. */\n onClick: MouseEventHandler<HTMLButtonElement>;\n };\n /** Props related to the Search Input. */\n search?: SearchInputProps;\n /** Total returned results related for a given search. Optional indication of a selected item count. */\n count?: {\n total?: number;\n /**\n * If true renders + next to total number.\n * @default false\n */\n totalHasMore?: boolean;\n selected?: number;\n };\n /** Additional actions region */\n additionalActions?: ReactNode;\n /** Custom Rendering or available presets for filtering. */\n filter?: QueryOptionDialogProps | PresetMenuProps;\n /** Custom Rendering or available presets for sorting. */\n sort?: QueryOptionDialogProps | PresetMenuProps;\n /** Custom Rendering or available presets for grouping. */\n group?: QueryOptionDialogProps | PresetMenuProps;\n /** Top level dataset actions. */\n actions?: Action[];\n /** Ref for the actions button element. */\n actionsButtonRef?: Ref<HTMLButtonElement>;\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLDivElement>;\n}\n"]}
1
+ {"version":3,"file":"ListToolbar.types.js","sourceRoot":"","sources":["../../../src/components/ListToolbar/ListToolbar.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { MouseEvent, Ref, ComponentType, ReactNode } from 'react';\n\nimport type { SearchInputProps } from '../SearchInput';\nimport type { MenuGroupProps, MenuProps } from '../Menu';\nimport type {\n Action,\n BaseProps,\n DeferInfer,\n ExcludeStrict,\n HeadingTag,\n TestIdProp\n} from '../../types';\nimport type { AvatarProps } from '../Avatar';\nimport type { FormControlProps } from '../FormControl';\n\nexport interface ViewProps {\n /** Unique, stable identifier of this view. */\n id: string;\n /** Label text of this view. */\n text: string;\n /** Flag indicating whether this view is currently selected. */\n selected: boolean;\n /** A count to assist with number of associated items. */\n count?: number;\n /** A visual to assist identifying an item. */\n visual?: Pick<AvatarProps, 'name' | 'icon' | 'imageSrc' | 'status'>;\n}\n\nexport interface ViewGroupProps {\n /** Label text of the group. */\n text: MenuGroupProps['label'];\n /** Array of items belonging to the group. */\n items: ViewProps[];\n}\n\nexport interface ViewSelectorProps {\n /** A list of pre-defined data views. */\n views: (ViewProps | ViewGroupProps)[];\n /** Called when a view is selected. */\n onViewSelect: MenuProps['onItemClick'];\n /** Determines which view is the default. */\n defaultId?: string;\n /** Determines which view is the default in the app. */\n appDefaultId?: string;\n}\n\nexport interface QueryOption {\n /** A count representing the number of applied conditions within the query option. */\n count?: number;\n}\n\nexport interface QueryOptionDialogProps<P extends object = any> extends QueryOption {\n /** A component to render the content portion of the query option dialog. */\n renderer: ComponentType<P>;\n /**\n * A props object that will be passed to the content renderer.\n */\n rendererProps?: DeferInfer<P>;\n /**\n * Called when the user explicitly or implicitly cancels(closes) the query dialog.\n * Returning false will block the dialog from closing.\n */\n onCancel: () => boolean | void;\n /**\n * Called when the user explicitly applies the query option conditions.\n * Returning false will block the dialog from closing.\n */\n onSubmit: () => boolean | void;\n}\n\n/** Optionally provide query option presets. */\nexport interface PresetMenuProps extends QueryOption {\n /** Mode defining whether menu selection is single or multi mode. */\n mode?: ExcludeStrict<MenuProps['mode'], 'action'>;\n /** Items of the menu. */\n items: { id: string; text: string; selected: boolean; icon?: string }[];\n /** Callback invoked on item selection. Passes the item id as an argument. */\n onItemClick: MenuProps['onItemClick'];\n}\n\nexport type QueryOptionId = 'filter' | 'sort' | 'group';\n\nexport interface ListToolbarProps extends BaseProps, TestIdProp {\n /** Renders a simple text name of table */\n name: string;\n /**\n * Uses specific heading tag for header.\n * @default h3\n */\n headingTag?: HeadingTag;\n /** Renders a simple view heading text or view selection menu. */\n viewSelector?: ViewSelectorProps;\n /** Props related to list used as a form control. */\n formControlProps?: Pick<FormControlProps, 'required' | 'additionalInfo' | 'info' | 'status'>;\n /** Props related to new item creation button. */\n createNew?: {\n /** Label of the new item creation button. */\n label?: string;\n /** Callback that will render a Create new button and is fired when that button is clicked. */\n onClick: (e: MouseEvent) => void;\n };\n /** Props related to keyboard instructions. */\n keyboardInstructions?: ReactNode;\n /** Props related to wrap button. */\n wrap?: {\n /** value which holds the status of the wrap */\n enabled?: boolean;\n /** Callback that will fire to wrap the content when that button is clicked. */\n onClick: (e: MouseEvent) => void;\n };\n /** Props related to the Search Input. */\n search?: SearchInputProps;\n /** Total returned results related for a given search. Optional indication of a selected item count. */\n count?:\n | {\n total: number;\n /**\n * If true renders + next to total number.\n * @default false\n */\n totalHasMore?: boolean;\n selected?: number;\n }\n | {\n selected: number;\n total?: never;\n totalHasMore?: never;\n };\n /** Additional actions region */\n additionalActions?: ReactNode;\n /** Custom Rendering or available presets for filtering. */\n filter?: QueryOptionDialogProps | PresetMenuProps;\n /** Custom Rendering or available presets for sorting. */\n sort?: QueryOptionDialogProps | PresetMenuProps;\n /** Custom Rendering or available presets for grouping. */\n group?: QueryOptionDialogProps | PresetMenuProps;\n /** Top level dataset actions. */\n actions?: Action[];\n /** Ref for the actions button element. */\n actionsButtonRef?: Ref<HTMLButtonElement>;\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLDivElement>;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"CurrentLocationButton.d.ts","sourceRoot":"","sources":["../../../src/components/Location/CurrentLocationButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAahC,UAAU,oBAAoB;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,KAAK,aAAa,GAAG,oBAAoB,GAAG,mBAAmB,CAAC;AAEhE,MAAM,MAAM,0BAA0B,GAAG;IACvC,sFAAsF;IACtF,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC3C,2CAA2C;IAC3C,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAClC,CAAC;AAEF,QAAA,MAAM,qBAAqB,EAAE,EAAE,CAAC,0BAA0B,CAqDzD,CAAC;AACF,eAAe,qBAAqB,CAAC"}
1
+ {"version":3,"file":"CurrentLocationButton.d.ts","sourceRoot":"","sources":["../../../src/components/Location/CurrentLocationButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAahC,UAAU,oBAAoB;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,UAAU,mBAAmB;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,KAAK,aAAa,GAAG,oBAAoB,GAAG,mBAAmB,CAAC;AAEhE,MAAM,MAAM,0BAA0B,GAAG;IACvC,sFAAsF;IACtF,SAAS,CAAC,EAAE,CAAC,KAAK,EAAE,aAAa,KAAK,IAAI,CAAC;IAC3C,2CAA2C;IAC3C,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAClC,CAAC;AAEF,QAAA,MAAM,qBAAqB,EAAE,EAAE,CAAC,0BAA0B,CAuDzD,CAAC;AACF,eAAe,qBAAqB,CAAC"}
@@ -6,7 +6,7 @@ import Icon, { registerIcon } from '../Icon';
6
6
  import * as locationIcon from '../Icon/icons/location.icon';
7
7
  import Button from '../Button';
8
8
  import MapsContext from './MapsContext';
9
- import { getNavigatorPosition, getAddress, loadMapsAPI } from './utils';
9
+ import { getNavigatorPosition, loadMapsAPI } from './utils';
10
10
  registerIcon(locationIcon);
11
11
  const CurrentLocationButton = ({ onResolve, onError }) => {
12
12
  const t = useI18n();
@@ -21,7 +21,9 @@ const CurrentLocationButton = ({ onResolve, onError }) => {
21
21
  setCurrentLocationDisabled(true);
22
22
  throw error;
23
23
  })
24
- .then(([navigatorPosition]) => getAddress(navigatorPosition))
24
+ .then(([navigatorPosition, mapAPIObj]) => {
25
+ return mapAPIObj.getAddress(navigatorPosition);
26
+ })
25
27
  .then(address => {
26
28
  onResolve?.(address);
27
29
  })
@@ -1 +1 @@
1
- {"version":3,"file":"CurrentLocationButton.js","sourceRoot":"","sources":["../../../src/components/Location/CurrentLocationButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGrE,OAAO,OAAO,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,YAAY,MAAM,6BAA6B,CAAC;AAC5D,OAAO,MAAM,MAAM,WAAW,CAAC;AAE/B,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAExE,YAAY,CAAC,YAAY,CAAC,CAAC;AAuB3B,MAAM,qBAAqB,GAAmC,CAAC,EAC7D,SAAS,EACT,OAAO,EACoB,EAAE,EAAE;IAC/B,MAAM,CAAC,GAAG,OAAO,EAAE,CAAC;IACpB,MAAM,EAAE,IAAI,EAAE,GAAG,YAAY,EAAE,GAAG,UAAU,C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AAC;IACL,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,8BACE,KAAC,MAAM,IACL,GAAG,EAAE,KAAK,EACV,OAAO,EAAC,QAAQ,EAChB,IAAI,QACJ,OAAO,EAAE,kBAAkB,gBACf,CAAC,CAAC,iCAAiC,CAAC,EAChD,QAAQ,EAAE,uBAAuB,EACjC,OAAO,EAAE,IAAI,YAEb,KAAC,IAAI,IAAC,IAAI,EAAC,UAAU,GAAG,GACjB,EACR,EAAE,IAAI,uBAAuB,IAAI,CAChC,KAAC,OAAO,IAAC,KAAK,QAAC,MAAM,EAAE,EAAE,YACtB,CAAC,CAAC,iCAAiC,CAAC,GAC7B,CACX,IACA,CACJ,CAAC;AACJ,CAAC,CAAC;AACF,eAAe,qBAAqB,CAAC","sourcesContent":["import { useCallback, useContext, useEffect, useState } from 'react';\nimport type { FC } from 'react';\n\nimport Tooltip from '../Tooltip';\nimport { useElement, useI18n } from '../../hooks';\nimport Icon, { registerIcon } from '../Icon';\nimport * as locationIcon from '../Icon/icons/location.icon';\nimport Button from '../Button';\n\nimport MapsContext from './MapsContext';\nimport { getNavigatorPosition, getAddress, loadMapsAPI } from './utils';\n\nregisterIcon(locationIcon);\n\ninterface OnChangeAddressValue {\n name: string;\n address?: string;\n latitude?: number;\n longitude?: number;\n}\n\ninterface OnChangeCoordsValue {\n latitude: number;\n longitude: number;\n}\n\ntype OnChangeValue = OnChangeAddressValue | OnChangeCoordsValue;\n\nexport type CurrentLocationButtonProps = {\n /** Callback fired after click on my current location button if location was found. */\n onResolve?: (value: OnChangeValue) => void;\n /** Callback fired when an error occurs. */\n onError?: (error: Error) => void;\n};\n\nconst CurrentLocationButton: FC<CurrentLocationButtonProps> = ({\n onResolve,\n onError\n}: CurrentLocationButtonProps) => {\n const t = useI18n();\n const { name, ...providerOpts } = useContext(MapsContext);\n const [currentLocationDisabled, setCurrentLocationDisabled] = useState(false);\n const [busy, setBusy] = useState(false);\n const [el, setEl] = useElement();\n\n const getCurrentLocation = useCallback(() => {\n setBusy(true);\n Promise.all([getNavigatorPosition(), loadMapsAPI(name, providerOpts)])\n .catch(error => {\n setCurrentLocationDisabled(true);\n throw error;\n })\n .then(([navigatorPosition]) => getAddress(navigatorPosition))\n .then(address => {\n onResolve?.(address);\n })\n .catch(error => onError?.(error))\n .finally(() => setBusy(false));\n }, [onResolve, onError]);\n\n useEffect(() => {\n navigator.permissions?.query({ name: 'geolocation' }).then(result => {\n if (result.state === 'denied') {\n setCurrentLocationDisabled(true);\n }\n });\n }, []);\n\n return (\n <>\n <Button\n ref={setEl}\n variant='simple'\n icon\n onClick={getCurrentLocation}\n aria-label={t('my_current_location_button_a11y')}\n disabled={currentLocationDisabled}\n loading={busy}\n >\n <Icon name='location' />\n </Button>\n {el && currentLocationDisabled && (\n <Tooltip shown target={el}>\n {t('allow_location_permissions_text')}\n </Tooltip>\n )}\n </>\n );\n};\nexport default CurrentLocationButton;\n"]}
1
+ {"version":3,"file":"CurrentLocationButton.js","sourceRoot":"","sources":["../../../src/components/Location/CurrentLocationButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGrE,OAAO,OAAO,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,YAAY,MAAM,6BAA6B,CAAC;AAC5D,OAAO,MAAM,MAAM,WAAW,CAAC;AAE/B,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE5D,YAAY,CAAC,YAAY,CAAC,CAAC;AAuB3B,MAAM,qBAAqB,GAAmC,CAAC,EAC7D,SAAS,EACT,OAAO,EACoB,EAAE,EAAE;IAC/B,MAAM,CAA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,EAAE;YAClE,IAAI,MAAM,CAAC,KAAK,KAAK,QAAQ,EAAE,CAAC;gBAC9B,0BAA0B,CAAC,IAAI,CAAC,CAAC;YACnC,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,CACL,8BACE,KAAC,MAAM,IACL,GAAG,EAAE,KAAK,EACV,OAAO,EAAC,QAAQ,EAChB,IAAI,QACJ,OAAO,EAAE,kBAAkB,gBACf,CAAC,CAAC,iCAAiC,CAAC,EAChD,QAAQ,EAAE,uBAAuB,EACjC,OAAO,EAAE,IAAI,YAEb,KAAC,IAAI,IAAC,IAAI,EAAC,UAAU,GAAG,GACjB,EACR,EAAE,IAAI,uBAAuB,IAAI,CAChC,KAAC,OAAO,IAAC,KAAK,QAAC,MAAM,EAAE,EAAE,YACtB,CAAC,CAAC,iCAAiC,CAAC,GAC7B,CACX,IACA,CACJ,CAAC;AACJ,CAAC,CAAC;AACF,eAAe,qBAAqB,CAAC","sourcesContent":["import { useCallback, useContext, useEffect, useState } from 'react';\nimport type { FC } from 'react';\n\nimport Tooltip from '../Tooltip';\nimport { useElement, useI18n } from '../../hooks';\nimport Icon, { registerIcon } from '../Icon';\nimport * as locationIcon from '../Icon/icons/location.icon';\nimport Button from '../Button';\n\nimport MapsContext from './MapsContext';\nimport { getNavigatorPosition, loadMapsAPI } from './utils';\n\nregisterIcon(locationIcon);\n\ninterface OnChangeAddressValue {\n name: string;\n address?: string;\n latitude?: number;\n longitude?: number;\n}\n\ninterface OnChangeCoordsValue {\n latitude: number;\n longitude: number;\n}\n\ntype OnChangeValue = OnChangeAddressValue | OnChangeCoordsValue;\n\nexport type CurrentLocationButtonProps = {\n /** Callback fired after click on my current location button if location was found. */\n onResolve?: (value: OnChangeValue) => void;\n /** Callback fired when an error occurs. */\n onError?: (error: Error) => void;\n};\n\nconst CurrentLocationButton: FC<CurrentLocationButtonProps> = ({\n onResolve,\n onError\n}: CurrentLocationButtonProps) => {\n const t = useI18n();\n const { name, ...providerOpts } = useContext(MapsContext);\n const [currentLocationDisabled, setCurrentLocationDisabled] = useState(false);\n const [busy, setBusy] = useState(false);\n const [el, setEl] = useElement();\n\n const getCurrentLocation = useCallback(() => {\n setBusy(true);\n Promise.all([getNavigatorPosition(), loadMapsAPI(name, providerOpts)])\n .catch(error => {\n setCurrentLocationDisabled(true);\n throw error;\n })\n .then(([navigatorPosition, mapAPIObj]) => {\n return mapAPIObj.getAddress(navigatorPosition);\n })\n .then(address => {\n onResolve?.(address);\n })\n .catch(error => onError?.(error))\n .finally(() => setBusy(false));\n }, [onResolve, onError]);\n\n useEffect(() => {\n navigator.permissions?.query({ name: 'geolocation' }).then(result => {\n if (result.state === 'denied') {\n setCurrentLocationDisabled(true);\n }\n });\n }, []);\n\n return (\n <>\n <Button\n ref={setEl}\n variant='simple'\n icon\n onClick={getCurrentLocation}\n aria-label={t('my_current_location_button_a11y')}\n disabled={currentLocationDisabled}\n loading={busy}\n >\n <Icon name='location' />\n </Button>\n {el && currentLocationDisabled && (\n <Tooltip shown target={el}>\n {t('allow_location_permissions_text')}\n </Tooltip>\n )}\n </>\n );\n};\nexport default CurrentLocationButton;\n"]}
@@ -0,0 +1,43 @@
1
+ import { type Bias, type LatLng, type Location } from './Location.types';
2
+ import type { LocationAPI } from './LocationAPI.types';
3
+ export default class GoogleMapsAPI implements LocationAPI {
4
+ private version;
5
+ /** Returns coordinations for given input: either coords, address or current position. */
6
+ getCoords: (coords: string | "current" | LatLng, mapElement?: HTMLDivElement) => Promise<LatLng>;
7
+ getPlace: (location: string, mapElement?: HTMLDivElement) => Promise<LatLng>;
8
+ getPlaceById: (placeId: string, sessionToken?: google.maps.places.AutocompleteSessionToken, mapElement?: HTMLDivElement) => Promise<Location>;
9
+ getAddress: (coords: LatLng) => Promise<{
10
+ name: string;
11
+ address?: string;
12
+ latitude: number;
13
+ longitude: number;
14
+ }>;
15
+ getPlacePredictionsUtil: (location: string, bias?: Bias) => Promise<{
16
+ placeSuggestions: {
17
+ placeId: string;
18
+ mainText: string;
19
+ secondaryText: string;
20
+ }[];
21
+ token: google.maps.places.AutocompleteSessionToken;
22
+ }>;
23
+ getPlaceSuggestionsUtil: (location: string, bias?: Bias) => Promise<{
24
+ placeSuggestions: {
25
+ placeId: string;
26
+ mainText: string;
27
+ secondaryText: string;
28
+ }[];
29
+ token: google.maps.places.AutocompleteSessionToken;
30
+ }>;
31
+ /** Returns an array of place prediction objects ('place' can be an establishment, geographic location, or prominent point of interest)
32
+ * and session token (valid for multiple queries, followed by one place selection).
33
+ */
34
+ getPlacePredictions: (location: string, bias?: Bias) => Promise<{
35
+ placeSuggestions: {
36
+ placeId: string;
37
+ mainText: string;
38
+ secondaryText: string;
39
+ }[];
40
+ token: google.maps.places.AutocompleteSessionToken;
41
+ }>;
42
+ }
43
+ //# sourceMappingURL=GoogleMapsAPI.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GoogleMapsAPI.d.ts","sourceRoot":"","sources":["../../../src/components/Location/GoogleMapsAPI.ts"],"names":[],"mappings":"AACA,OAAO,EAML,KAAK,IAAI,EACT,KAAK,MAAM,EACX,KAAK,QAAQ,EACd,MAAM,kBAAkB,CAAC;AAS1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,MAAM,CAAC,OAAO,OAAO,aAAc,YAAW,WAAW;IACvD,OAAO,CAAC,OAAO,CAAqB;IAEpC,yFAAyF;IACzF,SAAS,GACP,QAAQ,MAAM,GAAG,SAAS,GAAG,MAAM,EACnC,aAAa,cAAc,KAC1B,OAAO,CAAC,MAAM,CAAC,CAuChB;IAEF,QAAQ,GACN,UAAU,MAAM,EAChB,aAAY,cAA8C,KACzD,OAAO,CAAC,MAAM,CAAC,CAsBhB;IAEF,YAAY,GACV,SAAS,MAAM,EACf,eAAc,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,wBAA4E,EAC7G,aAAY,cAA8C,KACzD,OAAO,CAAC,QAAQ,CAAC,CAmBlB;IAEF,UAAU,GACR,QAAQ,MAAM,KACb,OAAO,CAAC;QACT,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC,CAkCA;IAEF,uBAAuB,GACrB,UAAU,MAAM,EAChB,OAAM,IAAS,KACd,OAAO,CAAC;QACT,gBAAgB,EAAE;YAChB,OAAO,EAAE,MAAM,CAAC;YAChB,QAAQ,EAAE,MAAM,CAAC;YACjB,aAAa,EAAE,MAAM,CAAC;SACvB,EAAE,CAAC;QACJ,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,wBAAwB,CAAC;KACpD,CAAC,CA8CA;IAEF,uBAAuB,GACrB,UAAU,MAAM,EAChB,OAAM,IAAS,KACd,OAAO,CAAC;QACT,gBAAgB,EAAE;YAChB,OAAO,EAAE,MAAM,CAAC;YAChB,QAAQ,EAAE,MAAM,CAAC;YACjB,aAAa,EAAE,MAAM,CAAC;SACvB,EAAE,CAAC;QACJ,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,wBAAwB,CAAC;KACpD,CAAC,CA2DA;IAEF;;OAEG;IACH,mBAAmB,GACjB,UAAU,MAAM,EAChB,OAAO,IAAI,KACV,OAAO,CAAC;QACT,gBAAgB,EAAE;YAChB,OAAO,EAAE,MAAM,CAAC;YAChB,QAAQ,EAAE,MAAM,CAAC;YACjB,aAAa,EAAE,MAAM,CAAC;SACvB,EAAE,CAAC;QACJ,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,wBAAwB,CAAC;KACpD,CAAC,CAkBA;CACH"}
@@ -0,0 +1,244 @@
1
+ /* eslint-disable class-methods-use-this */
2
+ import { CoordsCannotBeParsedError, GeocoderFailedError, LocationNotFoundError, QUERY_FIELDS, QUERY_TYPES } from './Location.types';
3
+ import { getNavigatorPosition, isValueDegreeFormatCoordinate, isValueDMCoordinate, isValueDMSCoordinate, parseDMS, toGoogleLatLng } from './utils';
4
+ export default class GoogleMapsAPI {
5
+ version = 'v2';
6
+ /** Returns coordinations for given input: either coords, address or current position. */
7
+ getCoords = async (coords, mapElement) => {
8
+ if (coords === '' || coords === undefined)
9
+ throw new Error();
10
+ if (coords === 'current')
11
+ return getNavigatorPosition();
12
+ let location;
13
+ if (typeof coords === 'string') {
14
+ let latLng = [];
15
+ if (isValueDMSCoordinate(coords) ||
16
+ isValueDMCoordinate(coords) ||
17
+ isValueDegreeFormatCoordinate(coords)) {
18
+ latLng = parseDMS(coords);
19
+ }
20
+ else {
21
+ let splitter;
22
+ if (coords.includes(', ')) {
23
+ splitter = ', ';
24
+ }
25
+ else if (coords.includes(',')) {
26
+ splitter = ',';
27
+ }
28
+ else if (coords.includes(' ')) {
29
+ splitter = ' ';
30
+ }
31
+ else {
32
+ splitter = ', ';
33
+ }
34
+ latLng = coords.split(splitter).map(Number);
35
+ }
36
+ const [lat, lng] = latLng;
37
+ if (Number.isNaN(lat) || Number.isNaN(lng) || lat === undefined || lng === undefined)
38
+ return this.getPlace(coords, mapElement);
39
+ location = { latitude: lat, longitude: lng };
40
+ }
41
+ else {
42
+ location = coords;
43
+ }
44
+ if (Number.isFinite(location.latitude) && Number.isFinite(location.longitude))
45
+ return location;
46
+ throw new Error(CoordsCannotBeParsedError);
47
+ };
48
+ getPlace = async (location, mapElement = document.createElement('div')) => {
49
+ const placesService = new google.maps.places.PlacesService(mapElement);
50
+ const { placeSuggestions, token } = await this.getPlacePredictions(location);
51
+ return new Promise((resolve, reject) => {
52
+ placesService.getDetails({
53
+ placeId: placeSuggestions[0]?.placeId,
54
+ fields: QUERY_FIELDS,
55
+ sessionToken: token
56
+ }, (place, pStatus) => {
57
+ if (pStatus === google.maps.places.PlacesServiceStatus.OK) {
58
+ resolve({
59
+ latitude: place?.geometry?.location?.lat() ?? NaN,
60
+ longitude: place?.geometry?.location?.lng() ?? NaN
61
+ });
62
+ }
63
+ else {
64
+ reject(new Error(LocationNotFoundError));
65
+ }
66
+ });
67
+ });
68
+ };
69
+ getPlaceById = async (placeId, sessionToken = new google.maps.places.AutocompleteSessionToken(), mapElement = document.createElement('div')) => {
70
+ const placesService = new google.maps.places.PlacesService(mapElement);
71
+ return new Promise((resolve, reject) => {
72
+ placesService.getDetails({ placeId, fields: QUERY_FIELDS, sessionToken }, (place, pStatus) => {
73
+ if (pStatus === google.maps.places.PlacesServiceStatus.OK) {
74
+ resolve({
75
+ name: place?.name,
76
+ address: place?.formatted_address,
77
+ latitude: place?.geometry?.location?.lat(),
78
+ longitude: place?.geometry?.location?.lng()
79
+ });
80
+ }
81
+ else {
82
+ reject(new Error(LocationNotFoundError));
83
+ }
84
+ });
85
+ });
86
+ };
87
+ getAddress = async (coords) => {
88
+ const location = {
89
+ lat: coords.latitude,
90
+ lng: coords.longitude
91
+ };
92
+ const geocoder = new google.maps.Geocoder();
93
+ return new Promise((resolve, reject) => {
94
+ geocoder.geocode({ location }, (results, status) => {
95
+ if (status === 'OK') {
96
+ const [result] = results ?? [];
97
+ if (result) {
98
+ resolve({
99
+ name: result.formatted_address,
100
+ address: result.formatted_address,
101
+ ...(result.geometry && {
102
+ latitude: result.geometry.location.lat(),
103
+ longitude: result.geometry.location.lng()
104
+ })
105
+ });
106
+ }
107
+ else {
108
+ resolve({
109
+ name: `${coords.latitude}, ${coords.longitude}`,
110
+ latitude: coords.latitude,
111
+ longitude: coords.longitude
112
+ });
113
+ }
114
+ }
115
+ else {
116
+ reject(new Error(`${GeocoderFailedError}: ${status}`));
117
+ }
118
+ });
119
+ });
120
+ };
121
+ getPlacePredictionsUtil = async (location, bias = {}) => {
122
+ const autocompleteService = new google.maps.places.AutocompleteService();
123
+ const optionalParams = {};
124
+ if (bias?.location) {
125
+ if (bias?.location.center === 'current') {
126
+ await getNavigatorPosition()
127
+ .then(coords => {
128
+ optionalParams.location = toGoogleLatLng(coords);
129
+ if (bias.location)
130
+ optionalParams.radius = bias.location.radius;
131
+ })
132
+ // no-op user didn't allow location
133
+ .catch(() => { });
134
+ }
135
+ else {
136
+ optionalParams.location = toGoogleLatLng(bias.location.center);
137
+ optionalParams.radius = bias.location.radius;
138
+ }
139
+ }
140
+ if (bias?.bounds) {
141
+ const [sw, ne] = bias.bounds;
142
+ optionalParams.bounds = new google.maps.LatLngBounds(toGoogleLatLng(sw), toGoogleLatLng(ne));
143
+ }
144
+ return new Promise((resolve, reject) => {
145
+ const token = new google.maps.places.AutocompleteSessionToken();
146
+ autocompleteService.getPlacePredictions({
147
+ input: location,
148
+ types: QUERY_TYPES,
149
+ sessionToken: token,
150
+ ...optionalParams
151
+ }, (placePredictions, status) => {
152
+ if (status === google.maps.places.PlacesServiceStatus.OK) {
153
+ const res = placePredictions?.map(p => ({
154
+ placeId: p.place_id,
155
+ mainText: p.structured_formatting.main_text,
156
+ secondaryText: p.structured_formatting.secondary_text
157
+ }));
158
+ resolve({ placeSuggestions: res?.length ? res : [], token });
159
+ }
160
+ else {
161
+ reject(new Error(LocationNotFoundError));
162
+ }
163
+ });
164
+ });
165
+ };
166
+ getPlaceSuggestionsUtil = async (location, bias = {}) => {
167
+ const { AutocompleteSuggestion } = google.maps.places;
168
+ const optionalParams = {};
169
+ if (bias?.location) {
170
+ if (bias?.location.center === 'current') {
171
+ await getNavigatorPosition()
172
+ .then(coords => {
173
+ const b = new google.maps.Circle({
174
+ center: toGoogleLatLng(coords)
175
+ });
176
+ if (bias.location) {
177
+ b.setRadius(bias.location.radius);
178
+ }
179
+ optionalParams.locationBias = b;
180
+ })
181
+ // no-op user didn't allow location
182
+ .catch(() => { });
183
+ }
184
+ else {
185
+ optionalParams.locationBias = new google.maps.Circle({
186
+ center: toGoogleLatLng(bias.location.center),
187
+ radius: bias.location.radius
188
+ });
189
+ }
190
+ }
191
+ if (bias?.bounds) {
192
+ const [sw, ne] = bias.bounds;
193
+ optionalParams.locationRestriction = new google.maps.LatLngBounds(toGoogleLatLng(sw), toGoogleLatLng(ne));
194
+ }
195
+ const token = new google.maps.places.AutocompleteSessionToken();
196
+ const rp = {
197
+ input: location,
198
+ sessionToken: token,
199
+ ...optionalParams
200
+ };
201
+ return new Promise((resolve, reject) => {
202
+ AutocompleteSuggestion.fetchAutocompleteSuggestions(rp)
203
+ .then(({ suggestions }) => {
204
+ const res = suggestions
205
+ ?.map(s => s.placePrediction)
206
+ .filter(p => p !== null)
207
+ .map(p => ({
208
+ placeId: p.placeId,
209
+ mainText: p.mainText?.text ?? '',
210
+ secondaryText: p.secondaryText?.text ?? ''
211
+ }));
212
+ resolve({ placeSuggestions: res ?? [], token });
213
+ })
214
+ .catch(() => {
215
+ reject(new Error(LocationNotFoundError));
216
+ });
217
+ });
218
+ };
219
+ /** Returns an array of place prediction objects ('place' can be an establishment, geographic location, or prominent point of interest)
220
+ * and session token (valid for multiple queries, followed by one place selection).
221
+ */
222
+ getPlacePredictions = async (location, bias) => {
223
+ return new Promise((resolve, reject) => {
224
+ try {
225
+ if (this.version === 'v2') {
226
+ resolve(this.getPlaceSuggestionsUtil(location, bias));
227
+ }
228
+ else {
229
+ resolve(this.getPlacePredictionsUtil(location, bias));
230
+ }
231
+ }
232
+ catch (error) {
233
+ if (this.version === 'v2') {
234
+ if (error instanceof Error && 'name' in Error && error.name === 'RPCError') {
235
+ this.version = 'v1';
236
+ resolve(this.getPlacePredictions(location, bias));
237
+ }
238
+ reject(error);
239
+ }
240
+ }
241
+ });
242
+ };
243
+ }
244
+ //# sourceMappingURL=GoogleMapsAPI.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GoogleMapsAPI.js","sourceRoot":"","sources":["../../../src/components/Location/GoogleMapsAPI.ts"],"names":[],"mappings":"AAAA,2CAA2C;AAC3C,OAAO,EACL,yBAAyB,EACzB,mBAAmB,EACnB,qBAAqB,EACrB,YAAY,EACZ,WAAW,EAIZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,oBAAoB,EACpB,6BAA6B,EAC7B,mBA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;gBACxD,CAAC;YACH,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,IAAI,IAAI,CAAC,OAAO,KAAK,IAAI,EAAE,CAAC;oBAC1B,IAAI,KAAK,YAAY,KAAK,IAAI,MAAM,IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;wBAC3E,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;wBACpB,OAAO,CAAC,IAAI,CAAC,mBAAmB,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,CAAC;oBACpD,CAAC;oBACD,MAAM,CAAC,KAAK,CAAC,CAAC;gBAChB,CAAC;YACH,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;CACH","sourcesContent":["/* eslint-disable class-methods-use-this */\nimport {\n CoordsCannotBeParsedError,\n GeocoderFailedError,\n LocationNotFoundError,\n QUERY_FIELDS,\n QUERY_TYPES,\n type Bias,\n type LatLng,\n type Location\n} from './Location.types';\nimport {\n getNavigatorPosition,\n isValueDegreeFormatCoordinate,\n isValueDMCoordinate,\n isValueDMSCoordinate,\n parseDMS,\n toGoogleLatLng\n} from './utils';\nimport type { LocationAPI } from './LocationAPI.types';\n\nexport default class GoogleMapsAPI implements LocationAPI {\n private version: 'v1' | 'v2' = 'v2';\n\n /** Returns coordinations for given input: either coords, address or current position. */\n getCoords = async (\n coords: string | 'current' | LatLng,\n mapElement?: HTMLDivElement\n ): Promise<LatLng> => {\n if (coords === '' || coords === undefined) throw new Error();\n if (coords === 'current') return getNavigatorPosition();\n\n let location: LatLng;\n if (typeof coords === 'string') {\n let latLng: number[] = [];\n if (\n isValueDMSCoordinate(coords) ||\n isValueDMCoordinate(coords) ||\n isValueDegreeFormatCoordinate(coords)\n ) {\n latLng = parseDMS(coords);\n } else {\n let splitter;\n if (coords.includes(', ')) {\n splitter = ', ';\n } else if (coords.includes(',')) {\n splitter = ',';\n } else if (coords.includes(' ')) {\n splitter = ' ';\n } else {\n splitter = ', ';\n }\n\n latLng = coords.split(splitter).map(Number);\n }\n\n const [lat, lng] = latLng;\n if (Number.isNaN(lat) || Number.isNaN(lng) || lat === undefined || lng === undefined)\n return this.getPlace(coords, mapElement);\n location = { latitude: lat, longitude: lng };\n } else {\n location = coords;\n }\n\n if (Number.isFinite(location.latitude) && Number.isFinite(location.longitude)) return location;\n\n throw new Error(CoordsCannotBeParsedError);\n };\n\n getPlace = async (\n location: string,\n mapElement: HTMLDivElement = document.createElement('div')\n ): Promise<LatLng> => {\n const placesService = new google.maps.places.PlacesService(mapElement);\n const { placeSuggestions, token } = await this.getPlacePredictions(location);\n return new Promise((resolve, reject) => {\n placesService.getDetails(\n {\n placeId: placeSuggestions[0]?.placeId,\n fields: QUERY_FIELDS,\n sessionToken: token\n },\n (place, pStatus) => {\n if (pStatus === google.maps.places.PlacesServiceStatus.OK) {\n resolve({\n latitude: place?.geometry?.location?.lat() ?? NaN,\n longitude: place?.geometry?.location?.lng() ?? NaN\n });\n } else {\n reject(new Error(LocationNotFoundError));\n }\n }\n );\n });\n };\n\n getPlaceById = async (\n placeId: string,\n sessionToken: google.maps.places.AutocompleteSessionToken = new google.maps.places.AutocompleteSessionToken(),\n mapElement: HTMLDivElement = document.createElement('div')\n ): Promise<Location> => {\n const placesService = new google.maps.places.PlacesService(mapElement);\n return new Promise((resolve, reject) => {\n placesService.getDetails(\n { placeId, fields: QUERY_FIELDS, sessionToken },\n (place, pStatus) => {\n if (pStatus === google.maps.places.PlacesServiceStatus.OK) {\n resolve({\n name: place?.name,\n address: place?.formatted_address,\n latitude: place?.geometry?.location?.lat(),\n longitude: place?.geometry?.location?.lng()\n });\n } else {\n reject(new Error(LocationNotFoundError));\n }\n }\n );\n });\n };\n\n getAddress = async (\n coords: LatLng\n ): Promise<{\n name: string;\n address?: string;\n latitude: number;\n longitude: number;\n }> => {\n const location = {\n lat: coords.latitude,\n lng: coords.longitude\n };\n const geocoder = new google.maps.Geocoder();\n return new Promise((resolve, reject) => {\n geocoder.geocode(\n { location },\n (results: google.maps.GeocoderResult[] | null, status: google.maps.GeocoderStatus) => {\n if (status === 'OK') {\n const [result] = results ?? [];\n if (result) {\n resolve({\n name: result.formatted_address,\n address: result.formatted_address,\n ...(result.geometry && {\n latitude: result.geometry.location.lat(),\n longitude: result.geometry.location.lng()\n })\n });\n } else {\n resolve({\n name: `${coords.latitude}, ${coords.longitude}`,\n latitude: coords.latitude,\n longitude: coords.longitude\n });\n }\n } else {\n reject(new Error(`${GeocoderFailedError}: ${status}`));\n }\n }\n );\n });\n };\n\n getPlacePredictionsUtil = async (\n location: string,\n bias: Bias = {}\n ): Promise<{\n placeSuggestions: {\n placeId: string;\n mainText: string;\n secondaryText: string;\n }[];\n token: google.maps.places.AutocompleteSessionToken;\n }> => {\n const autocompleteService = new google.maps.places.AutocompleteService();\n const optionalParams: Partial<google.maps.places.AutocompletionRequest> = {};\n if (bias?.location) {\n if (bias?.location.center === 'current') {\n await getNavigatorPosition()\n .then(coords => {\n optionalParams.location = toGoogleLatLng(coords);\n if (bias.location) optionalParams.radius = bias.location.radius;\n })\n // no-op user didn't allow location\n .catch(() => {});\n } else {\n optionalParams.location = toGoogleLatLng(bias.location.center);\n optionalParams.radius = bias.location.radius;\n }\n }\n\n if (bias?.bounds) {\n const [sw, ne] = bias.bounds;\n optionalParams.bounds = new google.maps.LatLngBounds(toGoogleLatLng(sw), toGoogleLatLng(ne));\n }\n return new Promise((resolve, reject) => {\n const token = new google.maps.places.AutocompleteSessionToken();\n autocompleteService.getPlacePredictions(\n {\n input: location,\n types: QUERY_TYPES,\n sessionToken: token,\n ...optionalParams\n },\n (placePredictions, status) => {\n if (status === google.maps.places.PlacesServiceStatus.OK) {\n const res = placePredictions?.map(p => ({\n placeId: p.place_id,\n mainText: p.structured_formatting.main_text,\n secondaryText: p.structured_formatting.secondary_text\n }));\n\n resolve({ placeSuggestions: res?.length ? res : [], token });\n } else {\n reject(new Error(LocationNotFoundError));\n }\n }\n );\n });\n };\n\n getPlaceSuggestionsUtil = async (\n location: string,\n bias: Bias = {}\n ): Promise<{\n placeSuggestions: {\n placeId: string;\n mainText: string;\n secondaryText: string;\n }[];\n token: google.maps.places.AutocompleteSessionToken;\n }> => {\n const { AutocompleteSuggestion } = google.maps.places;\n const optionalParams: Partial<google.maps.places.AutocompleteRequest> = {};\n if (bias?.location) {\n if (bias?.location.center === 'current') {\n await getNavigatorPosition()\n .then(coords => {\n const b = new google.maps.Circle({\n center: toGoogleLatLng(coords)\n });\n\n if (bias.location) {\n b.setRadius(bias.location.radius);\n }\n optionalParams.locationBias = b;\n })\n // no-op user didn't allow location\n .catch(() => {});\n } else {\n optionalParams.locationBias = new google.maps.Circle({\n center: toGoogleLatLng(bias.location.center),\n radius: bias.location.radius\n });\n }\n }\n\n if (bias?.bounds) {\n const [sw, ne] = bias.bounds;\n optionalParams.locationRestriction = new google.maps.LatLngBounds(\n toGoogleLatLng(sw),\n toGoogleLatLng(ne)\n );\n }\n\n const token = new google.maps.places.AutocompleteSessionToken();\n\n const rp: google.maps.places.AutocompleteRequest = {\n input: location,\n sessionToken: token,\n ...optionalParams\n };\n\n return new Promise((resolve, reject) => {\n AutocompleteSuggestion.fetchAutocompleteSuggestions(rp)\n .then(({ suggestions }) => {\n const res = suggestions\n ?.map(s => s.placePrediction)\n .filter(p => p !== null)\n .map(p => ({\n placeId: p.placeId,\n mainText: p.mainText?.text ?? '',\n secondaryText: p.secondaryText?.text ?? ''\n }));\n resolve({ placeSuggestions: res ?? [], token });\n })\n .catch(() => {\n reject(new Error(LocationNotFoundError));\n });\n });\n };\n\n /** Returns an array of place prediction objects ('place' can be an establishment, geographic location, or prominent point of interest)\n * and session token (valid for multiple queries, followed by one place selection).\n */\n getPlacePredictions = async (\n location: string,\n bias?: Bias\n ): Promise<{\n placeSuggestions: {\n placeId: string;\n mainText: string;\n secondaryText: string;\n }[];\n token: google.maps.places.AutocompleteSessionToken;\n }> => {\n return new Promise((resolve, reject) => {\n try {\n if (this.version === 'v2') {\n resolve(this.getPlaceSuggestionsUtil(location, bias));\n } else {\n resolve(this.getPlacePredictionsUtil(location, bias));\n }\n } catch (error) {\n if (this.version === 'v2') {\n if (error instanceof Error && 'name' in Error && error.name === 'RPCError') {\n this.version = 'v1';\n resolve(this.getPlacePredictions(location, bias));\n }\n reject(error);\n }\n }\n });\n };\n}\n"]}
@@ -1,5 +1,6 @@
1
1
  /// <reference types="google.maps" preserve="true" />
2
2
  import type { ReactNode } from 'react';
3
+ import type { LocationAPI } from './LocationAPI.types';
3
4
  export declare type LatLng = {
4
5
  /** The latitude representation. */
5
6
  latitude: ReturnType<google.maps.LatLng['lat']>;
@@ -27,8 +28,8 @@ export declare type ProviderOpts = {
27
28
  };
28
29
  export interface MapsProvider {
29
30
  name: string;
30
- loadAPI: (options: ProviderOpts) => Promise<void>;
31
- loadedPromise: Promise<void> | null;
31
+ loadAPI: (options: ProviderOpts) => Promise<LocationAPI>;
32
+ loadedPromise: Promise<LocationAPI> | null;
32
33
  loadedApiKey: string;
33
34
  }
34
35
  export declare const QUERY_FIELDS: string[];
@@ -1 +1 @@
1
- {"version":3,"file":"Location.types.d.ts","sourceRoot":"","sources":["../../../src/components/Location/Location.types.ts"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,MAAM,CAAC,OAAO,MAAM,MAAM,GAAG;IAC3B,mCAAmC;IACnC,QAAQ,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IAChD,oCAAoC;IACpC,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;CAClD,CAAC;AAEF,MAAM,CAAC,OAAO,MAAM,IAAI,GAAG;IACzB;uGACmG;IACnG,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1B,wEAAwE;IACxE,QAAQ,CAAC,EAAE;QACT,8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C,CAAC,CAAC;IACjD,SAAS,CAAC,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;CACnD;AAED,MAAM,WAAW,GAAI,SAAQ,MAAM;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
1
+ {"version":3,"file":"Location.types.d.ts","sourceRoot":"","sources":["../../../src/components/Location/Location.types.ts"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,MAAM,CAAC,OAAO,MAAM,MAAM,GAAG;IAC3B,mCAAmC;IACnC,QAAQ,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IAChD,oCAAoC;IACpC,SAAS,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;CAClD,CAAC;AAEF,MAAM,CAAC,OAAO,MAAM,IAAI,GAAG;IACzB;uGACmG;IACnG,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC1B,wEAAwE;IACxE,QAAQ,CAAC,EAAE;QACT,8CAA8C;QAC9C,oEAAoE;QACpE,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;QAC3B,yCAAyC;QACzC,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;CACH,CAAC;AAEF,MAAM,CAAC,OAAO,MAAM,YAAY,GAAG;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,C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