@pega/cosmos-react-core 3.0.0-dev.9.1 → 3.0.0-rc.3

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 (989) hide show
  1. package/lib/components/Actions/Actions.d.ts +5 -0
  2. package/lib/components/Actions/Actions.d.ts.map +1 -1
  3. package/lib/components/Actions/Actions.js +2 -2
  4. package/lib/components/Actions/Actions.js.map +1 -1
  5. package/lib/components/AdditionalInfo/AdditionalInfo.d.ts +11 -0
  6. package/lib/components/AdditionalInfo/AdditionalInfo.d.ts.map +1 -0
  7. package/lib/components/AdditionalInfo/AdditionalInfo.js +25 -0
  8. package/lib/components/AdditionalInfo/AdditionalInfo.js.map +1 -0
  9. package/lib/components/AdditionalInfo/index.d.ts +2 -0
  10. package/lib/components/AdditionalInfo/index.d.ts.map +1 -0
  11. package/lib/components/AdditionalInfo/index.js +2 -0
  12. package/lib/components/AdditionalInfo/index.js.map +1 -0
  13. package/lib/components/AppShell/AppHeader.d.ts.map +1 -1
  14. package/lib/components/AppShell/AppHeader.js +16 -8
  15. package/lib/components/AppShell/AppHeader.js.map +1 -1
  16. package/lib/components/AppShell/AppHeader.styles.d.ts +16 -0
  17. package/lib/components/AppShell/AppHeader.styles.d.ts.map +1 -0
  18. package/lib/components/AppShell/AppHeader.styles.js +155 -0
  19. package/lib/components/AppShell/AppHeader.styles.js.map +1 -0
  20. package/lib/components/AppShell/AppShell.d.ts.map +1 -1
  21. package/lib/components/AppShell/AppShell.js +89 -218
  22. package/lib/components/AppShell/AppShell.js.map +1 -1
  23. package/lib/components/AppShell/AppShell.styles.d.ts +7 -48
  24. package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
  25. package/lib/components/AppShell/AppShell.styles.js +48 -527
  26. package/lib/components/AppShell/AppShell.styles.js.map +1 -1
  27. package/lib/components/AppShell/AppShell.types.d.ts +27 -80
  28. package/lib/components/AppShell/AppShell.types.d.ts.map +1 -1
  29. package/lib/components/AppShell/AppShell.types.js.map +1 -1
  30. package/lib/components/AppShell/AppShellContext.d.ts +12 -6
  31. package/lib/components/AppShell/AppShellContext.d.ts.map +1 -1
  32. package/lib/components/AppShell/AppShellContext.js +10 -5
  33. package/lib/components/AppShell/AppShellContext.js.map +1 -1
  34. package/lib/components/AppShell/AppShellList.d.ts +2 -2
  35. package/lib/components/AppShell/AppShellList.d.ts.map +1 -1
  36. package/lib/components/AppShell/AppShellList.js +16 -2
  37. package/lib/components/AppShell/AppShellList.js.map +1 -1
  38. package/lib/components/AppShell/AppShellList.styles.d.ts +19 -0
  39. package/lib/components/AppShell/AppShellList.styles.d.ts.map +1 -0
  40. package/lib/components/AppShell/AppShellList.styles.js +141 -0
  41. package/lib/components/AppShell/AppShellList.styles.js.map +1 -0
  42. package/lib/components/AppShell/AppShellSearch.d.ts +9 -0
  43. package/lib/components/AppShell/AppShellSearch.d.ts.map +1 -0
  44. package/lib/components/AppShell/AppShellSearch.js +39 -0
  45. package/lib/components/AppShell/AppShellSearch.js.map +1 -0
  46. package/lib/components/AppShell/AppShellSearch.styles.d.ts +8 -0
  47. package/lib/components/AppShell/AppShellSearch.styles.d.ts.map +1 -0
  48. package/lib/components/AppShell/AppShellSearch.styles.js +193 -0
  49. package/lib/components/AppShell/AppShellSearch.styles.js.map +1 -0
  50. package/lib/components/AppShell/Drawer.d.ts +3 -1
  51. package/lib/components/AppShell/Drawer.d.ts.map +1 -1
  52. package/lib/components/AppShell/Drawer.js +14 -11
  53. package/lib/components/AppShell/Drawer.js.map +1 -1
  54. package/lib/components/AppShell/Drawer.styles.d.ts +15 -0
  55. package/lib/components/AppShell/Drawer.styles.d.ts.map +1 -0
  56. package/lib/components/AppShell/Drawer.styles.js +153 -0
  57. package/lib/components/AppShell/Drawer.styles.js.map +1 -0
  58. package/lib/components/AppShell/NavigationList.d.ts +6 -0
  59. package/lib/components/AppShell/NavigationList.d.ts.map +1 -0
  60. package/lib/components/AppShell/NavigationList.js +121 -0
  61. package/lib/components/AppShell/NavigationList.js.map +1 -0
  62. package/lib/components/AppShell/NavigationListItemWrapper.d.ts +5 -0
  63. package/lib/components/AppShell/NavigationListItemWrapper.d.ts.map +1 -0
  64. package/lib/components/AppShell/NavigationListItemWrapper.js +157 -0
  65. package/lib/components/AppShell/NavigationListItemWrapper.js.map +1 -0
  66. package/lib/components/AppShell/Operator.js +4 -4
  67. package/lib/components/AppShell/Operator.js.map +1 -1
  68. package/lib/components/AppShell/index.d.ts +2 -3
  69. package/lib/components/AppShell/index.d.ts.map +1 -1
  70. package/lib/components/AppShell/index.js +1 -2
  71. package/lib/components/AppShell/index.js.map +1 -1
  72. package/lib/components/Avatar/Avatar.d.ts.map +1 -1
  73. package/lib/components/Avatar/Avatar.js +4 -4
  74. package/lib/components/Avatar/Avatar.js.map +1 -1
  75. package/lib/components/Badges/Count.d.ts.map +1 -1
  76. package/lib/components/Badges/Count.js +37 -1
  77. package/lib/components/Badges/Count.js.map +1 -1
  78. package/lib/components/Badges/Keyboard.d.ts +2 -2
  79. package/lib/components/Badges/Keyboard.d.ts.map +1 -1
  80. package/lib/components/Badges/Keyboard.js +6 -1
  81. package/lib/components/Badges/Keyboard.js.map +1 -1
  82. package/lib/components/Badges/Selection.d.ts +1 -1
  83. package/lib/components/Badges/Selection.d.ts.map +1 -1
  84. package/lib/components/Badges/Selection.js +4 -2
  85. package/lib/components/Badges/Selection.js.map +1 -1
  86. package/lib/components/Banner/Banner.d.ts.map +1 -1
  87. package/lib/components/Banner/Banner.js +8 -2
  88. package/lib/components/Banner/Banner.js.map +1 -1
  89. package/lib/components/Boolean/BooleanDisplay.d.ts.map +1 -1
  90. package/lib/components/Boolean/BooleanDisplay.js +4 -12
  91. package/lib/components/Boolean/BooleanDisplay.js.map +1 -1
  92. package/lib/components/Breadcrumbs/Breadcrumbs.d.ts +2 -1
  93. package/lib/components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
  94. package/lib/components/Breadcrumbs/Breadcrumbs.js +44 -13
  95. package/lib/components/Breadcrumbs/Breadcrumbs.js.map +1 -1
  96. package/lib/components/Button/BareRoleButton.d.ts.map +1 -1
  97. package/lib/components/Button/BareRoleButton.js +3 -1
  98. package/lib/components/Button/BareRoleButton.js.map +1 -1
  99. package/lib/components/Checkbox/Checkbox.d.ts +3 -1
  100. package/lib/components/Checkbox/Checkbox.d.ts.map +1 -1
  101. package/lib/components/Checkbox/Checkbox.js.map +1 -1
  102. package/lib/components/ColorPicker/ColorPicker.d.ts +2 -0
  103. package/lib/components/ColorPicker/ColorPicker.d.ts.map +1 -1
  104. package/lib/components/ColorPicker/ColorPicker.js +1 -1
  105. package/lib/components/ColorPicker/ColorPicker.js.map +1 -1
  106. package/lib/components/ComboBox/ComboBox.d.ts.map +1 -1
  107. package/lib/components/ComboBox/ComboBox.js +68 -13
  108. package/lib/components/ComboBox/ComboBox.js.map +1 -1
  109. package/lib/components/ComboBox/ComboBox.styles.d.ts +3 -1
  110. package/lib/components/ComboBox/ComboBox.styles.d.ts.map +1 -1
  111. package/lib/components/ComboBox/ComboBox.types.d.ts +11 -1
  112. package/lib/components/ComboBox/ComboBox.types.d.ts.map +1 -1
  113. package/lib/components/ComboBox/ComboBox.types.js.map +1 -1
  114. package/lib/components/ComboBox/ComboBoxInput.d.ts +7 -0
  115. package/lib/components/ComboBox/ComboBoxInput.d.ts.map +1 -1
  116. package/lib/components/ComboBox/ComboBoxInput.js +5 -2
  117. package/lib/components/ComboBox/ComboBoxInput.js.map +1 -1
  118. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.d.ts.map +1 -1
  119. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js +116 -31
  120. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js.map +1 -1
  121. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.types.d.ts +10 -0
  122. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.types.d.ts.map +1 -1
  123. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.types.js.map +1 -1
  124. package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.d.ts.map +1 -1
  125. package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.js +2 -2
  126. package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.js.map +1 -1
  127. package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.types.d.ts +2 -0
  128. package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.types.d.ts.map +1 -1
  129. package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.types.js.map +1 -1
  130. package/lib/components/CompositeInput/CompositeInput.d.ts +5 -0
  131. package/lib/components/CompositeInput/CompositeInput.d.ts.map +1 -0
  132. package/lib/components/CompositeInput/CompositeInput.js +62 -0
  133. package/lib/components/CompositeInput/CompositeInput.js.map +1 -0
  134. package/lib/components/CompositeInput/CompositeInput.styles.d.ts +5 -0
  135. package/lib/components/CompositeInput/CompositeInput.styles.d.ts.map +1 -0
  136. package/lib/components/CompositeInput/CompositeInput.styles.js +57 -0
  137. package/lib/components/CompositeInput/CompositeInput.styles.js.map +1 -0
  138. package/lib/components/CompositeInput/CompositeInput.types.d.ts +52 -0
  139. package/lib/components/CompositeInput/CompositeInput.types.d.ts.map +1 -0
  140. package/lib/components/CompositeInput/CompositeInput.types.js +2 -0
  141. package/lib/components/CompositeInput/CompositeInput.types.js.map +1 -0
  142. package/lib/components/CompositeInput/index.d.ts +3 -0
  143. package/lib/components/CompositeInput/index.d.ts.map +1 -0
  144. package/lib/components/CompositeInput/index.js +2 -0
  145. package/lib/components/CompositeInput/index.js.map +1 -0
  146. package/lib/components/Configuration/Configuration.d.ts +14 -13
  147. package/lib/components/Configuration/Configuration.d.ts.map +1 -1
  148. package/lib/components/Configuration/Configuration.js +25 -14
  149. package/lib/components/Configuration/Configuration.js.map +1 -1
  150. package/lib/components/Configuration/index.d.ts +0 -1
  151. package/lib/components/Configuration/index.d.ts.map +1 -1
  152. package/lib/components/Configuration/index.js +0 -1
  153. package/lib/components/Configuration/index.js.map +1 -1
  154. package/lib/components/CreditCard/CreditCard.types.d.ts +2 -0
  155. package/lib/components/CreditCard/CreditCard.types.d.ts.map +1 -1
  156. package/lib/components/CreditCard/CreditCard.types.js.map +1 -1
  157. package/lib/components/Currency/CurrencyDisplay.d.ts.map +1 -1
  158. package/lib/components/Currency/CurrencyDisplay.js +2 -2
  159. package/lib/components/Currency/CurrencyDisplay.js.map +1 -1
  160. package/lib/components/Currency/CurrencyInput.d.ts.map +1 -1
  161. package/lib/components/Currency/CurrencyInput.js +92 -26
  162. package/lib/components/Currency/CurrencyInput.js.map +1 -1
  163. package/lib/components/Currency/CurrencyInput.types.d.ts +9 -1
  164. package/lib/components/Currency/CurrencyInput.types.d.ts.map +1 -1
  165. package/lib/components/Currency/CurrencyInput.types.js.map +1 -1
  166. package/lib/components/Currency/utils.d.ts +7 -17
  167. package/lib/components/Currency/utils.d.ts.map +1 -1
  168. package/lib/components/Currency/utils.js +50 -51
  169. package/lib/components/Currency/utils.js.map +1 -1
  170. package/lib/components/DateTime/DateTime.types.d.ts +15 -9
  171. package/lib/components/DateTime/DateTime.types.d.ts.map +1 -1
  172. package/lib/components/DateTime/DateTime.types.js.map +1 -1
  173. package/lib/components/DateTime/DurationDisplay.js +3 -3
  174. package/lib/components/DateTime/DurationDisplay.js.map +1 -1
  175. package/lib/components/DateTime/Input/DateInput.d.ts +9 -2
  176. package/lib/components/DateTime/Input/DateInput.d.ts.map +1 -1
  177. package/lib/components/DateTime/Input/DateInput.js +27 -15
  178. package/lib/components/DateTime/Input/DateInput.js.map +1 -1
  179. package/lib/components/DateTime/Input/DateRangeInput.d.ts +18 -23
  180. package/lib/components/DateTime/Input/DateRangeInput.d.ts.map +1 -1
  181. package/lib/components/DateTime/Input/DateRangeInput.js +98 -83
  182. package/lib/components/DateTime/Input/DateRangeInput.js.map +1 -1
  183. package/lib/components/DateTime/Input/DateTimeInput.d.ts +3 -0
  184. package/lib/components/DateTime/Input/DateTimeInput.d.ts.map +1 -1
  185. package/lib/components/DateTime/Input/DateTimeInput.js +28 -12
  186. package/lib/components/DateTime/Input/DateTimeInput.js.map +1 -1
  187. package/lib/components/DateTime/Input/DayOfWeekInput.d.ts +2 -0
  188. package/lib/components/DateTime/Input/DayOfWeekInput.d.ts.map +1 -1
  189. package/lib/components/DateTime/Input/DayOfWeekInput.js.map +1 -1
  190. package/lib/components/DateTime/Input/Duration/DurationInput.d.ts.map +1 -1
  191. package/lib/components/DateTime/Input/Duration/DurationInput.js +10 -2
  192. package/lib/components/DateTime/Input/Duration/DurationInput.js.map +1 -1
  193. package/lib/components/DateTime/Input/Duration/DurationInput.types.d.ts +2 -0
  194. package/lib/components/DateTime/Input/Duration/DurationInput.types.d.ts.map +1 -1
  195. package/lib/components/DateTime/Input/Duration/DurationInput.types.js.map +1 -1
  196. package/lib/components/DateTime/Input/Duration/NumberUnit.d.ts.map +1 -1
  197. package/lib/components/DateTime/Input/Duration/NumberUnit.js +30 -33
  198. package/lib/components/DateTime/Input/Duration/NumberUnit.js.map +1 -1
  199. package/lib/components/DateTime/Input/Duration/Time.d.ts.map +1 -1
  200. package/lib/components/DateTime/Input/Duration/Time.js +5 -4
  201. package/lib/components/DateTime/Input/Duration/Time.js.map +1 -1
  202. package/lib/components/DateTime/Input/MonthInput.d.ts +3 -0
  203. package/lib/components/DateTime/Input/MonthInput.d.ts.map +1 -1
  204. package/lib/components/DateTime/Input/MonthInput.js +23 -26
  205. package/lib/components/DateTime/Input/MonthInput.js.map +1 -1
  206. package/lib/components/DateTime/Input/QuarterInput.d.ts +3 -0
  207. package/lib/components/DateTime/Input/QuarterInput.d.ts.map +1 -1
  208. package/lib/components/DateTime/Input/QuarterInput.js +24 -25
  209. package/lib/components/DateTime/Input/QuarterInput.js.map +1 -1
  210. package/lib/components/DateTime/Input/TimeInput.d.ts +3 -0
  211. package/lib/components/DateTime/Input/TimeInput.d.ts.map +1 -1
  212. package/lib/components/DateTime/Input/TimeInput.js +21 -9
  213. package/lib/components/DateTime/Input/TimeInput.js.map +1 -1
  214. package/lib/components/DateTime/Input/TimeRangeInput.d.ts +46 -0
  215. package/lib/components/DateTime/Input/TimeRangeInput.d.ts.map +1 -0
  216. package/lib/components/DateTime/Input/TimeRangeInput.js +74 -0
  217. package/lib/components/DateTime/Input/TimeRangeInput.js.map +1 -0
  218. package/lib/components/DateTime/Input/WeekInput.d.ts +3 -2
  219. package/lib/components/DateTime/Input/WeekInput.d.ts.map +1 -1
  220. package/lib/components/DateTime/Input/WeekInput.js +12 -7
  221. package/lib/components/DateTime/Input/WeekInput.js.map +1 -1
  222. package/lib/components/DateTime/Input/usePickerButton.d.ts +1 -1
  223. package/lib/components/DateTime/Input/usePickerButton.d.ts.map +1 -1
  224. package/lib/components/DateTime/Input/utils.d.ts +6 -6
  225. package/lib/components/DateTime/Input/utils.d.ts.map +1 -1
  226. package/lib/components/DateTime/Input/utils.js +2 -1
  227. package/lib/components/DateTime/Input/utils.js.map +1 -1
  228. package/lib/components/DateTime/Picker/Calendar.d.ts.map +1 -1
  229. package/lib/components/DateTime/Picker/Calendar.js +20 -16
  230. package/lib/components/DateTime/Picker/Calendar.js.map +1 -1
  231. package/lib/components/DateTime/Picker/Calendar.styles.d.ts +2 -4
  232. package/lib/components/DateTime/Picker/Calendar.styles.d.ts.map +1 -1
  233. package/lib/components/DateTime/Picker/Calendar.styles.js +13 -55
  234. package/lib/components/DateTime/Picker/Calendar.styles.js.map +1 -1
  235. package/lib/components/DateTime/Picker/DatePicker.d.ts.map +1 -1
  236. package/lib/components/DateTime/Picker/DatePicker.js +2 -1
  237. package/lib/components/DateTime/Picker/DatePicker.js.map +1 -1
  238. package/lib/components/DateTime/Picker/DatePicker.styles.d.ts +3 -0
  239. package/lib/components/DateTime/Picker/DatePicker.styles.d.ts.map +1 -0
  240. package/lib/components/DateTime/Picker/DatePicker.styles.js +39 -0
  241. package/lib/components/DateTime/Picker/DatePicker.styles.js.map +1 -0
  242. package/lib/components/DateTime/Picker/DateRangePicker.js +1 -1
  243. package/lib/components/DateTime/Picker/DateRangePicker.js.map +1 -1
  244. package/lib/components/DateTime/Picker/TimePicker.d.ts +1 -1
  245. package/lib/components/DateTime/Picker/TimePicker.d.ts.map +1 -1
  246. package/lib/components/DateTime/Picker/TimePicker.js +10 -5
  247. package/lib/components/DateTime/Picker/TimePicker.js.map +1 -1
  248. package/lib/components/DateTime/Picker/Weeks.d.ts.map +1 -1
  249. package/lib/components/DateTime/Picker/Weeks.js +14 -6
  250. package/lib/components/DateTime/Picker/Weeks.js.map +1 -1
  251. package/lib/components/DateTime/Picker/utils.d.ts +1 -1
  252. package/lib/components/DateTime/Picker/utils.d.ts.map +1 -1
  253. package/lib/components/DateTime/index.d.ts +4 -0
  254. package/lib/components/DateTime/index.d.ts.map +1 -1
  255. package/lib/components/DateTime/index.js +3 -0
  256. package/lib/components/DateTime/index.js.map +1 -1
  257. package/lib/components/DateTime/utils.d.ts +2 -2
  258. package/lib/components/DateTime/utils.d.ts.map +1 -1
  259. package/lib/components/DateTime/utils.js +18 -4
  260. package/lib/components/DateTime/utils.js.map +1 -1
  261. package/lib/components/Dialog/Dialog.d.ts +32 -0
  262. package/lib/components/Dialog/Dialog.d.ts.map +1 -0
  263. package/lib/components/Dialog/Dialog.js +149 -0
  264. package/lib/components/Dialog/Dialog.js.map +1 -0
  265. package/lib/components/Dialog/index.d.ts +3 -0
  266. package/lib/components/Dialog/index.d.ts.map +1 -0
  267. package/lib/components/Dialog/index.js +3 -0
  268. package/lib/components/Dialog/index.js.map +1 -0
  269. package/lib/components/FieldGroup/FieldGroup.d.ts +7 -0
  270. package/lib/components/FieldGroup/FieldGroup.d.ts.map +1 -1
  271. package/lib/components/FieldGroup/FieldGroup.js +45 -41
  272. package/lib/components/FieldGroup/FieldGroup.js.map +1 -1
  273. package/lib/components/FieldGroup/FieldGroupList.d.ts.map +1 -1
  274. package/lib/components/FieldGroup/FieldGroupList.js +6 -2
  275. package/lib/components/FieldGroup/FieldGroupList.js.map +1 -1
  276. package/lib/components/FieldValueList/FieldValueList.d.ts +13 -7
  277. package/lib/components/FieldValueList/FieldValueList.d.ts.map +1 -1
  278. package/lib/components/FieldValueList/FieldValueList.js +41 -13
  279. package/lib/components/FieldValueList/FieldValueList.js.map +1 -1
  280. package/lib/components/FieldValueList/index.d.ts +3 -5
  281. package/lib/components/FieldValueList/index.d.ts.map +1 -1
  282. package/lib/components/FieldValueList/index.js +2 -4
  283. package/lib/components/FieldValueList/index.js.map +1 -1
  284. package/lib/components/File/FileItem.d.ts +3 -0
  285. package/lib/components/File/FileItem.d.ts.map +1 -1
  286. package/lib/components/File/FileItem.js +6 -3
  287. package/lib/components/File/FileItem.js.map +1 -1
  288. package/lib/components/File/FileVisual.d.ts.map +1 -1
  289. package/lib/components/File/FileVisual.js +6 -5
  290. package/lib/components/File/FileVisual.js.map +1 -1
  291. package/lib/components/File/utils.d.ts +1 -1
  292. package/lib/components/File/utils.d.ts.map +1 -1
  293. package/lib/components/File/utils.js.map +1 -1
  294. package/lib/components/Flex/Flex.d.ts +11 -10
  295. package/lib/components/Flex/Flex.d.ts.map +1 -1
  296. package/lib/components/Flex/Flex.js.map +1 -1
  297. package/lib/components/Form/Form.d.ts +5 -16
  298. package/lib/components/Form/Form.d.ts.map +1 -1
  299. package/lib/components/Form/Form.js +14 -11
  300. package/lib/components/Form/Form.js.map +1 -1
  301. package/lib/components/FormControl/FormControl.d.ts +12 -2
  302. package/lib/components/FormControl/FormControl.d.ts.map +1 -1
  303. package/lib/components/FormControl/FormControl.js +60 -35
  304. package/lib/components/FormControl/FormControl.js.map +1 -1
  305. package/lib/components/FormField/FormField.d.ts +5 -0
  306. package/lib/components/FormField/FormField.d.ts.map +1 -1
  307. package/lib/components/FormField/FormField.js +87 -16
  308. package/lib/components/FormField/FormField.js.map +1 -1
  309. package/lib/components/Grid/Grid.d.ts +1 -1
  310. package/lib/components/Grid/Grid.d.ts.map +1 -1
  311. package/lib/components/Grid/Grid.types.d.ts +11 -10
  312. package/lib/components/Grid/Grid.types.d.ts.map +1 -1
  313. package/lib/components/Grid/Grid.types.js.map +1 -1
  314. package/lib/components/HTML/HTML.d.ts.map +1 -1
  315. package/lib/components/HTML/HTML.js +56 -16
  316. package/lib/components/HTML/HTML.js.map +1 -1
  317. package/lib/components/Icon/Icon.d.ts.map +1 -1
  318. package/lib/components/Icon/Icon.js +1 -1
  319. package/lib/components/Icon/Icon.js.map +1 -1
  320. package/lib/components/Icon/iconNames.d.ts +2 -2
  321. package/lib/components/Icon/iconNames.d.ts.map +1 -1
  322. package/lib/components/Icon/iconNames.js +2 -1
  323. package/lib/components/Icon/iconNames.js.map +1 -1
  324. package/lib/components/Icon/icons/ai-assist.icon.js +1 -1
  325. package/lib/components/Icon/icons/ai-assist.icon.js.map +1 -1
  326. package/lib/components/Icon/icons/align-center.icon.js +1 -1
  327. package/lib/components/Icon/icons/align-center.icon.js.map +1 -1
  328. package/lib/components/Icon/icons/align-left.icon.js +1 -1
  329. package/lib/components/Icon/icons/align-left.icon.js.map +1 -1
  330. package/lib/components/Icon/icons/align-right.icon.js +1 -1
  331. package/lib/components/Icon/icons/align-right.icon.js.map +1 -1
  332. package/lib/components/Icon/icons/arrow-left.icon.js +1 -1
  333. package/lib/components/Icon/icons/arrow-left.icon.js.map +1 -1
  334. package/lib/components/Icon/icons/arrow-micro-down.icon.js +1 -1
  335. package/lib/components/Icon/icons/arrow-micro-down.icon.js.map +1 -1
  336. package/lib/components/Icon/icons/arrow-micro-left.icon.js +1 -1
  337. package/lib/components/Icon/icons/arrow-micro-left.icon.js.map +1 -1
  338. package/lib/components/Icon/icons/arrow-micro-right.icon.js +1 -1
  339. package/lib/components/Icon/icons/arrow-micro-right.icon.js.map +1 -1
  340. package/lib/components/Icon/icons/arrow-micro-up-down.icon.js +1 -1
  341. package/lib/components/Icon/icons/arrow-micro-up-down.icon.js.map +1 -1
  342. package/lib/components/Icon/icons/arrow-micro-up.icon.js +1 -1
  343. package/lib/components/Icon/icons/arrow-micro-up.icon.js.map +1 -1
  344. package/lib/components/Icon/icons/arrow-up-down.icon.js +1 -1
  345. package/lib/components/Icon/icons/arrow-up-down.icon.js.map +1 -1
  346. package/lib/components/Icon/icons/bars.icon.js +1 -1
  347. package/lib/components/Icon/icons/bars.icon.js.map +1 -1
  348. package/lib/components/Icon/icons/bell-solid.icon.js +1 -1
  349. package/lib/components/Icon/icons/bell-solid.icon.js.map +1 -1
  350. package/lib/components/Icon/icons/bell.icon.js +1 -1
  351. package/lib/components/Icon/icons/bell.icon.js.map +1 -1
  352. package/lib/components/Icon/icons/box-4-solid.icon.js +1 -1
  353. package/lib/components/Icon/icons/box-4-solid.icon.js.map +1 -1
  354. package/lib/components/Icon/icons/box-4.icon.js +1 -1
  355. package/lib/components/Icon/icons/box-4.icon.js.map +1 -1
  356. package/lib/components/Icon/icons/calendar-range.icon.js +1 -1
  357. package/lib/components/Icon/icons/calendar-range.icon.js.map +1 -1
  358. package/lib/components/Icon/icons/calendar-solid.icon.js +1 -1
  359. package/lib/components/Icon/icons/calendar-solid.icon.js.map +1 -1
  360. package/lib/components/Icon/icons/caret-down.icon.js +1 -1
  361. package/lib/components/Icon/icons/caret-down.icon.js.map +1 -1
  362. package/lib/components/Icon/icons/caret-left.icon.js +1 -1
  363. package/lib/components/Icon/icons/caret-left.icon.js.map +1 -1
  364. package/lib/components/Icon/icons/caret-right.icon.js +1 -1
  365. package/lib/components/Icon/icons/caret-right.icon.js.map +1 -1
  366. package/lib/components/Icon/icons/caret-up.icon.js +1 -1
  367. package/lib/components/Icon/icons/caret-up.icon.js.map +1 -1
  368. package/lib/components/Icon/icons/{script-solid.icon.d.ts → carrot.icon.d.ts} +2 -2
  369. package/lib/components/Icon/icons/carrot.icon.d.ts.map +1 -0
  370. package/lib/components/Icon/icons/carrot.icon.js +6 -0
  371. package/lib/components/Icon/icons/carrot.icon.js.map +1 -0
  372. package/lib/components/Icon/icons/case-solid.icon.js +1 -1
  373. package/lib/components/Icon/icons/case-solid.icon.js.map +1 -1
  374. package/lib/components/Icon/icons/case.icon.js +1 -1
  375. package/lib/components/Icon/icons/case.icon.js.map +1 -1
  376. package/lib/components/Icon/icons/chain.icon.js +1 -1
  377. package/lib/components/Icon/icons/chain.icon.js.map +1 -1
  378. package/lib/components/Icon/icons/chat-solid.icon.js +1 -1
  379. package/lib/components/Icon/icons/chat-solid.icon.js.map +1 -1
  380. package/lib/components/Icon/icons/chat.icon.js +1 -1
  381. package/lib/components/Icon/icons/chat.icon.js.map +1 -1
  382. package/lib/components/Icon/icons/check.icon.js +1 -1
  383. package/lib/components/Icon/icons/check.icon.js.map +1 -1
  384. package/lib/components/Icon/icons/clipboard-plus-solid.icon.js +1 -1
  385. package/lib/components/Icon/icons/clipboard-plus-solid.icon.js.map +1 -1
  386. package/lib/components/Icon/icons/clipboard-plus.icon.js +1 -1
  387. package/lib/components/Icon/icons/clipboard-plus.icon.js.map +1 -1
  388. package/lib/components/Icon/icons/clock-solid.icon.js +1 -1
  389. package/lib/components/Icon/icons/clock-solid.icon.js.map +1 -1
  390. package/lib/components/Icon/icons/clock.icon.js +1 -1
  391. package/lib/components/Icon/icons/clock.icon.js.map +1 -1
  392. package/lib/components/Icon/icons/code.icon.js +1 -1
  393. package/lib/components/Icon/icons/code.icon.js.map +1 -1
  394. package/lib/components/Icon/icons/dataviz-string-field.icon.d.ts +1 -1
  395. package/lib/components/Icon/icons/dataviz-string-field.icon.js +2 -2
  396. package/lib/components/Icon/icons/dataviz-string-field.icon.js.map +1 -1
  397. package/lib/components/Icon/icons/dock.icon.js +1 -1
  398. package/lib/components/Icon/icons/dock.icon.js.map +1 -1
  399. package/lib/components/Icon/icons/dot-9-solid.icon.js +1 -1
  400. package/lib/components/Icon/icons/dot-9-solid.icon.js.map +1 -1
  401. package/lib/components/Icon/icons/dot-9.icon.js +1 -1
  402. package/lib/components/Icon/icons/dot-9.icon.js.map +1 -1
  403. package/lib/components/Icon/icons/download.icon.js +1 -1
  404. package/lib/components/Icon/icons/download.icon.js.map +1 -1
  405. package/lib/components/Icon/icons/drag.icon.js +1 -1
  406. package/lib/components/Icon/icons/drag.icon.js.map +1 -1
  407. package/lib/components/Icon/icons/eye-off-solid.icon.js +1 -1
  408. package/lib/components/Icon/icons/eye-off-solid.icon.js.map +1 -1
  409. package/lib/components/Icon/icons/eye-off.icon.js +1 -1
  410. package/lib/components/Icon/icons/eye-off.icon.js.map +1 -1
  411. package/lib/components/Icon/icons/face-blank-solid.icon.d.ts.map +1 -1
  412. package/lib/components/Icon/icons/face-blank-solid.icon.js +1 -1
  413. package/lib/components/Icon/icons/face-blank-solid.icon.js.map +1 -1
  414. package/lib/components/Icon/icons/face-blank.icon.d.ts.map +1 -1
  415. package/lib/components/Icon/icons/face-blank.icon.js +1 -1
  416. package/lib/components/Icon/icons/face-blank.icon.js.map +1 -1
  417. package/lib/components/Icon/icons/face-happy-solid.icon.d.ts.map +1 -1
  418. package/lib/components/Icon/icons/face-happy-solid.icon.js +1 -1
  419. package/lib/components/Icon/icons/face-happy-solid.icon.js.map +1 -1
  420. package/lib/components/Icon/icons/face-happy.icon.d.ts.map +1 -1
  421. package/lib/components/Icon/icons/face-happy.icon.js +1 -1
  422. package/lib/components/Icon/icons/face-happy.icon.js.map +1 -1
  423. package/lib/components/Icon/icons/face-sad-solid.icon.d.ts.map +1 -1
  424. package/lib/components/Icon/icons/face-sad-solid.icon.js +1 -1
  425. package/lib/components/Icon/icons/face-sad-solid.icon.js.map +1 -1
  426. package/lib/components/Icon/icons/face-sad.icon.d.ts.map +1 -1
  427. package/lib/components/Icon/icons/face-sad.icon.js +1 -1
  428. package/lib/components/Icon/icons/face-sad.icon.js.map +1 -1
  429. package/lib/components/Icon/icons/fast-forward-solid.icon.js +1 -1
  430. package/lib/components/Icon/icons/fast-forward-solid.icon.js.map +1 -1
  431. package/lib/components/Icon/icons/filetype-text.icon.d.ts.map +1 -1
  432. package/lib/components/Icon/icons/filetype-text.icon.js +2 -2
  433. package/lib/components/Icon/icons/filetype-text.icon.js.map +1 -1
  434. package/lib/components/Icon/icons/filter-on.icon.js +1 -1
  435. package/lib/components/Icon/icons/filter-on.icon.js.map +1 -1
  436. package/lib/components/Icon/icons/filter.icon.js +1 -1
  437. package/lib/components/Icon/icons/filter.icon.js.map +1 -1
  438. package/lib/components/Icon/icons/folder-hierarchy-solid.icon.js +1 -1
  439. package/lib/components/Icon/icons/folder-hierarchy-solid.icon.js.map +1 -1
  440. package/lib/components/Icon/icons/folder-hierarchy.icon.js +1 -1
  441. package/lib/components/Icon/icons/folder-hierarchy.icon.js.map +1 -1
  442. package/lib/components/Icon/icons/forward-all-solid.icon.js +1 -1
  443. package/lib/components/Icon/icons/forward-all-solid.icon.js.map +1 -1
  444. package/lib/components/Icon/icons/forward-all.icon.js +1 -1
  445. package/lib/components/Icon/icons/forward-all.icon.js.map +1 -1
  446. package/lib/components/Icon/icons/forward-solid.icon.js +1 -1
  447. package/lib/components/Icon/icons/forward-solid.icon.js.map +1 -1
  448. package/lib/components/Icon/icons/forward.icon.js +1 -1
  449. package/lib/components/Icon/icons/forward.icon.js.map +1 -1
  450. package/lib/components/Icon/icons/galaxy.icon.d.ts.map +1 -1
  451. package/lib/components/Icon/icons/galaxy.icon.js +2 -2
  452. package/lib/components/Icon/icons/galaxy.icon.js.map +1 -1
  453. package/lib/components/Icon/icons/globe-solid.icon.js +1 -1
  454. package/lib/components/Icon/icons/globe-solid.icon.js.map +1 -1
  455. package/lib/components/Icon/icons/globe.icon.js +1 -1
  456. package/lib/components/Icon/icons/globe.icon.js.map +1 -1
  457. package/lib/components/Icon/icons/hand.icon.js +1 -1
  458. package/lib/components/Icon/icons/hand.icon.js.map +1 -1
  459. package/lib/components/Icon/icons/help-solid.icon.js +1 -1
  460. package/lib/components/Icon/icons/help-solid.icon.js.map +1 -1
  461. package/lib/components/Icon/icons/help.icon.js +1 -1
  462. package/lib/components/Icon/icons/help.icon.js.map +1 -1
  463. package/lib/components/Icon/icons/home-solid.icon.js +1 -1
  464. package/lib/components/Icon/icons/home-solid.icon.js.map +1 -1
  465. package/lib/components/Icon/icons/home.icon.js +1 -1
  466. package/lib/components/Icon/icons/home.icon.js.map +1 -1
  467. package/lib/components/Icon/icons/information-solid.icon.js +1 -1
  468. package/lib/components/Icon/icons/information-solid.icon.js.map +1 -1
  469. package/lib/components/Icon/icons/information.icon.js +1 -1
  470. package/lib/components/Icon/icons/information.icon.js.map +1 -1
  471. package/lib/components/Icon/icons/list-number.icon.d.ts.map +1 -1
  472. package/lib/components/Icon/icons/list-number.icon.js +2 -2
  473. package/lib/components/Icon/icons/list-number.icon.js.map +1 -1
  474. package/lib/components/Icon/icons/list.icon.d.ts.map +1 -1
  475. package/lib/components/Icon/icons/list.icon.js +2 -2
  476. package/lib/components/Icon/icons/list.icon.js.map +1 -1
  477. package/lib/components/Icon/icons/mail-solid.icon.js +1 -1
  478. package/lib/components/Icon/icons/mail-solid.icon.js.map +1 -1
  479. package/lib/components/Icon/icons/mail.icon.js +1 -1
  480. package/lib/components/Icon/icons/mail.icon.js.map +1 -1
  481. package/lib/components/Icon/icons/minus.icon.js +1 -1
  482. package/lib/components/Icon/icons/minus.icon.js.map +1 -1
  483. package/lib/components/Icon/icons/more.icon.js +1 -1
  484. package/lib/components/Icon/icons/more.icon.js.map +1 -1
  485. package/lib/components/Icon/icons/move-left-solid.icon.js +1 -1
  486. package/lib/components/Icon/icons/move-left-solid.icon.js.map +1 -1
  487. package/lib/components/Icon/icons/move-right-solid.icon.js +1 -1
  488. package/lib/components/Icon/icons/move-right-solid.icon.js.map +1 -1
  489. package/lib/components/Icon/icons/open.icon.js +1 -1
  490. package/lib/components/Icon/icons/open.icon.js.map +1 -1
  491. package/lib/components/Icon/icons/paper-clip.icon.js +1 -1
  492. package/lib/components/Icon/icons/paper-clip.icon.js.map +1 -1
  493. package/lib/components/Icon/icons/phone-solid.icon.js +1 -1
  494. package/lib/components/Icon/icons/phone-solid.icon.js.map +1 -1
  495. package/lib/components/Icon/icons/phone.icon.js +1 -1
  496. package/lib/components/Icon/icons/phone.icon.js.map +1 -1
  497. package/lib/components/Icon/icons/picture-solid.icon.js +1 -1
  498. package/lib/components/Icon/icons/picture-solid.icon.js.map +1 -1
  499. package/lib/components/Icon/icons/picture.icon.js +1 -1
  500. package/lib/components/Icon/icons/picture.icon.js.map +1 -1
  501. package/lib/components/Icon/icons/placeholder.icon.d.ts +4 -0
  502. package/lib/components/Icon/icons/placeholder.icon.d.ts.map +1 -0
  503. package/lib/components/Icon/icons/placeholder.icon.js +6 -0
  504. package/lib/components/Icon/icons/placeholder.icon.js.map +1 -0
  505. package/lib/components/Icon/icons/plus.icon.js +1 -1
  506. package/lib/components/Icon/icons/plus.icon.js.map +1 -1
  507. package/lib/components/Icon/icons/polaris-solid.icon.js +1 -1
  508. package/lib/components/Icon/icons/polaris-solid.icon.js.map +1 -1
  509. package/lib/components/Icon/icons/polaris.icon.js +1 -1
  510. package/lib/components/Icon/icons/polaris.icon.js.map +1 -1
  511. package/lib/components/Icon/icons/qr.icon.js +1 -1
  512. package/lib/components/Icon/icons/qr.icon.js.map +1 -1
  513. package/lib/components/Icon/icons/reply-all-solid.icon.js +1 -1
  514. package/lib/components/Icon/icons/reply-all-solid.icon.js.map +1 -1
  515. package/lib/components/Icon/icons/reply-all.icon.js +1 -1
  516. package/lib/components/Icon/icons/reply-all.icon.js.map +1 -1
  517. package/lib/components/Icon/icons/reply-solid.icon.js +1 -1
  518. package/lib/components/Icon/icons/reply-solid.icon.js.map +1 -1
  519. package/lib/components/Icon/icons/reply.icon.js +1 -1
  520. package/lib/components/Icon/icons/reply.icon.js.map +1 -1
  521. package/lib/components/Icon/icons/reset.icon.js +1 -1
  522. package/lib/components/Icon/icons/reset.icon.js.map +1 -1
  523. package/lib/components/Icon/icons/robot-happy-solid.icon.js +1 -1
  524. package/lib/components/Icon/icons/robot-happy-solid.icon.js.map +1 -1
  525. package/lib/components/Icon/icons/robot-happy.icon.js +1 -1
  526. package/lib/components/Icon/icons/robot-happy.icon.js.map +1 -1
  527. package/lib/components/Icon/icons/row-insert.icon.js +1 -1
  528. package/lib/components/Icon/icons/row-insert.icon.js.map +1 -1
  529. package/lib/components/Icon/icons/row.icon.js +1 -1
  530. package/lib/components/Icon/icons/row.icon.js.map +1 -1
  531. package/lib/components/Icon/icons/scale-down.icon.js +1 -1
  532. package/lib/components/Icon/icons/scale-down.icon.js.map +1 -1
  533. package/lib/components/Icon/icons/scale-up-solid.icon.js +1 -1
  534. package/lib/components/Icon/icons/scale-up-solid.icon.js.map +1 -1
  535. package/lib/components/Icon/icons/scale-up.icon.js +1 -1
  536. package/lib/components/Icon/icons/scale-up.icon.js.map +1 -1
  537. package/lib/components/Icon/icons/script.icon.js +1 -1
  538. package/lib/components/Icon/icons/script.icon.js.map +1 -1
  539. package/lib/components/Icon/icons/search-analytics-solid.icon.js +1 -1
  540. package/lib/components/Icon/icons/search-analytics-solid.icon.js.map +1 -1
  541. package/lib/components/Icon/icons/search-analytics.icon.js +1 -1
  542. package/lib/components/Icon/icons/search-analytics.icon.js.map +1 -1
  543. package/lib/components/Icon/icons/search.icon.js +1 -1
  544. package/lib/components/Icon/icons/search.icon.js.map +1 -1
  545. package/lib/components/Icon/icons/send-solid.icon.js +1 -1
  546. package/lib/components/Icon/icons/send-solid.icon.js.map +1 -1
  547. package/lib/components/Icon/icons/send.icon.js +1 -1
  548. package/lib/components/Icon/icons/send.icon.js.map +1 -1
  549. package/lib/components/Icon/icons/slideshow-solid.icon.js +1 -1
  550. package/lib/components/Icon/icons/slideshow-solid.icon.js.map +1 -1
  551. package/lib/components/Icon/icons/slideshow.icon.js +1 -1
  552. package/lib/components/Icon/icons/slideshow.icon.js.map +1 -1
  553. package/lib/components/Icon/icons/snow.icon.js +1 -1
  554. package/lib/components/Icon/icons/snow.icon.js.map +1 -1
  555. package/lib/components/Icon/icons/speaker-solid.icon.js +1 -1
  556. package/lib/components/Icon/icons/speaker-solid.icon.js.map +1 -1
  557. package/lib/components/Icon/icons/speaker.icon.js +1 -1
  558. package/lib/components/Icon/icons/speaker.icon.js.map +1 -1
  559. package/lib/components/Icon/icons/star-solid.icon.js +1 -1
  560. package/lib/components/Icon/icons/star-solid.icon.js.map +1 -1
  561. package/lib/components/Icon/icons/star.icon.js +1 -1
  562. package/lib/components/Icon/icons/star.icon.js.map +1 -1
  563. package/lib/components/Icon/icons/target-solid.icon.js +1 -1
  564. package/lib/components/Icon/icons/target-solid.icon.js.map +1 -1
  565. package/lib/components/Icon/icons/target.icon.js +1 -1
  566. package/lib/components/Icon/icons/target.icon.js.map +1 -1
  567. package/lib/components/Icon/icons/thumbs-up-solid.icon.js +1 -1
  568. package/lib/components/Icon/icons/thumbs-up-solid.icon.js.map +1 -1
  569. package/lib/components/Icon/icons/thumbs-up.icon.js +1 -1
  570. package/lib/components/Icon/icons/thumbs-up.icon.js.map +1 -1
  571. package/lib/components/Icon/icons/times.icon.js +1 -1
  572. package/lib/components/Icon/icons/times.icon.js.map +1 -1
  573. package/lib/components/Icon/icons/trash-solid.icon.js +1 -1
  574. package/lib/components/Icon/icons/trash-solid.icon.js.map +1 -1
  575. package/lib/components/Icon/icons/trash.icon.js +1 -1
  576. package/lib/components/Icon/icons/trash.icon.js.map +1 -1
  577. package/lib/components/Icon/icons/twitter.icon.js +1 -1
  578. package/lib/components/Icon/icons/twitter.icon.js.map +1 -1
  579. package/lib/components/Icon/icons/undock.icon.js +1 -1
  580. package/lib/components/Icon/icons/undock.icon.js.map +1 -1
  581. package/lib/components/Icon/icons/user-solid.icon.js +1 -1
  582. package/lib/components/Icon/icons/user-solid.icon.js.map +1 -1
  583. package/lib/components/Icon/icons/user-star-solid.icon.js +1 -1
  584. package/lib/components/Icon/icons/user-star-solid.icon.js.map +1 -1
  585. package/lib/components/Icon/icons/user-star.icon.js +1 -1
  586. package/lib/components/Icon/icons/user-star.icon.js.map +1 -1
  587. package/lib/components/Icon/icons/user.icon.js +1 -1
  588. package/lib/components/Icon/icons/user.icon.js.map +1 -1
  589. package/lib/components/Icon/icons/warn-solid.icon.js +1 -1
  590. package/lib/components/Icon/icons/warn-solid.icon.js.map +1 -1
  591. package/lib/components/Icon/icons/warn.icon.js +1 -1
  592. package/lib/components/Icon/icons/warn.icon.js.map +1 -1
  593. package/lib/components/Icon/index.d.ts +1 -1
  594. package/lib/components/Icon/index.d.ts.map +1 -1
  595. package/lib/components/Icon/index.js.map +1 -1
  596. package/lib/components/Input/Input.d.ts +3 -1
  597. package/lib/components/Input/Input.d.ts.map +1 -1
  598. package/lib/components/Input/Input.js +16 -2
  599. package/lib/components/Input/Input.js.map +1 -1
  600. package/lib/components/Input/Input.styles.d.ts +1 -0
  601. package/lib/components/Input/Input.styles.d.ts.map +1 -1
  602. package/lib/components/Input/Input.styles.js +31 -0
  603. package/lib/components/Input/Input.styles.js.map +1 -1
  604. package/lib/components/Link/Link.d.ts +4 -1
  605. package/lib/components/Link/Link.d.ts.map +1 -1
  606. package/lib/components/Link/Link.js +87 -30
  607. package/lib/components/Link/Link.js.map +1 -1
  608. package/lib/components/List/CommaSeparatedList.d.ts.map +1 -1
  609. package/lib/components/List/CommaSeparatedList.js +6 -14
  610. package/lib/components/List/CommaSeparatedList.js.map +1 -1
  611. package/lib/components/List/List.d.ts +2 -2
  612. package/lib/components/List/List.d.ts.map +1 -1
  613. package/lib/components/List/List.js.map +1 -1
  614. package/lib/components/ListToolbar/ListToolbar.d.ts.map +1 -1
  615. package/lib/components/ListToolbar/ListToolbar.js +108 -53
  616. package/lib/components/ListToolbar/ListToolbar.js.map +1 -1
  617. package/lib/components/ListToolbar/ListToolbar.styles.d.ts +1 -0
  618. package/lib/components/ListToolbar/ListToolbar.styles.d.ts.map +1 -1
  619. package/lib/components/ListToolbar/ListToolbar.styles.js +38 -2
  620. package/lib/components/ListToolbar/ListToolbar.styles.js.map +1 -1
  621. package/lib/components/ListToolbar/ListToolbar.types.d.ts +28 -10
  622. package/lib/components/ListToolbar/ListToolbar.types.d.ts.map +1 -1
  623. package/lib/components/ListToolbar/ListToolbar.types.js.map +1 -1
  624. package/lib/components/ListToolbar/PresetMenuPopover.d.ts +12 -0
  625. package/lib/components/ListToolbar/PresetMenuPopover.d.ts.map +1 -0
  626. package/lib/components/ListToolbar/PresetMenuPopover.js +36 -0
  627. package/lib/components/ListToolbar/PresetMenuPopover.js.map +1 -0
  628. package/lib/components/ListToolbar/QueryOptionPopover.d.ts.map +1 -1
  629. package/lib/components/ListToolbar/QueryOptionPopover.js +14 -44
  630. package/lib/components/ListToolbar/QueryOptionPopover.js.map +1 -1
  631. package/lib/components/Location/LocationInput.d.ts +3 -1
  632. package/lib/components/Location/LocationInput.d.ts.map +1 -1
  633. package/lib/components/Location/LocationInput.js +2 -2
  634. package/lib/components/Location/LocationInput.js.map +1 -1
  635. package/lib/components/Location/LocationView.d.ts +1 -1
  636. package/lib/components/Location/LocationView.d.ts.map +1 -1
  637. package/lib/components/Location/LocationView.js +16 -10
  638. package/lib/components/Location/LocationView.js.map +1 -1
  639. package/lib/components/Location/utils.d.ts +3 -2
  640. package/lib/components/Location/utils.d.ts.map +1 -1
  641. package/lib/components/Location/utils.js +17 -9
  642. package/lib/components/Location/utils.js.map +1 -1
  643. package/lib/components/Menu/Menu.d.ts.map +1 -1
  644. package/lib/components/Menu/Menu.js +10 -6
  645. package/lib/components/Menu/Menu.js.map +1 -1
  646. package/lib/components/Menu/Menu.styles.d.ts.map +1 -1
  647. package/lib/components/Menu/Menu.styles.js +4 -2
  648. package/lib/components/Menu/Menu.styles.js.map +1 -1
  649. package/lib/components/Menu/Menu.types.d.ts +13 -0
  650. package/lib/components/Menu/Menu.types.d.ts.map +1 -1
  651. package/lib/components/Menu/Menu.types.js.map +1 -1
  652. package/lib/components/Menu/MenuGroup.d.ts.map +1 -1
  653. package/lib/components/Menu/MenuGroup.js +3 -3
  654. package/lib/components/Menu/MenuGroup.js.map +1 -1
  655. package/lib/components/Menu/MenuItem.d.ts.map +1 -1
  656. package/lib/components/Menu/MenuItem.js +4 -8
  657. package/lib/components/Menu/MenuItem.js.map +1 -1
  658. package/lib/components/Menu/MenuList.d.ts.map +1 -1
  659. package/lib/components/Menu/MenuList.js +23 -14
  660. package/lib/components/Menu/MenuList.js.map +1 -1
  661. package/lib/components/Menu/NavItemsList.d.ts +2 -2
  662. package/lib/components/Menu/NavItemsList.d.ts.map +1 -1
  663. package/lib/components/Menu/NavItemsList.js +12 -7
  664. package/lib/components/Menu/NavItemsList.js.map +1 -1
  665. package/lib/components/Menu/helpers.d.ts +7 -7
  666. package/lib/components/Menu/helpers.d.ts.map +1 -1
  667. package/lib/components/Menu/index.d.ts +1 -1
  668. package/lib/components/Menu/index.d.ts.map +1 -1
  669. package/lib/components/Menu/index.js +1 -1
  670. package/lib/components/Menu/index.js.map +1 -1
  671. package/lib/components/MetaList/MetaList.d.ts.map +1 -1
  672. package/lib/components/MetaList/MetaList.js +13 -10
  673. package/lib/components/MetaList/MetaList.js.map +1 -1
  674. package/lib/components/Modal/Contexts.d.ts.map +1 -1
  675. package/lib/components/Modal/Contexts.js +2 -3
  676. package/lib/components/Modal/Contexts.js.map +1 -1
  677. package/lib/components/Modal/MinimizedModal.d.ts.map +1 -1
  678. package/lib/components/Modal/MinimizedModal.js +2 -5
  679. package/lib/components/Modal/MinimizedModal.js.map +1 -1
  680. package/lib/components/Modal/Modal.d.ts.map +1 -1
  681. package/lib/components/Modal/Modal.js +3 -5
  682. package/lib/components/Modal/Modal.js.map +1 -1
  683. package/lib/components/Modal/Modal.types.d.ts +2 -6
  684. package/lib/components/Modal/Modal.types.d.ts.map +1 -1
  685. package/lib/components/Modal/Modal.types.js +1 -2
  686. package/lib/components/Modal/Modal.types.js.map +1 -1
  687. package/lib/components/Modal/ModalManager.d.ts +8 -2
  688. package/lib/components/Modal/ModalManager.d.ts.map +1 -1
  689. package/lib/components/Modal/ModalManager.js +14 -20
  690. package/lib/components/Modal/ModalManager.js.map +1 -1
  691. package/lib/components/Modal/index.d.ts +0 -1
  692. package/lib/components/Modal/index.d.ts.map +1 -1
  693. package/lib/components/Modal/index.js +0 -1
  694. package/lib/components/Modal/index.js.map +1 -1
  695. package/lib/components/MultiStepForm/FormProgress.d.ts +10 -0
  696. package/lib/components/MultiStepForm/FormProgress.d.ts.map +1 -0
  697. package/lib/components/{MultiStep/MultiStep.js → MultiStepForm/FormProgress.js} +8 -22
  698. package/lib/components/MultiStepForm/FormProgress.js.map +1 -0
  699. package/lib/components/{MultiStep/MultiStep.styles.d.ts → MultiStepForm/FormProgress.styles.d.ts} +2 -4
  700. package/lib/components/MultiStepForm/FormProgress.styles.d.ts.map +1 -0
  701. package/lib/components/{MultiStep/MultiStep.styles.js → MultiStepForm/FormProgress.styles.js} +3 -4
  702. package/lib/components/MultiStepForm/FormProgress.styles.js.map +1 -0
  703. package/lib/components/MultiStepForm/MultiStepForm.d.ts +9 -0
  704. package/lib/components/MultiStepForm/MultiStepForm.d.ts.map +1 -0
  705. package/lib/components/MultiStepForm/MultiStepForm.js +50 -0
  706. package/lib/components/MultiStepForm/MultiStepForm.js.map +1 -0
  707. package/lib/components/MultiStepForm/MultiStepForm.types.d.ts +48 -0
  708. package/lib/components/MultiStepForm/MultiStepForm.types.d.ts.map +1 -0
  709. package/lib/components/MultiStepForm/MultiStepForm.types.js +2 -0
  710. package/lib/components/MultiStepForm/MultiStepForm.types.js.map +1 -0
  711. package/lib/components/MultiStepForm/index.d.ts +2 -0
  712. package/lib/components/MultiStepForm/index.d.ts.map +1 -0
  713. package/lib/components/MultiStepForm/index.js +2 -0
  714. package/lib/components/MultiStepForm/index.js.map +1 -0
  715. package/lib/components/Number/NumberDisplay.d.ts +0 -5
  716. package/lib/components/Number/NumberDisplay.d.ts.map +1 -1
  717. package/lib/components/Number/NumberDisplay.js +8 -12
  718. package/lib/components/Number/NumberDisplay.js.map +1 -1
  719. package/lib/components/Number/NumberInput.d.ts +1 -1
  720. package/lib/components/Number/NumberInput.d.ts.map +1 -1
  721. package/lib/components/Number/NumberInput.js +51 -25
  722. package/lib/components/Number/NumberInput.js.map +1 -1
  723. package/lib/components/Number/NumberInput.styles.d.ts +8 -5
  724. package/lib/components/Number/NumberInput.styles.d.ts.map +1 -1
  725. package/lib/components/Number/NumberInput.styles.js +6 -3
  726. package/lib/components/Number/NumberInput.styles.js.map +1 -1
  727. package/lib/components/Number/NumberInput.types.d.ts +56 -21
  728. package/lib/components/Number/NumberInput.types.d.ts.map +1 -1
  729. package/lib/components/Number/NumberInput.types.js.map +1 -1
  730. package/lib/components/Number/NumberRangeInput.d.ts +6 -0
  731. package/lib/components/Number/NumberRangeInput.d.ts.map +1 -0
  732. package/lib/components/Number/NumberRangeInput.js +30 -0
  733. package/lib/components/Number/NumberRangeInput.js.map +1 -0
  734. package/lib/components/Number/index.d.ts +3 -2
  735. package/lib/components/Number/index.d.ts.map +1 -1
  736. package/lib/components/Number/index.js +1 -0
  737. package/lib/components/Number/index.js.map +1 -1
  738. package/lib/components/Number/utils.d.ts +3 -4
  739. package/lib/components/Number/utils.d.ts.map +1 -1
  740. package/lib/components/Number/utils.js +41 -22
  741. package/lib/components/Number/utils.js.map +1 -1
  742. package/lib/components/PageTemplates/CategorySubPage.d.ts +3 -3
  743. package/lib/components/PageTemplates/CategorySubPage.d.ts.map +1 -1
  744. package/lib/components/PageTemplates/CategorySubPage.js.map +1 -1
  745. package/lib/components/PageTemplates/DashboardPage.d.ts.map +1 -1
  746. package/lib/components/PageTemplates/DashboardPage.js +1 -4
  747. package/lib/components/PageTemplates/DashboardPage.js.map +1 -1
  748. package/lib/components/PageTemplates/PageTemplates.d.ts +1 -2
  749. package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
  750. package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
  751. package/lib/components/Phone/PhoneInput.d.ts.map +1 -1
  752. package/lib/components/Phone/PhoneInput.js +13 -3
  753. package/lib/components/Phone/PhoneInput.js.map +1 -1
  754. package/lib/components/Popover/Popover.d.ts +2 -0
  755. package/lib/components/Popover/Popover.d.ts.map +1 -1
  756. package/lib/components/Popover/Popover.js +13 -9
  757. package/lib/components/Popover/Popover.js.map +1 -1
  758. package/lib/components/Popover/Popover.styles.d.ts.map +1 -1
  759. package/lib/components/Popover/Popover.styles.js +12 -57
  760. package/lib/components/Popover/Popover.styles.js.map +1 -1
  761. package/lib/components/Popover/PopoverContext.d.ts +1 -0
  762. package/lib/components/Popover/PopoverContext.d.ts.map +1 -1
  763. package/lib/components/Popover/PopoverContext.js +2 -1
  764. package/lib/components/Popover/PopoverContext.js.map +1 -1
  765. package/lib/components/Popover/PopoverManager.d.ts.map +1 -1
  766. package/lib/components/Popover/PopoverManager.js +2 -1
  767. package/lib/components/Popover/PopoverManager.js.map +1 -1
  768. package/lib/components/Progress/Ring.js +2 -2
  769. package/lib/components/Progress/Ring.js.map +1 -1
  770. package/lib/components/RadioButton/RadioButton.d.ts +3 -1
  771. package/lib/components/RadioButton/RadioButton.d.ts.map +1 -1
  772. package/lib/components/RadioButton/RadioButton.js.map +1 -1
  773. package/lib/components/RadioCheck/RadioCheck.d.ts +2 -0
  774. package/lib/components/RadioCheck/RadioCheck.d.ts.map +1 -1
  775. package/lib/components/RadioCheck/RadioCheck.js +7 -5
  776. package/lib/components/RadioCheck/RadioCheck.js.map +1 -1
  777. package/lib/components/RadioCheckGroup/RadioCheckGroup.d.ts +3 -0
  778. package/lib/components/RadioCheckGroup/RadioCheckGroup.d.ts.map +1 -1
  779. package/lib/components/RadioCheckGroup/RadioCheckGroup.js +1 -1
  780. package/lib/components/RadioCheckGroup/RadioCheckGroup.js.map +1 -1
  781. package/lib/components/RadioCheckGroup/index.d.ts +1 -1
  782. package/lib/components/RadioCheckGroup/index.d.ts.map +1 -1
  783. package/lib/components/RadioCheckGroup/index.js +1 -1
  784. package/lib/components/RadioCheckGroup/index.js.map +1 -1
  785. package/lib/components/SearchInput/SearchInput.d.ts +24 -8
  786. package/lib/components/SearchInput/SearchInput.d.ts.map +1 -1
  787. package/lib/components/SearchInput/SearchInput.js +127 -94
  788. package/lib/components/SearchInput/SearchInput.js.map +1 -1
  789. package/lib/components/SearchInput/SearchInput.styles.d.ts +16 -0
  790. package/lib/components/SearchInput/SearchInput.styles.d.ts.map +1 -0
  791. package/lib/components/SearchInput/SearchInput.styles.js +129 -0
  792. package/lib/components/SearchInput/SearchInput.styles.js.map +1 -0
  793. package/lib/components/SearchInput/index.d.ts +1 -1
  794. package/lib/components/SearchInput/index.d.ts.map +1 -1
  795. package/lib/components/SearchInput/index.js +1 -1
  796. package/lib/components/SearchInput/index.js.map +1 -1
  797. package/lib/components/Select/Select.d.ts +5 -0
  798. package/lib/components/Select/Select.d.ts.map +1 -1
  799. package/lib/components/Select/Select.js +17 -7
  800. package/lib/components/Select/Select.js.map +1 -1
  801. package/lib/components/Skeleton/ParagraphSkeleton.d.ts.map +1 -1
  802. package/lib/components/Skeleton/ParagraphSkeleton.js +2 -2
  803. package/lib/components/Skeleton/ParagraphSkeleton.js.map +1 -1
  804. package/lib/components/SkipLinks/SkipLinks.d.ts +15 -0
  805. package/lib/components/SkipLinks/SkipLinks.d.ts.map +1 -0
  806. package/lib/components/SkipLinks/SkipLinks.js +67 -0
  807. package/lib/components/SkipLinks/SkipLinks.js.map +1 -0
  808. package/lib/components/SkipLinks/index.d.ts +4 -0
  809. package/lib/components/SkipLinks/index.d.ts.map +1 -0
  810. package/lib/components/SkipLinks/index.js +3 -0
  811. package/lib/components/SkipLinks/index.js.map +1 -0
  812. package/lib/components/Slider/Slider.styles.d.ts +1 -1
  813. package/lib/components/SummaryItem/SummaryItem.d.ts +2 -2
  814. package/lib/components/SummaryList/ViewAll.d.ts.map +1 -1
  815. package/lib/components/SummaryList/ViewAll.js +6 -2
  816. package/lib/components/SummaryList/ViewAll.js.map +1 -1
  817. package/lib/components/Tabs/Tab.d.ts.map +1 -1
  818. package/lib/components/Tabs/Tab.js +0 -1
  819. package/lib/components/Tabs/Tab.js.map +1 -1
  820. package/lib/components/Tabs/TabPanel.d.ts.map +1 -1
  821. package/lib/components/Tabs/TabPanel.js +1 -7
  822. package/lib/components/Tabs/TabPanel.js.map +1 -1
  823. package/lib/components/Tabs/Tabs.d.ts.map +1 -1
  824. package/lib/components/Tabs/Tabs.js +1 -1
  825. package/lib/components/Tabs/Tabs.js.map +1 -1
  826. package/lib/components/Text/Text.js +2 -2
  827. package/lib/components/Text/Text.js.map +1 -1
  828. package/lib/components/TextArea/TextArea.d.ts.map +1 -1
  829. package/lib/components/TextArea/TextArea.js +8 -3
  830. package/lib/components/TextArea/TextArea.js.map +1 -1
  831. package/lib/components/Toaster/Context.d.ts +7 -0
  832. package/lib/components/Toaster/Context.d.ts.map +1 -0
  833. package/lib/components/Toaster/Context.js +6 -0
  834. package/lib/components/Toaster/Context.js.map +1 -0
  835. package/lib/components/Toaster/Toaster.d.ts +8 -40
  836. package/lib/components/Toaster/Toaster.d.ts.map +1 -1
  837. package/lib/components/Toaster/Toaster.js +12 -12
  838. package/lib/components/Toaster/Toaster.js.map +1 -1
  839. package/lib/components/Toaster/Toaster.types.d.ts +31 -0
  840. package/lib/components/Toaster/Toaster.types.d.ts.map +1 -0
  841. package/lib/components/Toaster/Toaster.types.js +2 -0
  842. package/lib/components/Toaster/Toaster.types.js.map +1 -0
  843. package/lib/components/Toaster/index.d.ts +1 -2
  844. package/lib/components/Toaster/index.d.ts.map +1 -1
  845. package/lib/components/Toaster/index.js +0 -1
  846. package/lib/components/Toaster/index.js.map +1 -1
  847. package/lib/components/Tooltip/Tooltip.d.ts +5 -0
  848. package/lib/components/Tooltip/Tooltip.d.ts.map +1 -1
  849. package/lib/components/Tooltip/Tooltip.js +23 -5
  850. package/lib/components/Tooltip/Tooltip.js.map +1 -1
  851. package/lib/components/Tree/StandardTree.d.ts.map +1 -1
  852. package/lib/components/Tree/StandardTree.js +27 -13
  853. package/lib/components/Tree/StandardTree.js.map +1 -1
  854. package/lib/components/Tree/StandardTree.styles.js +3 -3
  855. package/lib/components/Tree/StandardTree.styles.js.map +1 -1
  856. package/lib/components/Tree/StandardTree.types.d.ts +1 -0
  857. package/lib/components/Tree/StandardTree.types.d.ts.map +1 -1
  858. package/lib/components/Tree/StandardTree.types.js.map +1 -1
  859. package/lib/hooks/index.d.ts +3 -0
  860. package/lib/hooks/index.d.ts.map +1 -1
  861. package/lib/hooks/index.js +3 -0
  862. package/lib/hooks/index.js.map +1 -1
  863. package/lib/hooks/useActiveDescendant.d.ts +5 -1
  864. package/lib/hooks/useActiveDescendant.d.ts.map +1 -1
  865. package/lib/hooks/useActiveDescendant.js +175 -99
  866. package/lib/hooks/useActiveDescendant.js.map +1 -1
  867. package/lib/hooks/useAutoResize.d.ts +1 -1
  868. package/lib/hooks/useAutoResize.d.ts.map +1 -1
  869. package/lib/hooks/useAutoResize.js +14 -6
  870. package/lib/hooks/useAutoResize.js.map +1 -1
  871. package/lib/hooks/useBreakpoint.d.ts +3 -2
  872. package/lib/hooks/useBreakpoint.d.ts.map +1 -1
  873. package/lib/hooks/useBreakpoint.js +10 -13
  874. package/lib/hooks/useBreakpoint.js.map +1 -1
  875. package/lib/hooks/useConfiguration.d.ts +1 -0
  876. package/lib/hooks/useConfiguration.d.ts.map +1 -1
  877. package/lib/hooks/useConfiguration.js +9 -2
  878. package/lib/hooks/useConfiguration.js.map +1 -1
  879. package/lib/hooks/useDraggable.d.ts +1 -1
  880. package/lib/hooks/useDraggable.d.ts.map +1 -1
  881. package/lib/hooks/useDraggable.js +35 -8
  882. package/lib/hooks/useDraggable.js.map +1 -1
  883. package/lib/hooks/useFocusWithin.d.ts.map +1 -1
  884. package/lib/hooks/useFocusWithin.js +0 -8
  885. package/lib/hooks/useFocusWithin.js.map +1 -1
  886. package/lib/hooks/useI18n.d.ts +131 -34
  887. package/lib/hooks/useI18n.d.ts.map +1 -1
  888. package/lib/hooks/useI18n.js +2 -1
  889. package/lib/hooks/useI18n.js.map +1 -1
  890. package/lib/hooks/useInputFormatter.d.ts.map +1 -1
  891. package/lib/hooks/useInputFormatter.js +5 -0
  892. package/lib/hooks/useInputFormatter.js.map +1 -1
  893. package/lib/hooks/useLongPress.d.ts +1 -1
  894. package/lib/hooks/useLongPress.d.ts.map +1 -1
  895. package/lib/hooks/useModalContext.d.ts +7 -0
  896. package/lib/hooks/useModalContext.d.ts.map +1 -0
  897. package/lib/hooks/useModalContext.js +12 -0
  898. package/lib/hooks/useModalContext.js.map +1 -0
  899. package/lib/hooks/useModalManager.d.ts +8 -0
  900. package/lib/hooks/useModalManager.d.ts.map +1 -0
  901. package/lib/hooks/useModalManager.js +16 -0
  902. package/lib/hooks/useModalManager.js.map +1 -0
  903. package/lib/hooks/useOS.d.ts.map +1 -1
  904. package/lib/hooks/useOS.js +1 -2
  905. package/lib/hooks/useOS.js.map +1 -1
  906. package/lib/hooks/useScrollStick.d.ts +1 -1
  907. package/lib/hooks/useScrollStick.d.ts.map +1 -1
  908. package/lib/hooks/useToaster.d.ts +8 -0
  909. package/lib/hooks/useToaster.d.ts.map +1 -0
  910. package/lib/hooks/useToaster.js +16 -0
  911. package/lib/hooks/useToaster.js.map +1 -0
  912. package/lib/hooks/useTransitionState.js +1 -1
  913. package/lib/hooks/useTransitionState.js.map +1 -1
  914. package/lib/i18n/default.d.ts +131 -34
  915. package/lib/i18n/default.d.ts.map +1 -1
  916. package/lib/i18n/default.js +154 -47
  917. package/lib/i18n/default.js.map +1 -1
  918. package/lib/i18n/i18n.d.ts +127 -698
  919. package/lib/i18n/i18n.d.ts.map +1 -1
  920. package/lib/i18n/translate.d.ts +3 -0
  921. package/lib/i18n/translate.d.ts.map +1 -1
  922. package/lib/i18n/translate.js.map +1 -1
  923. package/lib/index.d.ts +9 -2
  924. package/lib/index.d.ts.map +1 -1
  925. package/lib/index.js +9 -2
  926. package/lib/index.js.map +1 -1
  927. package/lib/init.d.ts +8 -0
  928. package/lib/init.d.ts.map +1 -0
  929. package/lib/init.js +5 -0
  930. package/lib/init.js.map +1 -0
  931. package/lib/register-contexts.d.ts +2 -0
  932. package/lib/register-contexts.d.ts.map +1 -0
  933. package/lib/register-contexts.js +10 -0
  934. package/lib/register-contexts.js.map +1 -0
  935. package/lib/styles/utils.d.ts +1 -1
  936. package/lib/styles/utils.d.ts.map +1 -1
  937. package/lib/styles/utils.js.map +1 -1
  938. package/lib/theme/ThemeMachine.d.ts +11 -3
  939. package/lib/theme/ThemeMachine.d.ts.map +1 -1
  940. package/lib/theme/ThemeMachine.js +28 -26
  941. package/lib/theme/ThemeMachine.js.map +1 -1
  942. package/lib/theme/index.d.ts +1 -0
  943. package/lib/theme/index.d.ts.map +1 -1
  944. package/lib/theme/index.js +1 -0
  945. package/lib/theme/index.js.map +1 -1
  946. package/lib/theme/theme.d.ts +54 -0
  947. package/lib/theme/theme.d.ts.map +1 -1
  948. package/lib/theme/themeDefinition.json +33 -1
  949. package/lib/theme/themeOverrides.schema.json +9 -0
  950. package/lib/theme/themes/buildTheme.json +0 -3
  951. package/lib/theme/themes/darkTheme.json +3 -1
  952. package/lib/theme/themes/legacyBuildTheme.json +0 -3
  953. package/lib/theme/themes/wssTheme.json +6 -0
  954. package/lib/types/types.d.ts +3 -0
  955. package/lib/types/types.d.ts.map +1 -1
  956. package/lib/types/types.js.map +1 -1
  957. package/lib/utils/utils.d.ts +5 -0
  958. package/lib/utils/utils.d.ts.map +1 -1
  959. package/lib/utils/utils.js +23 -0
  960. package/lib/utils/utils.js.map +1 -1
  961. package/package.json +10 -5
  962. package/lib/components/AppShell/SkipNavigation.d.ts +0 -4
  963. package/lib/components/AppShell/SkipNavigation.d.ts.map +0 -1
  964. package/lib/components/AppShell/SkipNavigation.js +0 -61
  965. package/lib/components/AppShell/SkipNavigation.js.map +0 -1
  966. package/lib/components/Currency/currencyCodes.d.ts +0 -3
  967. package/lib/components/Currency/currencyCodes.d.ts.map +0 -1
  968. package/lib/components/Currency/currencyCodes.js +0 -182
  969. package/lib/components/Currency/currencyCodes.js.map +0 -1
  970. package/lib/components/DateTime/types.d.ts +0 -9
  971. package/lib/components/DateTime/types.d.ts.map +0 -1
  972. package/lib/components/DateTime/types.js +0 -2
  973. package/lib/components/DateTime/types.js.map +0 -1
  974. package/lib/components/Icon/icons/script-solid.icon.d.ts.map +0 -1
  975. package/lib/components/Icon/icons/script-solid.icon.js +0 -6
  976. package/lib/components/Icon/icons/script-solid.icon.js.map +0 -1
  977. package/lib/components/MultiStep/MultiStep.d.ts +0 -6
  978. package/lib/components/MultiStep/MultiStep.d.ts.map +0 -1
  979. package/lib/components/MultiStep/MultiStep.js.map +0 -1
  980. package/lib/components/MultiStep/MultiStep.styles.d.ts.map +0 -1
  981. package/lib/components/MultiStep/MultiStep.styles.js.map +0 -1
  982. package/lib/components/MultiStep/MultiStep.types.d.ts +0 -36
  983. package/lib/components/MultiStep/MultiStep.types.d.ts.map +0 -1
  984. package/lib/components/MultiStep/MultiStep.types.js +0 -2
  985. package/lib/components/MultiStep/MultiStep.types.js.map +0 -1
  986. package/lib/components/MultiStep/index.d.ts +0 -3
  987. package/lib/components/MultiStep/index.d.ts.map +0 -1
  988. package/lib/components/MultiStep/index.js +0 -2
  989. package/lib/components/MultiStep/index.js.map +0 -1
@@ -1,4 +1,5 @@
1
- import { MouseEvent, Ref, ComponentType } from 'react';
1
+ import { MouseEvent, Ref, ComponentType, ReactNode } from 'react';
2
+ import { FormControlProps } from '@pega/cosmos-react-core/lib/components/FormControl';
2
3
  import { SearchInputProps } from '../SearchInput';
3
4
  import { MenuProps } from '../Menu';
4
5
  import { Action, BaseProps } from '../../types';
@@ -11,6 +12,8 @@ export interface ViewSelectorProps {
11
12
  }[];
12
13
  /** Called when a view is selected. */
13
14
  onViewSelect: MenuProps['onItemClick'];
15
+ defaultId?: string;
16
+ appDefaultId?: string;
14
17
  }
15
18
  export interface QueryOption {
16
19
  /** A count representing the number of applied conditions within the query option. */
@@ -32,33 +35,44 @@ export interface QueryOptionDialogProps extends QueryOption {
32
35
  }
33
36
  /** Optionally provide query option presets. */
34
37
  export interface PresetMenuProps extends QueryOption {
38
+ /** Mode defining whether menu selection is single or multi mode. */
35
39
  mode?: Exclude<MenuProps['mode'], 'action'>;
40
+ /** Items of the menu. */
36
41
  items: {
37
42
  id: string;
38
43
  text: string;
39
44
  selected: boolean;
40
45
  icon?: string;
41
46
  }[];
47
+ /** Callback invoked on item selection. Passes the item id as an argument. */
42
48
  onItemClick: MenuProps['onItemClick'];
43
49
  }
44
50
  export declare type QueryOptionId = 'filter' | 'sort' | 'group';
45
- export declare type QueryOptionDialogState = {
46
- id: 'filter' | 'sort' | 'group';
47
- props: QueryOptionDialogProps;
48
- popoverTarget: HTMLButtonElement | null;
49
- } | null;
50
51
  export interface ListToolbarProps extends BaseProps {
51
- /** Rendering a simple heading or view selection menu.. */
52
- heading: string | ViewSelectorProps;
53
- /** Callback that will render a Create new button and is fired when that button is clicked. */
54
- onCreateNew?: (e: MouseEvent) => void;
52
+ /** Renders a simple heading or view selection menu. */
53
+ heading?: string | ViewSelectorProps;
54
+ formControlProps?: Pick<FormControlProps, 'required'>;
55
+ /** Props related to new item creation button. */
56
+ createNew?: {
57
+ /** Label of the new item creation button. */
58
+ label?: string;
59
+ /** Callback that will render a Create new button and is fired when that button is clicked. */
60
+ onClick: (e: MouseEvent) => void;
61
+ };
55
62
  /** Props related to the Search Input. */
56
63
  search?: SearchInputProps;
57
64
  /** Total returned results related for a given search. Optional indication of a selected item count. */
58
65
  count?: {
59
66
  total?: number;
67
+ /**
68
+ * If true renders + next to total number.
69
+ * @default false
70
+ */
71
+ totalHasMore?: boolean;
60
72
  selected?: number;
61
73
  };
74
+ /** Additional actions region */
75
+ additionalActions?: ReactNode;
62
76
  /** Custom Rendering or available presets for filtering. */
63
77
  filter?: QueryOptionDialogProps | PresetMenuProps;
64
78
  /** Custom Rendering or available presets for sorting. */
@@ -67,6 +81,10 @@ export interface ListToolbarProps extends BaseProps {
67
81
  group?: QueryOptionDialogProps | PresetMenuProps;
68
82
  /** Top level dataset actions. */
69
83
  actions?: Action[];
84
+ /** Ref for the actions button element. */
85
+ actionsButtonRef?: Ref<HTMLButtonElement>;
86
+ /** Renders toolbar in condensed mode. */
87
+ condensed?: boolean;
70
88
  /** Ref for the wrapping element. */
71
89
  ref?: Ref<HTMLDivElement>;
72
90
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ListToolbar.types.d.ts","sourceRoot":"","sources":["../../../src/components/ListToolbar/ListToolbar.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAEhD,MAAM,WAAW,iBAAiB;IAChC,wCAAwC;IACxC,KAAK,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAA;KAAE,EAAE,CAAC;IACzD,sCAAsC;IACtC,YAAY,EAAE,SAAS,CAAC,aAAa,CAAC,CAAC;CACxC;AACD,MAAM,WAAW,WAAW;IAC1B,qFAAqF;IACrF,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,sBAAuB,SAAQ,WAAW;IACzD,4EAA4E;IAC5E,QAAQ,EAAE,aAAa,CAAC;IACxB;;;OAGG;IACH,QAAQ,EAAE,MAAM,OAAO,GAAG,IAAI,CAAC;IAC/B;;;OAGG;IACH,QAAQ,EAAE,MAAM,OAAO,GAAG,IAAI,CAAC;CAChC;AAED,+CAA+C;AAC/C,MAAM,WAAW,eAAgB,SAAQ,WAAW;IAClD,IAAI,CAAC,EAAE,OAAO,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,QAAQ,CAAC,CAAC;IAC5C,KAAK,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,OAAO,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACxE,WAAW,EA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AAQ,SAAS;IACjD,uDAAuD;IACvD,OAAO,CAAC,EAAE,MAAM,GAAG,iBAAiB,CAAC;IACrC,gBAAgB,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC,CAAC;IACtD,iDAAiD;IACjD,SAAS,CAAC,EAAE;QACV,6CAA6C;QAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,8FAA8F;QAC9F,OAAO,EAAE,CAAC,CAAC,EAAE,UAAU,KAAK,IAAI,CAAC;KAClC,CAAC;IACF,yCAAyC;IACzC,MAAM,CAAC,EAAE,gBAAgB,CAAC;IAC1B,uGAAuG;IACvG,KAAK,CAAC,EAAE;QACN,KAAK,CAAC,EAAE,MAAM,CAAC;QACf;;;WAGG;QACH,YAAY,CAAC,EAAE,OAAO,CAAC;QACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,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,yCAAyC;IACzC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,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 { MouseEvent, Ref, ComponentType } from 'react';\n\nimport { SearchInputProps } from '../SearchInput';\nimport { MenuProps } from '../Menu';\nimport { Action, BaseProps } from '../../types';\n\nexport interface ViewSelectorProps {\n /** A list of pre-defined data views. */\n views: { id: string; text: string; selected: boolean }[];\n /** Called when a view is selected. */\n onViewSelect: MenuProps['onItemClick'];\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 extends QueryOption {\n /** A component to render the content portion of the query option dialog. */\n renderer: ComponentType;\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?: Exclude<MenuProps['mode'], 'action'>;\n items: { id: string; text: string; selected: boolean; icon?: string }[];\n onItemClick: MenuProps['onItemClick'];\n}\nexport type QueryOptionId = 'filter' | 'sort' | 'group';\n\nexport type QueryOptionDialogState = {\n id: 'filter' | 'sort' | 'group';\n props: QueryOptionDialogProps;\n popoverTarget: HTMLButtonElement | null;\n} | null;\n\nexport interface ListToolbarProps extends BaseProps {\n /** Rendering a simple heading or view selection menu.. */\n heading: string | ViewSelectorProps;\n /** Callback that will render a Create new button and is fired when that button is clicked. */\n onCreateNew?: (e: MouseEvent) => void;\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 selected?: number;\n };\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 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 { MouseEvent, Ref, ComponentType, ReactNode } from 'react';\n\nimport { FormControlProps } from '@pega/cosmos-react-core/lib/components/FormControl';\n\nimport { SearchInputProps } from '../SearchInput';\nimport { MenuProps } from '../Menu';\nimport { Action, BaseProps } from '../../types';\n\nexport interface ViewSelectorProps {\n /** A list of pre-defined data views. */\n views: {\n id: string;\n text: string;\n selected: boolean;\n }[];\n /** Called when a view is selected. */\n onViewSelect: MenuProps['onItemClick'];\n defaultId?: string;\n appDefaultId?: string;\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 extends QueryOption {\n /** A component to render the content portion of the query option dialog. */\n renderer: ComponentType;\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?: Exclude<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 {\n /** Renders a simple heading or view selection menu. */\n heading?: string | ViewSelectorProps;\n formControlProps?: Pick<FormControlProps, 'required'>;\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 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 /** Renders toolbar in condensed mode. */\n condensed?: boolean;\n /** Ref for the wrapping element. */\n ref?: Ref<HTMLDivElement>;\n}\n"]}
@@ -0,0 +1,12 @@
1
+ import { FunctionComponent, RefObject } from 'react';
2
+ import type { MenuProps } from '../Menu/Menu.types';
3
+ export interface PresetMenuPopoverProps {
4
+ heading?: string;
5
+ buttonRef: RefObject<HTMLButtonElement>;
6
+ menu?: MenuProps;
7
+ isOpen: boolean;
8
+ onClose: () => void;
9
+ }
10
+ declare const PresetMenuPopover: FunctionComponent<PresetMenuPopoverProps>;
11
+ export default PresetMenuPopover;
12
+ //# sourceMappingURL=PresetMenuPopover.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PresetMenuPopover.d.ts","sourceRoot":"","sources":["../../../src/components/ListToolbar/PresetMenuPopover.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAc,SAAS,EAAsB,MAAM,OAAO,CAAC;AAKrF,OAAO,KAAK,EAAE,SAAS,EAA6B,MAAM,oBAAoB,CAAC;AAO/E,MAAM,WAAW,sBAAsB;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,SAAS,CAAC,iBAAiB,CAAC,CAAC;IACxC,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAgBD,QAAA,MAAM,iBAAiB,EAAE,iBAAiB,CAAC,sBAAsB,CAqDhE,CAAC;AACF,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect } from 'react';
3
+ import styled, { css } from 'styled-components';
4
+ import Popover from '../Popover';
5
+ import { useConsolidatedRef, useDirection, useOuterEvent, useEscape, useUID } from '../../hooks';
6
+ import Menu from '../Menu';
7
+ import { defaultThemeProp } from '../../theme';
8
+ import Flex from '../Flex';
9
+ import { getFocusables } from '../../utils';
10
+ import Text from '../Text';
11
+ const StyledPresetMenuPopover = styled(Popover)(({ theme: { base: { 'content-width': contentWidth } } }) => {
12
+ return css `
13
+ min-width: ${contentWidth.xs};
14
+ `;
15
+ });
16
+ StyledPresetMenuPopover.defaultProps = defaultThemeProp;
17
+ const PresetMenuPopover = ({ heading, buttonRef, menu, isOpen, onClose }) => {
18
+ const popoverRef = useConsolidatedRef();
19
+ const { rtl } = useDirection();
20
+ const headingId = useUID();
21
+ useEscape(onClose, buttonRef);
22
+ useOuterEvent(['mousedown', 'focusin'], [popoverRef], () => isOpen && onClose());
23
+ useEffect(() => {
24
+ getFocusables(popoverRef)[0]?.focus();
25
+ }, [popoverRef]);
26
+ return (_jsx(StyledPresetMenuPopover, { placement: rtl ? 'bottom-end' : 'bottom-start', hideOnTargetHidden: true, show: !!menu && isOpen, target: buttonRef?.current, ref: popoverRef, "aria-labelledby": headingId, children: menu && (_jsxs(_Fragment, { children: [_jsx(Flex, { container: { pad: [1, 2] }, children: _jsx(Text, { variant: 'h3', id: headingId, children: heading }) }), _jsx(Menu, { ...menu, items: menu.items, onItemClick: (itemId, e) => {
27
+ if (menu?.mode !== 'multi-select' &&
28
+ e
29
+ .detail > 0) {
30
+ onClose();
31
+ }
32
+ menu?.onItemClick?.(itemId, e);
33
+ }, focusControlEl: buttonRef?.current ?? undefined })] })) }));
34
+ };
35
+ export default PresetMenuPopover;
36
+ //# sourceMappingURL=PresetMenuPopover.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PresetMenuPopover.js","sourceRoot":"","sources":["../../../src/components/ListToolbar/PresetMenuPopover.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAqD,SAAS,EAAE,MAAM,OAAO,CAAC;AACrF,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,OAAO,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAEjG,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,IAAI,MAAM,SAAS,CAAC;AAU3B,MAAM,uBAAuB,GAAG,MAAM,CAAC,OAAO,CAAC,CAC7C,CAAC,EACC,KAAK,EAAE,EACL,IAAI,EAAE,EAAE,eAAe,EAAE,YAAY,EAAE,EACxC,EACF,EAAE,EAAE;IACH,OAAO,GAAG,CAAA;mBACK,YAAY,CAAC,EAAE;KAC7B,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,uBAAuB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAExD,MAAM,iBAAiB,GAA8C,CAAC,EACpE,OAAO,EACP,SAAS,EACT,IAAI,EACJ,MAAM,EACN,OAAO,EACgB,EAAE,EAAE;IAC3B,MAAM,UAAU,GAAG,kBAAkB,EAAkB,CAAC;IACxD,MAAM,EAAE,GAAG,EAAE,GAAG,YAAY,EAAE,CAAC;IAC/B,MAAM,SAAS,GAAG,MAAM,EAAE,CAAC;IAE3B,SAAS,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAC9B,aAAa,CAAC,CAAC,WAAW,EAAE,SAAS,CAAC,EAAE,CAAC,UAAU,CAAC,EAAE,GAAG,EAAE,CAAC,MAAM,IAAI,OAAO,EAAE,CAAC,CAAC;IAEjF,SAAS,CAAC,GAAG,EAAE;QACb,aAAa,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC;IACxC,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IAEjB,OAAO,CACL,KAAC,uBAAuB,IACtB,SAAS,EAAE,GAAG,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,cAAc,EAC9C,kBAAkB,QAClB,IAAI,EAAE,CAAC,CAAC,IAAI,IAAI,MAAM,EACtB,MAAM,EAAE,SAAS,EAAE,OAAO,EAC1B,GAAG,EAAE,UAAU,qBACE,SAAS,YAEzB,IAAI,IAAI,CACP,8BACE,KAAC,IAAI,IAAC,SAAS,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,YAC9B,KAAC,IAAI,IAAC,OAAO,EAAC,IAAI,EAAC,EAAE,EAAE,SAAS,YAC7B,OAAO,GACH,GACF,EACP,KAAC,IAAI,OACC,IAAI,EACR,KAAK,EAAE,IAAI,CAAC,KAAK,EACjB,WAAW,EAAE,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;wBACzB,IACE,IAAI,EAAE,IAAI,KAAK,cAAc;4BAC5B,CAAgF;iCAC9E,MAAM,GAAG,CAAC,EACb;4BACA,OAAO,EAAE,CAAC;yBACX;wBACD,IAAI,EAAE,WAAW,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;oBACjC,CAAC,EACD,cAAc,EAAE,SAAS,EAAE,OAAO,IAAI,SAAS,GAC/C,IACD,CACJ,GACuB,CAC3B,CAAC;AACJ,CAAC,CAAC;AACF,eAAe,iBAAiB,CAAC","sourcesContent":["import { FunctionComponent, MouseEvent, RefObject, UIEvent, useEffect } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport Popover from '../Popover';\nimport { useConsolidatedRef, useDirection, useOuterEvent, useEscape, useUID } from '../../hooks';\nimport type { MenuProps, AcceptedMouseEventElement } from '../Menu/Menu.types';\nimport Menu from '../Menu';\nimport { defaultThemeProp } from '../../theme';\nimport Flex from '../Flex';\nimport { getFocusables } from '../../utils';\nimport Text from '../Text';\n\nexport interface PresetMenuPopoverProps {\n heading?: string;\n buttonRef: RefObject<HTMLButtonElement>;\n menu?: MenuProps;\n isOpen: boolean;\n onClose: () => void;\n}\n\nconst StyledPresetMenuPopover = styled(Popover)(\n ({\n theme: {\n base: { 'content-width': contentWidth }\n }\n }) => {\n return css`\n min-width: ${contentWidth.xs};\n `;\n }\n);\n\nStyledPresetMenuPopover.defaultProps = defaultThemeProp;\n\nconst PresetMenuPopover: FunctionComponent<PresetMenuPopoverProps> = ({\n heading,\n buttonRef,\n menu,\n isOpen,\n onClose\n}: PresetMenuPopoverProps) => {\n const popoverRef = useConsolidatedRef<HTMLDivElement>();\n const { rtl } = useDirection();\n const headingId = useUID();\n\n useEscape(onClose, buttonRef);\n useOuterEvent(['mousedown', 'focusin'], [popoverRef], () => isOpen && onClose());\n\n useEffect(() => {\n getFocusables(popoverRef)[0]?.focus();\n }, [popoverRef]);\n\n return (\n <StyledPresetMenuPopover\n placement={rtl ? 'bottom-end' : 'bottom-start'}\n hideOnTargetHidden\n show={!!menu && isOpen}\n target={buttonRef?.current}\n ref={popoverRef}\n aria-labelledby={headingId}\n >\n {menu && (\n <>\n <Flex container={{ pad: [1, 2] }}>\n <Text variant='h3' id={headingId}>\n {heading}\n </Text>\n </Flex>\n <Menu\n {...menu}\n items={menu.items}\n onItemClick={(itemId, e) => {\n if (\n menu?.mode !== 'multi-select' &&\n (e as MouseEvent<AcceptedMouseEventElement> & UIEvent<AcceptedMouseEventElement>)\n .detail > 0\n ) {\n onClose();\n }\n menu?.onItemClick?.(itemId, e);\n }}\n focusControlEl={buttonRef?.current ?? undefined}\n />\n </>\n )}\n </StyledPresetMenuPopover>\n );\n};\nexport default PresetMenuPopover;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"QueryOptionPopover.d.ts","sourceRoot":"","sources":["../../../src/components/ListToolbar/QueryOptionPopover.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EAGjB,SAAS,EAGV,MAAM,OAAO,CAAC;AAIf,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAIvD,OAAgB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAGnD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,UAAU,uBACR,SAAQ,UAAU,CAAC,YAAY,EAAE,QAAQ,CAAC,EACxC,IAAI,CAAC,sBAAsB,EAAE,UAAU,GAAG,UAAU,CAAC;IACvD,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;CACnC;AAMD,QAAA,MAAM,kBAAkB,EAAE,iBAAiB,CAAC,uBAAuB,GAAG,YAAY,CAiGjF,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"QueryOptionPopover.d.ts","sourceRoot":"","sources":["../../../src/components/ListToolbar/QueryOptionPopover.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAA+B,SAAS,EAAa,MAAM,OAAO,CAAC;AAW7F,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAIvD,OAAgB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAInD,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,UAAU,uBACR,SAAQ,UAAU,CAAC,YAAY,EAAE,QAAQ,CAAC,EACxC,IAAI,CAAC,sBAAsB,EAAE,UAAU,GAAG,UAAU,CAAC;IACvD,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;CACnC;AAgBD,QAAA,MAAM,kBAAkB,EAAE,iBAAiB,CAAC,uBAAuB,GAAG,YAAY,CAqDjF,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
@@ -1,60 +1,30 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { forwardRef, useEffect, useCallback } from 'react';
3
- import styled from 'styled-components';
4
- import { useConsolidatedRef, useI18n, useOuterEvent, useUID } from '../../hooks';
2
+ import { forwardRef, useEffect } from 'react';
3
+ import styled, { css } from 'styled-components';
4
+ import { useConsolidatedRef, useEscape, useFocusTrap, useI18n, useOuterEvent, useUID } from '../../hooks';
5
5
  import { getFocusables } from '../../utils';
6
6
  import Button from '../Button';
7
7
  import Flex from '../Flex';
8
8
  import Popover from '../Popover';
9
9
  import Text from '../Text';
10
- const StyledQueryListPopover = styled(Popover) `
11
- min-width: 40ch;
12
- `;
10
+ import { defaultThemeProp } from '../../theme';
11
+ const StyledQueryListPopover = styled(Popover)(({ theme: { base: { 'content-width': contentWidth } } }) => {
12
+ return css `
13
+ min-width: ${contentWidth.sm};
14
+ `;
15
+ });
16
+ StyledQueryListPopover.defaultProps = defaultThemeProp;
13
17
  const QueryOptionPopover = forwardRef(({ target, heading, children, onCancel, onSubmit }, ref) => {
14
18
  const t = useI18n();
15
19
  const headingId = useUID();
16
20
  const popoverRef = useConsolidatedRef(ref);
17
- const onKeydown = useCallback((e) => {
18
- if (e.repeat)
19
- return;
20
- if (e.key === 'Escape') {
21
- onCancel();
22
- target?.focus();
23
- return;
24
- }
25
- if (e.key === 'Tab') {
26
- const focusables = getFocusables(popoverRef);
27
- if (!focusables || focusables.length < 2)
28
- return;
29
- const firstFocusable = focusables[0];
30
- const lastFocusable = focusables[focusables.length - 1];
31
- if (!e.shiftKey &&
32
- (document.activeElement === popoverRef.current ||
33
- document.activeElement === lastFocusable)) {
34
- firstFocusable?.focus();
35
- e.preventDefault();
36
- }
37
- else if (e.shiftKey &&
38
- (document.activeElement === popoverRef.current ||
39
- document.activeElement === firstFocusable)) {
40
- lastFocusable?.focus();
41
- e.preventDefault();
42
- }
43
- }
44
- }, [onCancel, popoverRef, target]);
45
- useOuterEvent('mousedown', [popoverRef], () => {
46
- onCancel();
47
- });
48
- useEffect(() => {
49
- document.addEventListener('keydown', onKeydown);
50
- return () => {
51
- document.removeEventListener('keydown', onKeydown);
52
- };
53
- }, [onKeydown]);
21
+ useEscape(onCancel, popoverRef);
22
+ useFocusTrap(popoverRef);
23
+ useOuterEvent('mousedown', [popoverRef], onCancel);
54
24
  useEffect(() => {
55
25
  getFocusables(popoverRef)[0]?.focus();
56
26
  }, [popoverRef]);
57
- return (_jsx(StyledQueryListPopover, { target: target, ref: popoverRef, role: 'dialog', "aria-labelledby": headingId, arrow: true, onKeyDown: onKeydown, children: _jsxs(Flex, { container: { direction: 'column', gap: 2, pad: 2 }, children: [_jsx(Text, { variant: 'h3', id: headingId, children: heading }), children, _jsxs(Flex, { container: { justify: 'between' }, children: [_jsx(Button, { onClick: () => {
27
+ return (_jsx(StyledQueryListPopover, { target: target, ref: popoverRef, role: 'dialog', "aria-labelledby": headingId, arrow: true, children: _jsxs(Flex, { container: { direction: 'column', gap: 2, pad: 2 }, children: [_jsx(Text, { variant: 'h3', id: headingId, children: heading }), children, _jsxs(Flex, { container: { justify: 'between' }, children: [_jsx(Button, { onClick: () => {
58
28
  onCancel();
59
29
  target?.focus();
60
30
  }, children: t('cancel') }), _jsx(Button, { variant: 'primary', onClick: () => {
@@ -1 +1 @@
1
- {"version":3,"file":"QueryOptionPopover.js","sourceRoot":"","sources":["../../../src/components/ListToolbar/QueryOptionPopover.tsx"],"names":[],"mappings":";AAAA,OAAO,EAGL,UAAU,EAEV,SAAS,EACT,WAAW,EACZ,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAE,kBAAkB,EAAE,OAAO,EAAE,aAAa,EAA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AAI,EAAC,EAAE,EAAE,SAAS,YAC7B,OAAO,GACH,EACN,QAAQ,EACT,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,aACrC,KAAC,MAAM,IACL,OAAO,EAAE,GAAG,EAAE;gCACZ,QAAQ,EAAE,CAAC;gCACX,MAAM,EAAE,KAAK,EAAE,CAAC;4BAClB,CAAC,YAEA,CAAC,CAAC,QAAQ,CAAC,GACL,EACT,KAAC,MAAM,IACL,OAAO,EAAC,SAAS,EACjB,OAAO,EAAE,GAAG,EAAE;gCACZ,QAAQ,EAAE,CAAC;gCACX,MAAM,EAAE,KAAK,EAAE,CAAC;4BAClB,CAAC,YAEA,CAAC,CAAC,QAAQ,CAAC,GACL,IACJ,IACF,GACgB,CAC1B,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,kBAAkB,CAAC","sourcesContent":["import {\n FunctionComponent,\n PropsWithoutRef,\n forwardRef,\n ReactNode,\n useEffect,\n useCallback\n} from 'react';\nimport styled from 'styled-components';\n\nimport { useConsolidatedRef, useI18n, useOuterEvent, useUID } from '../../hooks';\nimport { ForwardProps, OmitStrict } from '../../types';\nimport { getFocusables } from '../../utils';\nimport Button from '../Button';\nimport Flex from '../Flex';\nimport Popover, { PopoverProps } from '../Popover';\nimport Text from '../Text';\n\nimport { QueryOptionDialogProps } from './ListToolbar.types';\n\ninterface ListToolbarPopoverProps\n extends OmitStrict<PopoverProps, 'target'>,\n Pick<QueryOptionDialogProps, 'onCancel' | 'onSubmit'> {\n heading: string;\n children: ReactNode;\n target?: HTMLButtonElement | null;\n}\n\nconst StyledQueryListPopover = styled(Popover)`\n min-width: 40ch;\n`;\n\nconst QueryOptionPopover: FunctionComponent<ListToolbarPopoverProps & ForwardProps> = forwardRef(\n (\n { target, heading, children, onCancel, onSubmit }: PropsWithoutRef<ListToolbarPopoverProps>,\n ref: ListToolbarPopoverProps['ref']\n ) => {\n const t = useI18n();\n const headingId = useUID();\n const popoverRef = useConsolidatedRef(ref);\n\n const onKeydown = useCallback(\n (e: KeyboardEvent) => {\n if (e.repeat) return;\n\n if (e.key === 'Escape') {\n onCancel();\n target?.focus();\n return;\n }\n\n if (e.key === 'Tab') {\n const focusables = getFocusables(popoverRef);\n if (!focusables || focusables.length < 2) return;\n const firstFocusable = focusables[0];\n const lastFocusable = focusables[focusables.length - 1];\n\n if (\n !e.shiftKey &&\n (document.activeElement === popoverRef.current ||\n document.activeElement === lastFocusable)\n ) {\n firstFocusable?.focus();\n e.preventDefault();\n } else if (\n e.shiftKey &&\n (document.activeElement === popoverRef.current ||\n document.activeElement === firstFocusable)\n ) {\n lastFocusable?.focus();\n e.preventDefault();\n }\n }\n },\n [onCancel, popoverRef, target]\n );\n\n useOuterEvent('mousedown', [popoverRef], () => {\n onCancel();\n });\n\n useEffect(() => {\n document.addEventListener('keydown', onKeydown);\n return () => {\n document.removeEventListener('keydown', onKeydown);\n };\n }, [onKeydown]);\n\n useEffect(() => {\n getFocusables(popoverRef)[0]?.focus();\n }, [popoverRef]);\n\n return (\n <StyledQueryListPopover\n target={target}\n ref={popoverRef}\n role='dialog'\n aria-labelledby={headingId}\n arrow\n onKeyDown={onKeydown}\n >\n <Flex container={{ direction: 'column', gap: 2, pad: 2 }}>\n <Text variant='h3' id={headingId}>\n {heading}\n </Text>\n {children}\n <Flex container={{ justify: 'between' }}>\n <Button\n onClick={() => {\n onCancel();\n target?.focus();\n }}\n >\n {t('cancel')}\n </Button>\n <Button\n variant='primary'\n onClick={() => {\n onSubmit();\n target?.focus();\n }}\n >\n {t('submit')}\n </Button>\n </Flex>\n </Flex>\n </StyledQueryListPopover>\n );\n }\n);\n\nexport default QueryOptionPopover;\n"]}
1
+ {"version":3,"file":"QueryOptionPopover.js","sourceRoot":"","sources":["../../../src/components/ListToolbar/QueryOptionPopover.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAsC,UAAU,EAAa,SAAS,EAAE,MAAM,OAAO,CAAC;AAC7F,OAAO,MAAM,E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,CAAC,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC;IAEjB,OAAO,CACL,KAAC,sBAAsB,IACrB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,UAAU,EACf,IAAI,EAAC,QAAQ,qBACI,SAAS,EAC1B,KAAK,kBAEL,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,GAAG,EAAE,CAAC,EAAE,GAAG,EAAE,CAAC,EAAE,aACtD,KAAC,IAAI,IAAC,OAAO,EAAC,IAAI,EAAC,EAAE,EAAE,SAAS,YAC7B,OAAO,GACH,EACN,QAAQ,EACT,MAAC,IAAI,IAAC,SAAS,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,aACrC,KAAC,MAAM,IACL,OAAO,EAAE,GAAG,EAAE;gCACZ,QAAQ,EAAE,CAAC;gCACX,MAAM,EAAE,KAAK,EAAE,CAAC;4BAClB,CAAC,YAEA,CAAC,CAAC,QAAQ,CAAC,GACL,EACT,KAAC,MAAM,IACL,OAAO,EAAC,SAAS,EACjB,OAAO,EAAE,GAAG,EAAE;gCACZ,QAAQ,EAAE,CAAC;gCACX,MAAM,EAAE,KAAK,EAAE,CAAC;4BAClB,CAAC,YAEA,CAAC,CAAC,QAAQ,CAAC,GACL,IACJ,IACF,GACgB,CAC1B,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,kBAAkB,CAAC","sourcesContent":["import { FunctionComponent, PropsWithoutRef, forwardRef, ReactNode, useEffect } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport {\n useConsolidatedRef,\n useEscape,\n useFocusTrap,\n useI18n,\n useOuterEvent,\n useUID\n} from '../../hooks';\nimport { ForwardProps, OmitStrict } from '../../types';\nimport { getFocusables } from '../../utils';\nimport Button from '../Button';\nimport Flex from '../Flex';\nimport Popover, { PopoverProps } from '../Popover';\nimport Text from '../Text';\nimport { defaultThemeProp } from '../../theme';\n\nimport { QueryOptionDialogProps } from './ListToolbar.types';\n\ninterface ListToolbarPopoverProps\n extends OmitStrict<PopoverProps, 'target'>,\n Pick<QueryOptionDialogProps, 'onCancel' | 'onSubmit'> {\n heading: string;\n children: ReactNode;\n target?: HTMLButtonElement | null;\n}\n\nconst StyledQueryListPopover = styled(Popover)(\n ({\n theme: {\n base: { 'content-width': contentWidth }\n }\n }) => {\n return css`\n min-width: ${contentWidth.sm};\n `;\n }\n);\n\nStyledQueryListPopover.defaultProps = defaultThemeProp;\n\nconst QueryOptionPopover: FunctionComponent<ListToolbarPopoverProps & ForwardProps> = forwardRef(\n (\n { target, heading, children, onCancel, onSubmit }: PropsWithoutRef<ListToolbarPopoverProps>,\n ref: ListToolbarPopoverProps['ref']\n ) => {\n const t = useI18n();\n const headingId = useUID();\n const popoverRef = useConsolidatedRef(ref);\n\n useEscape(onCancel, popoverRef);\n useFocusTrap(popoverRef);\n useOuterEvent('mousedown', [popoverRef], onCancel);\n\n useEffect(() => {\n getFocusables(popoverRef)[0]?.focus();\n }, [popoverRef]);\n\n return (\n <StyledQueryListPopover\n target={target}\n ref={popoverRef}\n role='dialog'\n aria-labelledby={headingId}\n arrow\n >\n <Flex container={{ direction: 'column', gap: 2, pad: 2 }}>\n <Text variant='h3' id={headingId}>\n {heading}\n </Text>\n {children}\n <Flex container={{ justify: 'between' }}>\n <Button\n onClick={() => {\n onCancel();\n target?.focus();\n }}\n >\n {t('cancel')}\n </Button>\n <Button\n variant='primary'\n onClick={() => {\n onSubmit();\n target?.focus();\n }}\n >\n {t('submit')}\n </Button>\n </Flex>\n </Flex>\n </StyledQueryListPopover>\n );\n }\n);\n\nexport default QueryOptionPopover;\n"]}
@@ -5,6 +5,8 @@ import BaseLocationProps from './Location.types';
5
5
  import { LatLng } from './types';
6
6
  import { LocationViewProps } from './LocationView';
7
7
  export interface LocationInputProps extends LocationViewProps, BaseLocationProps, BaseProps, FormControlProps {
8
+ /** Button when clicked will show additional information for the location input */
9
+ additionalInfo?: FormControlProps['additionalInfo'];
8
10
  /**
9
11
  * Get user current location on component first render.
10
12
  * @default false
@@ -31,7 +33,7 @@ export interface LocationInputProps extends LocationViewProps, BaseLocationProps
31
33
  location?: LatLng | string;
32
34
  /** Callback fired when user chooses location from the dropdown of suggestions or submits input value. */
33
35
  onSelect?: (value: {
34
- name: string;
36
+ name?: string;
35
37
  address?: string;
36
38
  latitude?: number;
37
39
  longitude?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"LocationInput.d.ts","sourceRoot":"","sources":["../../../src/components/Location/LocationInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,EAAE,EAQH,MAAM,OAAO,CAAC;AAQf,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAOtD,OAAO,iBAAiB,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAqB,EAAE,iBAAiB,EAAsB,MAAM,gBAAgB,CAAC;AAErF,MAAM,WAAW,kBACf,SAAQ,iBAAiB,EACvB,iBAAiB,EACjB,SAAS,EACT,gBAAgB;IAClB;;;OAGG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,uCAAuC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC;;;OAGG;IACH,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,kDAAkD;IAClD,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,yGAAyG;IACzG,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE;QACjB,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,KAAK,IAAI,CAAC;CACZ;AASD,QAAA,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,GAAG,YAAY,CAqJxD,CAAC;AAEF,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"LocationInput.d.ts","sourceRoot":"","sources":["../../../src/components/Location/LocationInput.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,EAAE,EAQH,MAAM,OAAO,CAAC;AAQf,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAOtD,OAAO,iBAAiB,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAqB,EAAE,iBAAiB,EAAsB,MAAM,gBAAgB,CAAC;AAErF,MAAM,WAAW,kBACf,SAAQ,iBAAiB,EACvB,iBAAiB,EACjB,SAAS,EACT,gBAAgB;IAClB,kFAAkF;IAClF,cAAc,CAAC,EAAE,gBAAgB,CAAC,gBAAgB,CAAC,CAAC;IACpD;;;OAGG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;IACnC,uCAAuC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC;;;OAGG;IACH,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,kDAAkD;IAClD,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,yGAAyG;IACzG,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE;QACjB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,KAAK,IAAI,CAAC;CACZ;AASD,QAAA,MAAM,aAAa,EAAE,EAAE,CAAC,kBAAkB,GAAG,YAAY,CAwJxD,CAAC;AAEF,eAAe,aAAa,CAAC"}
@@ -18,7 +18,7 @@ const StyledLocationMap = styled.div `
18
18
  }
19
19
  `;
20
20
  const LocationInput = forwardRef((props, ref) => {
21
- const { label, labelHidden, id = createUID(), location = '', value = '', info, status, required, readOnly, disabled, onSelect, onError, onChange, bias, showMap, defaultToCurrentLocation, centerMapOnChange, height, zoomLevel, onClick, onBlur, ...restProps } = props;
21
+ const { label, labelHidden, id = createUID(), location = '', value = '', info, status, required, readOnly, disabled, additionalInfo, onSelect, onError, onChange, bias, showMap, defaultToCurrentLocation, centerMapOnChange, height, zoomLevel, onClick, onBlur, ...restProps } = props;
22
22
  const { name, ...providerOpts } = useContext(MapsContext);
23
23
  const t = useI18n();
24
24
  const [placePredictionMenu, setPlacePredictionMenu] = useState({ items: [] });
@@ -91,7 +91,7 @@ const LocationInput = forwardRef((props, ref) => {
91
91
  height,
92
92
  zoomLevel
93
93
  } }) }))] }));
94
- return label ? (_jsx(FormField, { ...{ label, labelHidden, id, info, status, ref, required, disabled }, children: Comp })) : (Comp);
94
+ return label ? (_jsx(FormField, { ...{ label, labelHidden, id, info, status, ref, required, disabled, additionalInfo }, children: Comp })) : (Comp);
95
95
  });
96
96
  export default LocationInput;
97
97
  //# sourceMappingURL=LocationInput.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LocationInput.js","sourceRoot":"","sources":["../../../src/components/Location/LocationInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAGL,UAAU,EAGV,WAAW,EACX,UAAU,EACV,SAAS,EACT,QAAQ,EACT,MAAM,OAAO,CAAC;AACf,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,QAAQ,MAAM,aAAa,CAAC;AAEnC,OA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B,MAAM,EAAE,GAAG,EAAE;oBACX,cAAc,CAAC,EAAE,CAAC,CAAC;oBACnB,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC;gBAClB,CAAC,EACD,KAAK,EAAE,KAAK,KACR;oBACF,QAAQ;oBACR,QAAQ;oBACR,QAAQ;oBACR,MAAM;oBACN,GAAG,SAAS;iBACb,GACD,EACD,OAAO,IAAI,CACV,KAAC,iBAAiB,cAChB,KAAC,YAAY,OACP;wBACF,QAAQ;wBACR,OAAO,EAAE,UAAU;wBACnB,OAAO;wBACP,IAAI;wBACJ,QAAQ;wBACR,QAAQ;wBACR,iBAAiB;wBACjB,MAAM;wBACN,SAAS;qBACV,GACD,GACgB,CACrB,IACA,CACJ,CAAC;IAEF,OAAO,KAAK,CAAC,CAAC,CAAC,CACb,KAAC,SAAS,OAAK,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAC7E,IAAI,GACK,CACb,CAAC,CAAC,CAAC,CACF,IAAI,CACL,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import {\n ChangeEvent,\n FC,\n forwardRef,\n PropsWithoutRef,\n Ref,\n useCallback,\n useContext,\n useEffect,\n useState\n} from 'react';\nimport styled from 'styled-components';\n\nimport ComboBox from '../ComboBox';\nimport { MenuProps } from '../Menu';\nimport { useI18n } from '../../hooks';\nimport { createUID } from '../../utils/utils';\nimport FormField from '../FormField';\nimport { FormControlProps } from '../FormControl';\nimport { BaseProps, ForwardProps } from '../../types';\nimport Flex from '../Flex';\n\nimport PoweredByGoogleImage from './PoweredByGoogleImage';\nimport CurrentLocationButton from './CurrentLocationButton';\nimport MapsContext from './MapsContext';\nimport { getPlaceById, getPlacePredictions, loadMapsAPI } from './utils';\nimport BaseLocationProps from './Location.types';\nimport { LatLng } from './types';\nimport LocationView, { LocationViewProps, StyledLocationView } from './LocationView';\n\nexport interface LocationInputProps\n extends LocationViewProps,\n BaseLocationProps,\n BaseProps,\n FormControlProps {\n /**\n * Get user current location on component first render.\n * @default false\n */\n defaultToCurrentLocation?: boolean;\n /** The value of the location field. */\n value?: string;\n /**\n * Callback fired on every change of the location input.\n * The argument passed back is the component's value prop.\n */\n onChange?: (value: string) => void;\n /**\n * Callback fired when the control's input loses focus.\n * The argument passed back is the component's value prop.\n */\n onBlur?: (value: string) => void;\n /**\n * Set to true renders the map view below input.\n * @default false\n */\n showMap?: boolean;\n /** Location coordinates used for the map view. */\n location?: LatLng | string;\n /** Callback fired when user chooses location from the dropdown of suggestions or submits input value. */\n onSelect?: (value: {\n name: string;\n address?: string;\n latitude?: number;\n longitude?: number;\n }) => void;\n}\n\nconst StyledLocationMap = styled.div`\n ${StyledLocationView} {\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n }\n`;\n\nconst LocationInput: FC<LocationInputProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<LocationInputProps>, ref: Ref<HTMLInputElement>) => {\n const {\n label,\n labelHidden,\n id = createUID(),\n location = '',\n value = '',\n info,\n status,\n required,\n readOnly,\n disabled,\n onSelect,\n onError,\n onChange,\n bias,\n showMap,\n defaultToCurrentLocation,\n centerMapOnChange,\n height,\n zoomLevel,\n onClick,\n onBlur,\n ...restProps\n } = props;\n const { name, ...providerOpts } = useContext(MapsContext);\n const t = useI18n();\n const [placePredictionMenu, setPlacePredictionMenu] = useState<MenuProps>({ items: [] });\n const [filterValue, setFilterValue] = useState('');\n\n useEffect(() => {\n const mapApiPromise = loadMapsAPI(name, providerOpts).catch(error => onError?.(error));\n\n if (filterValue) {\n mapApiPromise\n .then(() => getPlacePredictions(filterValue, bias))\n .then(({ placePredictions, token }) => {\n setPlacePredictionMenu({\n items: placePredictions.map(item => ({\n id: item.place_id,\n primary: item.structured_formatting.main_text,\n secondary: [item.structured_formatting.secondary_text]\n })),\n emptyText: t('location_not_found_text'),\n onItemClick: itemId =>\n getPlaceById(itemId, token).then(arg => {\n setFilterValue('');\n onSelect?.(arg);\n })\n });\n })\n .catch(error => {\n setPlacePredictionMenu({ items: [] });\n onError?.(error);\n });\n } else {\n setPlacePredictionMenu({ items: [] });\n }\n }, [filterValue, bias, onError, onSelect]);\n\n const onInputChange = useCallback(\n (e: ChangeEvent<HTMLInputElement>) => {\n setFilterValue(e.target.value);\n onChange?.(e.target.value);\n },\n [onChange]\n );\n\n const onMapClick = useCallback(\n (placeInfo: { latitude: number; longitude: number; name: string; address?: string }) => {\n onSelect?.(placeInfo);\n onClick?.(placeInfo);\n },\n [onSelect, onClick]\n );\n\n const Comp = (\n <>\n <ComboBox\n placeholder={t('location_input_placeholder')}\n menu={\n filterValue\n ? {\n ...placePredictionMenu,\n items: placePredictionMenu.items.concat({\n id: createUID(),\n primary: t('use_input_value', [filterValue])\n }),\n mode: 'action',\n emptyText: t('location_not_found_text'),\n footer: !showMap && (\n <Flex container={{ justify: 'end' }}>\n <PoweredByGoogleImage />\n </Flex>\n )\n }\n : undefined\n }\n actions={\n !disabled &&\n !readOnly && (\n <CurrentLocationButton\n {...{ defaultToCurrentLocation, onError, onChange: onSelect }}\n />\n )\n }\n onChange={onInputChange}\n onBlur={() => {\n setFilterValue('');\n onBlur?.(value);\n }}\n value={value}\n {...{\n required,\n disabled,\n readOnly,\n status,\n ...restProps\n }}\n />\n {showMap && (\n <StyledLocationMap>\n <LocationView\n {...{\n location,\n onClick: onMapClick,\n onError,\n bias,\n disabled,\n readOnly,\n centerMapOnChange,\n height,\n zoomLevel\n }}\n />\n </StyledLocationMap>\n )}\n </>\n );\n\n return label ? (\n <FormField {...{ label, labelHidden, id, info, status, ref, required, disabled }}>\n {Comp}\n </FormField>\n ) : (\n Comp\n );\n }\n);\n\nexport default LocationInput;\n"]}
1
+ {"version":3,"file":"LocationInput.js","sourceRoot":"","sources":["../../../src/components/Location/LocationInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAGL,UAAU,EAGV,WAAW,EACX,UAAU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AAC,QAAQ,IAAI,CACX,KAAC,qBAAqB,OAChB,EAAE,wBAAwB,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAC7D,CACH,EAEH,QAAQ,EAAE,aAAa,EACvB,MAAM,EAAE,GAAG,EAAE;oBACX,cAAc,CAAC,EAAE,CAAC,CAAC;oBACnB,MAAM,EAAE,CAAC,KAAK,CAAC,CAAC;gBAClB,CAAC,EACD,KAAK,EAAE,KAAK,KACR;oBACF,QAAQ;oBACR,QAAQ;oBACR,QAAQ;oBACR,MAAM;oBACN,GAAG,SAAS;iBACb,GACD,EACD,OAAO,IAAI,CACV,KAAC,iBAAiB,cAChB,KAAC,YAAY,OACP;wBACF,QAAQ;wBACR,OAAO,EAAE,UAAU;wBACnB,OAAO;wBACP,IAAI;wBACJ,QAAQ;wBACR,QAAQ;wBACR,iBAAiB;wBACjB,MAAM;wBACN,SAAS;qBACV,GACD,GACgB,CACrB,IACA,CACJ,CAAC;IAEF,OAAO,KAAK,CAAC,CAAC,CAAC,CACb,KAAC,SAAS,OACJ,EAAE,KAAK,EAAE,WAAW,EAAE,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,YAEpF,IAAI,GACK,CACb,CAAC,CAAC,CAAC,CACF,IAAI,CACL,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,aAAa,CAAC","sourcesContent":["import {\n ChangeEvent,\n FC,\n forwardRef,\n PropsWithoutRef,\n Ref,\n useCallback,\n useContext,\n useEffect,\n useState\n} from 'react';\nimport styled from 'styled-components';\n\nimport ComboBox from '../ComboBox';\nimport { MenuProps } from '../Menu';\nimport { useI18n } from '../../hooks';\nimport { createUID } from '../../utils/utils';\nimport FormField from '../FormField';\nimport { FormControlProps } from '../FormControl';\nimport { BaseProps, ForwardProps } from '../../types';\nimport Flex from '../Flex';\n\nimport PoweredByGoogleImage from './PoweredByGoogleImage';\nimport CurrentLocationButton from './CurrentLocationButton';\nimport MapsContext from './MapsContext';\nimport { getPlaceById, getPlacePredictions, loadMapsAPI } from './utils';\nimport BaseLocationProps from './Location.types';\nimport { LatLng } from './types';\nimport LocationView, { LocationViewProps, StyledLocationView } from './LocationView';\n\nexport interface LocationInputProps\n extends LocationViewProps,\n BaseLocationProps,\n BaseProps,\n FormControlProps {\n /** Button when clicked will show additional information for the location input */\n additionalInfo?: FormControlProps['additionalInfo'];\n /**\n * Get user current location on component first render.\n * @default false\n */\n defaultToCurrentLocation?: boolean;\n /** The value of the location field. */\n value?: string;\n /**\n * Callback fired on every change of the location input.\n * The argument passed back is the component's value prop.\n */\n onChange?: (value: string) => void;\n /**\n * Callback fired when the control's input loses focus.\n * The argument passed back is the component's value prop.\n */\n onBlur?: (value: string) => void;\n /**\n * Set to true renders the map view below input.\n * @default false\n */\n showMap?: boolean;\n /** Location coordinates used for the map view. */\n location?: LatLng | string;\n /** Callback fired when user chooses location from the dropdown of suggestions or submits input value. */\n onSelect?: (value: {\n name?: string;\n address?: string;\n latitude?: number;\n longitude?: number;\n }) => void;\n}\n\nconst StyledLocationMap = styled.div`\n ${StyledLocationView} {\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n }\n`;\n\nconst LocationInput: FC<LocationInputProps & ForwardProps> = forwardRef(\n (props: PropsWithoutRef<LocationInputProps>, ref: Ref<HTMLInputElement>) => {\n const {\n label,\n labelHidden,\n id = createUID(),\n location = '',\n value = '',\n info,\n status,\n required,\n readOnly,\n disabled,\n additionalInfo,\n onSelect,\n onError,\n onChange,\n bias,\n showMap,\n defaultToCurrentLocation,\n centerMapOnChange,\n height,\n zoomLevel,\n onClick,\n onBlur,\n ...restProps\n } = props;\n const { name, ...providerOpts } = useContext(MapsContext);\n const t = useI18n();\n const [placePredictionMenu, setPlacePredictionMenu] = useState<MenuProps>({ items: [] });\n const [filterValue, setFilterValue] = useState('');\n\n useEffect(() => {\n const mapApiPromise = loadMapsAPI(name, providerOpts).catch(error => onError?.(error));\n\n if (filterValue) {\n mapApiPromise\n .then(() => getPlacePredictions(filterValue, bias))\n .then(({ placePredictions, token }) => {\n setPlacePredictionMenu({\n items: placePredictions.map(item => ({\n id: item.place_id,\n primary: item.structured_formatting.main_text,\n secondary: [item.structured_formatting.secondary_text]\n })),\n emptyText: t('location_not_found_text'),\n onItemClick: itemId =>\n getPlaceById(itemId, token).then(arg => {\n setFilterValue('');\n onSelect?.(arg);\n })\n });\n })\n .catch(error => {\n setPlacePredictionMenu({ items: [] });\n onError?.(error);\n });\n } else {\n setPlacePredictionMenu({ items: [] });\n }\n }, [filterValue, bias, onError, onSelect]);\n\n const onInputChange = useCallback(\n (e: ChangeEvent<HTMLInputElement>) => {\n setFilterValue(e.target.value);\n onChange?.(e.target.value);\n },\n [onChange]\n );\n\n const onMapClick = useCallback(\n (placeInfo: { latitude: number; longitude: number; name?: string; address?: string }) => {\n onSelect?.(placeInfo);\n onClick?.(placeInfo);\n },\n [onSelect, onClick]\n );\n\n const Comp = (\n <>\n <ComboBox\n placeholder={t('location_input_placeholder')}\n menu={\n filterValue\n ? {\n ...placePredictionMenu,\n items: placePredictionMenu.items.concat({\n id: createUID(),\n primary: t('use_input_value', [filterValue])\n }),\n mode: 'action',\n emptyText: t('location_not_found_text'),\n footer: !showMap && (\n <Flex container={{ justify: 'end' }}>\n <PoweredByGoogleImage />\n </Flex>\n )\n }\n : undefined\n }\n actions={\n !disabled &&\n !readOnly && (\n <CurrentLocationButton\n {...{ defaultToCurrentLocation, onError, onChange: onSelect }}\n />\n )\n }\n onChange={onInputChange}\n onBlur={() => {\n setFilterValue('');\n onBlur?.(value);\n }}\n value={value}\n {...{\n required,\n disabled,\n readOnly,\n status,\n ...restProps\n }}\n />\n {showMap && (\n <StyledLocationMap>\n <LocationView\n {...{\n location,\n onClick: onMapClick,\n onError,\n bias,\n disabled,\n readOnly,\n centerMapOnChange,\n height,\n zoomLevel\n }}\n />\n </StyledLocationMap>\n )}\n </>\n );\n\n return label ? (\n <FormField\n {...{ label, labelHidden, id, info, status, ref, required, disabled, additionalInfo }}\n >\n {Comp}\n </FormField>\n ) : (\n Comp\n );\n }\n);\n\nexport default LocationInput;\n"]}
@@ -31,7 +31,7 @@ export interface LocationViewProps extends BaseLocationProps, BaseProps {
31
31
  onClick?: (coords: {
32
32
  latitude: number;
33
33
  longitude: number;
34
- name: string;
34
+ name?: string;
35
35
  address?: string;
36
36
  }) => void;
37
37
  }
@@ -1 +1 @@
1
- {"version":3,"file":"LocationView.d.ts","sourceRoot":"","sources":["../../../src/components/Location/LocationView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAgD,MAAM,OAAO,CAAC;AAGzE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAOxC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEjC,OAAO,iBAAiB,MAAM,kBAAkB,CAAC;AAGjD,eAAO,MAAM,mBAAmB,yGAK/B,CAAC;AAIF,eAAO,MAAM,kBAAkB;;SAW7B,CAAC;AAkCH,MAAM,WAAW,iBAAkB,SAAQ,iBAAiB,EAAE,SAAS;IACrE;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACvC;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+IAA+I;IAC/I,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE;QACjB,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;QAClB,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,KAAK,IAAI,CAAC;CACZ;AAQD,QAAA,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CA4GvC,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"LocationView.d.ts","sourceRoot":"","sources":["../../../src/components/Location/LocationView.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAgD,MAAM,OAAO,CAAC;AAGzE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAMxC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEjC,OAAO,iBAAiB,MAAM,kBAAkB,CAAC;AAGjD,eAAO,MAAM,mBAAmB,yGAK/B,CAAC;AAIF,eAAO,MAAM,kBAAkB;;SAW7B,CAAC;AAoCH,MAAM,WAAW,iBAAkB,SAAQ,iBAAiB,EAAE,SAAS;IACrE;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;IACvC;;;OAGG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+IAA+I;IAC/I,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE;QACjB,QAAQ,EAAE,MAAM,CAAC;QACjB,SAAS,EAAE,MAAM,CAAC;QAClB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,KAAK,IAAI,CAAC;CACZ;AAQD,QAAA,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAiHvC,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -4,9 +4,8 @@ import styled, { css } from 'styled-components';
4
4
  import { defaultThemeProp } from '../../theme';
5
5
  import { hasProp } from '../../utils';
6
6
  import Progress from '../Progress';
7
- import Flex from '../Flex';
8
7
  import { Status } from '../Badges';
9
- import { loadMapsAPI, getCoords, toGoogleLatLng, getPlaceById } from './utils';
8
+ import { loadMapsAPI, getCoords, toGoogleLatLng, getPlaceById, isLatLngObject } from './utils';
10
9
  import MapsContext from './MapsContext';
11
10
  export const StyledLocationError = styled.div `
12
11
  position: absolute;
@@ -41,6 +40,7 @@ const StyledMap = styled.div(({ height, disabled, status, eMessage, theme: { bas
41
40
  `}
42
41
  `;
43
42
  });
43
+ StyledMap.defaultProps = defaultThemeProp;
44
44
  var LoadStatus;
45
45
  (function (LoadStatus) {
46
46
  LoadStatus["Init"] = "init";
@@ -69,13 +69,19 @@ const LocationView = (props) => {
69
69
  });
70
70
  marker.current?.setVisible(false);
71
71
  if (onClick)
72
- map.current.addListener('click', event => {
73
- if (hasProp(event, 'placeId')) {
74
- getPlaceById(event.placeId).then(placeInfo => onClick?.({
75
- ...placeInfo,
76
- latitude: event.latLng.lat(),
77
- longitude: event.latLng.lng()
78
- }));
72
+ map.current.addListener('click', (event) => {
73
+ if (event &&
74
+ typeof event === 'object' &&
75
+ hasProp(event, 'placeId') &&
76
+ typeof event.placeId === 'string') {
77
+ getPlaceById(event.placeId).then(placeInfo => {
78
+ if (hasProp(event, 'latLng') && isLatLngObject(event.latLng))
79
+ onClick?.({
80
+ ...placeInfo,
81
+ latitude: event.latLng.lat(),
82
+ longitude: event.latLng.lng()
83
+ });
84
+ });
79
85
  }
80
86
  });
81
87
  }
@@ -124,7 +130,7 @@ const LocationView = (props) => {
124
130
  onError?.(error);
125
131
  });
126
132
  }, [location, status, zoomLevel, disabled, centerMapOnChange, onError]);
127
- return (_jsxs(StyledLocationView, { height: height, children: [_jsx(Flex, { as: StyledMap, ref: mapElemRef, height: height, disabled: disabled, status: status, eMessage: eMessage, ...restProps }), status === LoadStatus.Init && _jsx(Progress, { placement: 'local' }), status === LoadStatus.Error && eMessage && (_jsx(Status, { as: StyledLocationError, "aria-label": eMessage, variant: 'info', children: eMessage }))] }));
133
+ return (_jsxs(StyledLocationView, { height: height, children: [_jsx(StyledMap, { ref: mapElemRef, height: height, disabled: disabled, status: status, eMessage: eMessage, ...restProps }), status === LoadStatus.Init && _jsx(Progress, { placement: 'local' }), status === LoadStatus.Error && eMessage && (_jsx(Status, { as: StyledLocationError, "aria-label": eMessage, variant: 'info', children: eMessage }))] }));
128
134
  };
129
135
  export default LocationView;
130
136
  //# sourceMappingURL=LocationView.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LocationView.js","sourceRoot":"","sources":["../../../src/components/Location/LocationView.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAO,MAAM,OAAO,CAAC;AACzE,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,QAAQ,MAAM,aAAa,CAAC;AACnC,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAGnC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE/E,OAAO,WAAW,MAAM,eAAe,CAAC;AAExC,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAAA;;;;;CAK5C,CAAC;AAEF,mBAAmB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEpD,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAAsB,KAAK,CAAC,EAAE;IACxE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IAEhC,OAAO,GAAG,CAAA;cACE,MAAM;;;qBAGC,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC;;;GAG7C,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,kBAAkB,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAEnD,MAAM,SAAS,GAAG,MAAM,CAAC,GAAG,CAM1B,CAAC,EACC,MAAM,EACN,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,KA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,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,iBAAiB,EAAE,OAAO,CAAC,CAAC,CAAC;IAExE,OAAO,CACL,MAAC,kBAAkB,IAAC,MAAM,EAAE,MAAM,aAChC,KAAC,IAAI,IACH,EAAE,EAAE,SAAS,EACb,GAAG,EAAE,UAA0B,EAC/B,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,KACd,SAAS,GACb,EACD,MAAM,KAAK,UAAU,CAAC,IAAI,IAAI,KAAC,QAAQ,IAAC,SAAS,EAAC,OAAO,GAAG,EAC5D,MAAM,KAAK,UAAU,CAAC,KAAK,IAAI,QAAQ,IAAI,CAC1C,KAAC,MAAM,IAAC,EAAE,EAAE,mBAAmB,gBAAc,QAAQ,EAAE,OAAO,EAAC,MAAM,YAClE,QAAQ,GACF,CACV,IACkB,CACtB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import { FC, useContext, useRef, useState, useEffect, Ref } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { BaseProps } from '../../types';\nimport { defaultThemeProp } from '../../theme';\nimport { hasProp } from '../../utils';\nimport Progress from '../Progress';\nimport Flex from '../Flex';\nimport { Status } from '../Badges';\n\nimport { LatLng } from './types';\nimport { loadMapsAPI, getCoords, toGoogleLatLng, getPlaceById } from './utils';\nimport BaseLocationProps from './Location.types';\nimport MapsContext from './MapsContext';\n\nexport const StyledLocationError = styled.div`\n position: absolute;\n top: 40%;\n left: 50%;\n transform: translate(-50%, -50%);\n`;\n\nStyledLocationError.defaultProps = defaultThemeProp;\n\nexport const StyledLocationView = styled.div<{ height?: string }>(props => {\n const { height, theme } = props;\n\n return css`\n height: ${height};\n position: relative;\n flex: auto;\n border-radius: ${theme.base['border-radius']};\n mask-image: radial-gradient(white, black);\n -webkit-mask-image: radial-gradient(white, black);\n `;\n});\n\nStyledLocationView.defaultProps = defaultThemeProp;\n\nconst StyledMap = styled.div<{\n height?: string;\n status: string;\n disabled: boolean;\n eMessage: string;\n}>(\n ({\n height,\n disabled,\n status,\n eMessage,\n theme: {\n base: { 'disabled-opacity': disabledOpacity }\n }\n }) => {\n return css`\n height: ${height};\n ${disabled &&\n css`\n opacity: ${disabledOpacity};\n `}\n ${status === 'error' &&\n eMessage &&\n css`\n opacity: ${disabledOpacity};\n `}\n `;\n }\n);\n\nexport interface LocationViewProps extends BaseLocationProps, BaseProps {\n /**\n * Location string as either coordinates, name of a place, or 'current' for the current location.\n * @default 'current'\n */\n location?: LatLng | string | 'current';\n /**\n * Set to true to always center the map when the selected location changes. Toggling this from false to true will re-center map on the last pinned location.\n * @default false\n */\n centerMapOnChange?: boolean;\n /**\n * Height of the map container.\n * @default '25rem'\n */\n height?: string;\n /**\n * How much the map should zoom.\n * @default 13\n */\n zoomLevel?: number;\n /** Callback fired when user clicks on a location on the map. This function will be passed the coordinates of the location that was clicked. */\n onClick?: (coords: {\n latitude: number;\n longitude: number;\n name: string;\n address?: string;\n }) => void;\n}\n\nenum LoadStatus {\n Init = 'init',\n Ready = 'ready',\n Error = 'error'\n}\n\nconst LocationView: FC<LocationViewProps> = (props: LocationViewProps) => {\n const {\n location = 'current',\n zoomLevel = 13,\n height = '25rem',\n centerMapOnChange = false,\n onClick,\n onError,\n disabled = false,\n ...restProps\n } = props;\n const { name, ...providerOpts } = useContext(MapsContext);\n const [status, setStatus] = useState<LoadStatus>(LoadStatus.Init);\n const [eMessage, setEMessage] = useState('');\n const mapElemRef = useRef<HTMLDivElement>();\n const map = useRef<google.maps.Map<HTMLDivElement>>();\n const marker = useRef<google.maps.Marker>();\n\n function initialize(): void {\n if (mapElemRef.current) {\n const position = toGoogleLatLng({ latitude: 0, longitude: 0 });\n map.current = new google.maps.Map(mapElemRef.current!, {\n center: position,\n zoom: 2,\n draggable: !disabled\n });\n marker.current = new google.maps.Marker({\n map: map.current,\n position\n });\n marker.current?.setVisible(false);\n if (onClick)\n map.current.addListener<'click'>('click', event => {\n if (hasProp(event, 'placeId')) {\n getPlaceById(event.placeId).then(placeInfo =>\n onClick?.({\n ...placeInfo,\n latitude: event.latLng.lat(),\n longitude: event.latLng.lng()\n })\n );\n }\n });\n }\n }\n\n useEffect(() => {\n let unMounted = false;\n loadMapsAPI(name, providerOpts)\n .then(() => {\n if (!unMounted) {\n initialize();\n setStatus(LoadStatus.Ready);\n }\n })\n .catch((error: Error) => {\n setStatus(LoadStatus.Error);\n setEMessage(error.message);\n onError?.(error);\n });\n\n return () => {\n unMounted = true;\n if (map.current) google.maps.event.clearInstanceListeners(map.current);\n };\n }, []);\n\n useEffect(() => {\n getCoords(location!)\n .then(coords => {\n if (map.current) {\n map.current.setOptions({\n zoom: zoomLevel,\n draggable: !disabled\n });\n marker.current?.setPosition(toGoogleLatLng(coords));\n marker.current?.setVisible(true);\n if (centerMapOnChange) map.current.setCenter(toGoogleLatLng(coords));\n if (status !== LoadStatus.Ready) setStatus(LoadStatus.Ready);\n }\n })\n .catch((error: Error) => {\n if (status !== LoadStatus.Error) setStatus(LoadStatus.Error);\n marker.current?.setVisible(false);\n setEMessage(error.message);\n onError?.(error);\n });\n }, [location, status, zoomLevel, disabled, centerMapOnChange, onError]);\n\n return (\n <StyledLocationView height={height}>\n <Flex\n as={StyledMap}\n ref={mapElemRef as Ref<Element>}\n height={height}\n disabled={disabled}\n status={status}\n eMessage={eMessage}\n {...restProps}\n />\n {status === LoadStatus.Init && <Progress placement='local' />}\n {status === LoadStatus.Error && eMessage && (\n <Status as={StyledLocationError} aria-label={eMessage} variant='info'>\n {eMessage}\n </Status>\n )}\n </StyledLocationView>\n );\n};\n\nexport default LocationView;\n"]}
1
+ {"version":3,"file":"LocationView.js","sourceRoot":"","sources":["../../../src/components/Location/LocationView.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAM,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAO,MAAM,OAAO,CAAC;AACzE,OAAO,MAAM,EAAE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CAAC;IAExE,OAAO,CACL,MAAC,kBAAkB,IAAC,MAAM,EAAE,MAAM,aAChC,KAAC,SAAS,IACR,GAAG,EAAE,UAAiC,EACtC,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,KACd,SAAS,GACb,EACD,MAAM,KAAK,UAAU,CAAC,IAAI,IAAI,KAAC,QAAQ,IAAC,SAAS,EAAC,OAAO,GAAG,EAC5D,MAAM,KAAK,UAAU,CAAC,KAAK,IAAI,QAAQ,IAAI,CAC1C,KAAC,MAAM,IAAC,EAAE,EAAE,mBAAmB,gBAAc,QAAQ,EAAE,OAAO,EAAC,MAAM,YAClE,QAAQ,GACF,CACV,IACkB,CACtB,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import { FC, useContext, useRef, useState, useEffect, Ref } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { BaseProps } from '../../types';\nimport { defaultThemeProp } from '../../theme';\nimport { hasProp } from '../../utils';\nimport Progress from '../Progress';\nimport { Status } from '../Badges';\n\nimport { LatLng } from './types';\nimport { loadMapsAPI, getCoords, toGoogleLatLng, getPlaceById, isLatLngObject } from './utils';\nimport BaseLocationProps from './Location.types';\nimport MapsContext from './MapsContext';\n\nexport const StyledLocationError = styled.div`\n position: absolute;\n top: 40%;\n left: 50%;\n transform: translate(-50%, -50%);\n`;\n\nStyledLocationError.defaultProps = defaultThemeProp;\n\nexport const StyledLocationView = styled.div<{ height?: string }>(props => {\n const { height, theme } = props;\n\n return css`\n height: ${height};\n position: relative;\n flex: auto;\n border-radius: ${theme.base['border-radius']};\n mask-image: radial-gradient(white, black);\n -webkit-mask-image: radial-gradient(white, black);\n `;\n});\n\nStyledLocationView.defaultProps = defaultThemeProp;\n\nconst StyledMap = styled.div<{\n height?: string;\n status: string;\n disabled: boolean;\n eMessage: string;\n}>(\n ({\n height,\n disabled,\n status,\n eMessage,\n theme: {\n base: { 'disabled-opacity': disabledOpacity }\n }\n }) => {\n return css`\n height: ${height};\n ${disabled &&\n css`\n opacity: ${disabledOpacity};\n `}\n ${status === 'error' &&\n eMessage &&\n css`\n opacity: ${disabledOpacity};\n `}\n `;\n }\n);\n\nStyledMap.defaultProps = defaultThemeProp;\n\nexport interface LocationViewProps extends BaseLocationProps, BaseProps {\n /**\n * Location string as either coordinates, name of a place, or 'current' for the current location.\n * @default 'current'\n */\n location?: LatLng | string | 'current';\n /**\n * Set to true to always center the map when the selected location changes. Toggling this from false to true will re-center map on the last pinned location.\n * @default false\n */\n centerMapOnChange?: boolean;\n /**\n * Height of the map container.\n * @default '25rem'\n */\n height?: string;\n /**\n * How much the map should zoom.\n * @default 13\n */\n zoomLevel?: number;\n /** Callback fired when user clicks on a location on the map. This function will be passed the coordinates of the location that was clicked. */\n onClick?: (coords: {\n latitude: number;\n longitude: number;\n name?: string;\n address?: string;\n }) => void;\n}\n\nenum LoadStatus {\n Init = 'init',\n Ready = 'ready',\n Error = 'error'\n}\n\nconst LocationView: FC<LocationViewProps> = (props: LocationViewProps) => {\n const {\n location = 'current',\n zoomLevel = 13,\n height = '25rem',\n centerMapOnChange = false,\n onClick,\n onError,\n disabled = false,\n ...restProps\n } = props;\n const { name, ...providerOpts } = useContext(MapsContext);\n const [status, setStatus] = useState<LoadStatus>(LoadStatus.Init);\n const [eMessage, setEMessage] = useState('');\n const mapElemRef = useRef<HTMLDivElement>();\n const map = useRef<google.maps.Map>();\n const marker = useRef<google.maps.Marker>();\n\n function initialize(): void {\n if (mapElemRef.current) {\n const position = toGoogleLatLng({ latitude: 0, longitude: 0 });\n map.current = new google.maps.Map(mapElemRef.current, {\n center: position,\n zoom: 2,\n draggable: !disabled\n });\n marker.current = new google.maps.Marker({\n map: map.current,\n position\n });\n marker.current?.setVisible(false);\n if (onClick)\n map.current.addListener('click', (event: unknown) => {\n if (\n event &&\n typeof event === 'object' &&\n hasProp(event, 'placeId') &&\n typeof event.placeId === 'string'\n ) {\n getPlaceById(event.placeId).then(placeInfo => {\n if (hasProp(event, 'latLng') && isLatLngObject(event.latLng))\n onClick?.({\n ...placeInfo,\n latitude: event.latLng.lat(),\n longitude: event.latLng.lng()\n });\n });\n }\n });\n }\n }\n\n useEffect(() => {\n let unMounted = false;\n loadMapsAPI(name, providerOpts)\n .then(() => {\n if (!unMounted) {\n initialize();\n setStatus(LoadStatus.Ready);\n }\n })\n .catch((error: Error) => {\n setStatus(LoadStatus.Error);\n setEMessage(error.message);\n onError?.(error);\n });\n\n return () => {\n unMounted = true;\n if (map.current) google.maps.event.clearInstanceListeners(map.current);\n };\n }, []);\n\n useEffect(() => {\n getCoords(location!)\n .then(coords => {\n if (map.current) {\n map.current.setOptions({\n zoom: zoomLevel,\n draggable: !disabled\n });\n marker.current?.setPosition(toGoogleLatLng(coords));\n marker.current?.setVisible(true);\n if (centerMapOnChange) map.current.setCenter(toGoogleLatLng(coords));\n if (status !== LoadStatus.Ready) setStatus(LoadStatus.Ready);\n }\n })\n .catch((error: Error) => {\n if (status !== LoadStatus.Error) setStatus(LoadStatus.Error);\n marker.current?.setVisible(false);\n setEMessage(error.message);\n onError?.(error);\n });\n }, [location, status, zoomLevel, disabled, centerMapOnChange, onError]);\n\n return (\n <StyledLocationView height={height}>\n <StyledMap\n ref={mapElemRef as Ref<HTMLDivElement>}\n height={height}\n disabled={disabled}\n status={status}\n eMessage={eMessage}\n {...restProps}\n />\n {status === LoadStatus.Init && <Progress placement='local' />}\n {status === LoadStatus.Error && eMessage && (\n <Status as={StyledLocationError} aria-label={eMessage} variant='info'>\n {eMessage}\n </Status>\n )}\n </StyledLocationView>\n );\n};\n\nexport default LocationView;\n"]}
@@ -1,4 +1,4 @@
1
- /// <reference types="googlemaps" />
1
+ /// <reference types="google.maps" />
2
2
  import { Bias, LatLng, ProviderOpts } from './types';
3
3
  export declare function loadMapsAPI(name?: string, opts?: ProviderOpts): Promise<void>;
4
4
  export declare function getNavigatorPosition(): Promise<LatLng>;
@@ -12,7 +12,7 @@ export declare function getPlacePredictions(location: string, bias?: Bias): Prom
12
12
  }>;
13
13
  export declare function getPlace(location: string, mapElement?: HTMLDivElement): Promise<LatLng>;
14
14
  export declare function getPlaceById(placeId: string, sessionToken?: google.maps.places.AutocompleteSessionToken, mapElement?: HTMLDivElement): Promise<{
15
- name: string;
15
+ name?: string;
16
16
  address?: string;
17
17
  latitude?: number;
18
18
  longitude?: number;
@@ -25,4 +25,5 @@ export declare function getAddress(coords: LatLng): Promise<{
25
25
  latitude?: number;
26
26
  longitude?: number;
27
27
  }>;
28
+ export declare const isLatLngObject: (obj: unknown) => obj is google.maps.LatLng;
28
29
  //# sourceMappingURL=utils.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/components/Location/utils.ts"],"names":[],"mappings":";AAEA,OAAO,EACL,IAAI,EAMJ,MAAM,EAIN,YAAY,EAGb,MAAM,SAAS,CAAC;AAgDjB,wBAAsB,WAAW,CAAC,IAAI,GAAE,MAAW,EAAE,IAAI,CAAC,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAYvF;AAED,wBAAsB,oBAAoB,IAAI,OAAO,CAAC,MAAM,CAAC,CAc5D;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAEjE;AAED;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,MAAM,EAChB,IAAI,GAAE,IAAS,GACd,OAAO,CAAC;IACT,gBAAgB,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,sBAAsB,EAAE,CAAC;IAC9D,KAAK,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,wBAAwB,CAAC;CACpD,CAAC,CAwCD;AAED,wBAAsB,QAAQ,CAC5B,QAAQ,EAAE,MAAM,EAChB,UAAU,GAAE,cAA8C,GACzD,OAAO,CAAC,MAAM,CAAC,CAkBjB;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