@pega/cosmos-react-core 9.0.0-build.9.8 → 9.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1414) hide show
  1. package/lib/components/AIButton/AIButton.d.ts +3 -1
  2. package/lib/components/AIButton/AIButton.d.ts.map +1 -1
  3. package/lib/components/AIRewrite/AIRewrite.d.ts +4 -0
  4. package/lib/components/AIRewrite/AIRewrite.d.ts.map +1 -0
  5. package/lib/components/AIRewrite/AIRewrite.js +39 -0
  6. package/lib/components/AIRewrite/AIRewrite.js.map +1 -0
  7. package/lib/components/AIRewrite/AIRewrite.styles.d.ts +24 -0
  8. package/lib/components/AIRewrite/AIRewrite.styles.d.ts.map +1 -0
  9. package/lib/components/AIRewrite/AIRewrite.styles.js +24 -0
  10. package/lib/components/AIRewrite/AIRewrite.styles.js.map +1 -0
  11. package/lib/components/AIRewrite/AIRewrite.test-ids.d.ts +2 -0
  12. package/lib/components/AIRewrite/AIRewrite.test-ids.d.ts.map +1 -0
  13. package/lib/components/AIRewrite/AIRewrite.test-ids.js +10 -0
  14. package/lib/components/AIRewrite/AIRewrite.test-ids.js.map +1 -0
  15. package/lib/components/AIRewrite/AIRewrite.types.d.ts +21 -0
  16. package/lib/components/AIRewrite/AIRewrite.types.d.ts.map +1 -0
  17. package/lib/components/AIRewrite/AIRewrite.types.js +2 -0
  18. package/lib/components/AIRewrite/AIRewrite.types.js.map +1 -0
  19. package/lib/components/AIRewrite/index.d.ts +4 -0
  20. package/lib/components/AIRewrite/index.d.ts.map +1 -0
  21. package/lib/components/AIRewrite/index.js +3 -0
  22. package/lib/components/AIRewrite/index.js.map +1 -0
  23. package/lib/components/Actions/Actions.d.ts +2 -0
  24. package/lib/components/Actions/Actions.d.ts.map +1 -1
  25. package/lib/components/Actions/Actions.js +34 -8
  26. package/lib/components/Actions/Actions.js.map +1 -1
  27. package/lib/components/AdditionalInfo/AdditionalInfo.d.ts +1 -1
  28. package/lib/components/AdditionalInfo/AdditionalInfo.d.ts.map +1 -1
  29. package/lib/components/AppShell/AppHeader.d.ts.map +1 -1
  30. package/lib/components/AppShell/AppHeader.js +11 -2
  31. package/lib/components/AppShell/AppHeader.js.map +1 -1
  32. package/lib/components/AppShell/AppHeader.styles.d.ts +14 -12
  33. package/lib/components/AppShell/AppHeader.styles.d.ts.map +1 -1
  34. package/lib/components/AppShell/AppHeader.styles.js +36 -16
  35. package/lib/components/AppShell/AppHeader.styles.js.map +1 -1
  36. package/lib/components/AppShell/AppNavigationPanel.d.ts +14 -0
  37. package/lib/components/AppShell/AppNavigationPanel.d.ts.map +1 -0
  38. package/lib/components/AppShell/AppNavigationPanel.js +173 -0
  39. package/lib/components/AppShell/AppNavigationPanel.js.map +1 -0
  40. package/lib/components/AppShell/AppNavigationPanel.types.d.ts +28 -0
  41. package/lib/components/AppShell/AppNavigationPanel.types.d.ts.map +1 -0
  42. package/lib/components/AppShell/AppNavigationPanel.types.js +2 -0
  43. package/lib/components/AppShell/AppNavigationPanel.types.js.map +1 -0
  44. package/lib/components/AppShell/AppShell.d.ts +2 -5
  45. package/lib/components/AppShell/AppShell.d.ts.map +1 -1
  46. package/lib/components/AppShell/AppShell.js +213 -202
  47. package/lib/components/AppShell/AppShell.js.map +1 -1
  48. package/lib/components/AppShell/AppShell.styles.d.ts +243 -31
  49. package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
  50. package/lib/components/AppShell/AppShell.styles.js +574 -128
  51. package/lib/components/AppShell/AppShell.styles.js.map +1 -1
  52. package/lib/components/AppShell/AppShell.types.d.ts +42 -5
  53. package/lib/components/AppShell/AppShell.types.d.ts.map +1 -1
  54. package/lib/components/AppShell/AppShell.types.js.map +1 -1
  55. package/lib/components/AppShell/AppShellContext.d.ts +6 -2
  56. package/lib/components/AppShell/AppShellContext.d.ts.map +1 -1
  57. package/lib/components/AppShell/AppShellContext.js +5 -9
  58. package/lib/components/AppShell/AppShellContext.js.map +1 -1
  59. package/lib/components/AppShell/AppShellList.styles.d.ts +14 -14
  60. package/lib/components/AppShell/AppShellList.styles.d.ts.map +1 -1
  61. package/lib/components/AppShell/AppShellList.styles.js +0 -1
  62. package/lib/components/AppShell/AppShellList.styles.js.map +1 -1
  63. package/lib/components/AppShell/AppShellSearch.d.ts.map +1 -1
  64. package/lib/components/AppShell/AppShellSearch.js +2 -4
  65. package/lib/components/AppShell/AppShellSearch.js.map +1 -1
  66. package/lib/components/AppShell/AppShellSearch.styles.d.ts +7 -5
  67. package/lib/components/AppShell/AppShellSearch.styles.d.ts.map +1 -1
  68. package/lib/components/AppShell/AppShellSearch.styles.js +3 -3
  69. package/lib/components/AppShell/AppShellSearch.styles.js.map +1 -1
  70. package/lib/components/AppShell/AppTopNav.d.ts +4 -0
  71. package/lib/components/AppShell/AppTopNav.d.ts.map +1 -0
  72. package/lib/components/AppShell/AppTopNav.js +183 -0
  73. package/lib/components/AppShell/AppTopNav.js.map +1 -0
  74. package/lib/components/AppShell/AppTopNav.styles.d.ts +946 -0
  75. package/lib/components/AppShell/AppTopNav.styles.d.ts.map +1 -0
  76. package/lib/components/AppShell/AppTopNav.styles.js +184 -0
  77. package/lib/components/AppShell/AppTopNav.styles.js.map +1 -0
  78. package/lib/components/AppShell/AppTopNav.types.d.ts +16 -0
  79. package/lib/components/AppShell/AppTopNav.types.d.ts.map +1 -0
  80. package/lib/components/AppShell/AppTopNav.types.js +2 -0
  81. package/lib/components/AppShell/AppTopNav.types.js.map +1 -0
  82. package/lib/components/AppShell/Drawer.d.ts +2 -1
  83. package/lib/components/AppShell/Drawer.d.ts.map +1 -1
  84. package/lib/components/AppShell/Drawer.js +15 -14
  85. package/lib/components/AppShell/Drawer.js.map +1 -1
  86. package/lib/components/AppShell/Drawer.styles.d.ts +22 -11
  87. package/lib/components/AppShell/Drawer.styles.d.ts.map +1 -1
  88. package/lib/components/AppShell/Drawer.styles.js +37 -40
  89. package/lib/components/AppShell/Drawer.styles.js.map +1 -1
  90. package/lib/components/AppShell/NavigationList.d.ts.map +1 -1
  91. package/lib/components/AppShell/NavigationList.js +17 -13
  92. package/lib/components/AppShell/NavigationList.js.map +1 -1
  93. package/lib/components/AppShell/NavigationListItemWrapper.d.ts.map +1 -1
  94. package/lib/components/AppShell/NavigationListItemWrapper.js +125 -65
  95. package/lib/components/AppShell/NavigationListItemWrapper.js.map +1 -1
  96. package/lib/components/AppShell/ThemeSwitcher.d.ts +11 -0
  97. package/lib/components/AppShell/ThemeSwitcher.d.ts.map +1 -0
  98. package/lib/components/AppShell/ThemeSwitcher.js +58 -0
  99. package/lib/components/AppShell/ThemeSwitcher.js.map +1 -0
  100. package/lib/components/AppShell/ThemeSwitcher.test-ids.d.ts +2 -0
  101. package/lib/components/AppShell/ThemeSwitcher.test-ids.d.ts.map +1 -0
  102. package/lib/components/AppShell/ThemeSwitcher.test-ids.js +3 -0
  103. package/lib/components/AppShell/ThemeSwitcher.test-ids.js.map +1 -0
  104. package/lib/components/AppShell/TopNavMoreMenu.d.ts +9 -0
  105. package/lib/components/AppShell/TopNavMoreMenu.d.ts.map +1 -0
  106. package/lib/components/AppShell/TopNavMoreMenu.js +73 -0
  107. package/lib/components/AppShell/TopNavMoreMenu.js.map +1 -0
  108. package/lib/components/AppShell/index.d.ts +2 -1
  109. package/lib/components/AppShell/index.d.ts.map +1 -1
  110. package/lib/components/AppShell/index.js +1 -0
  111. package/lib/components/AppShell/index.js.map +1 -1
  112. package/lib/components/AppShell/style-utils.d.ts +0 -1
  113. package/lib/components/AppShell/style-utils.d.ts.map +1 -1
  114. package/lib/components/AppShell/style-utils.js +0 -1
  115. package/lib/components/AppShell/style-utils.js.map +1 -1
  116. package/lib/components/AppShell/useTopNavOverflow.d.ts +17 -0
  117. package/lib/components/AppShell/useTopNavOverflow.d.ts.map +1 -0
  118. package/lib/components/AppShell/useTopNavOverflow.js +73 -0
  119. package/lib/components/AppShell/useTopNavOverflow.js.map +1 -0
  120. package/lib/components/AppShell/utils.d.ts +9 -0
  121. package/lib/components/AppShell/utils.d.ts.map +1 -1
  122. package/lib/components/AppShell/utils.js +16 -1
  123. package/lib/components/AppShell/utils.js.map +1 -1
  124. package/lib/components/Avatar/Avatar.d.ts +9 -5
  125. package/lib/components/Avatar/Avatar.d.ts.map +1 -1
  126. package/lib/components/Avatar/Avatar.js +13 -8
  127. package/lib/components/Avatar/Avatar.js.map +1 -1
  128. package/lib/components/Backdrop/Backdrop.d.ts +186 -3
  129. package/lib/components/Backdrop/Backdrop.d.ts.map +1 -1
  130. package/lib/components/Backdrop/Backdrop.js +20 -21
  131. package/lib/components/Backdrop/Backdrop.js.map +1 -1
  132. package/lib/components/Badges/Alert.d.ts +1 -1
  133. package/lib/components/Badges/Alert.d.ts.map +1 -1
  134. package/lib/components/Badges/Count.d.ts +4 -2
  135. package/lib/components/Badges/Count.d.ts.map +1 -1
  136. package/lib/components/Badges/Count.js +9 -3
  137. package/lib/components/Badges/Count.js.map +1 -1
  138. package/lib/components/Badges/Keyboard.d.ts +1 -1
  139. package/lib/components/Badges/Keyboard.d.ts.map +1 -1
  140. package/lib/components/Badges/Keyboard.js +8 -2
  141. package/lib/components/Badges/Keyboard.js.map +1 -1
  142. package/lib/components/Badges/Selection.d.ts +8 -4
  143. package/lib/components/Badges/Selection.d.ts.map +1 -1
  144. package/lib/components/Badges/Selection.js +23 -7
  145. package/lib/components/Badges/Selection.js.map +1 -1
  146. package/lib/components/Badges/Status.d.ts +2 -2
  147. package/lib/components/Badges/Status.d.ts.map +1 -1
  148. package/lib/components/Badges/Tag.d.ts +10 -2
  149. package/lib/components/Badges/Tag.d.ts.map +1 -1
  150. package/lib/components/Badges/Tag.js.map +1 -1
  151. package/lib/components/Banner/Banner.d.ts +10 -13
  152. package/lib/components/Banner/Banner.d.ts.map +1 -1
  153. package/lib/components/Banner/Banner.js +49 -102
  154. package/lib/components/Banner/Banner.js.map +1 -1
  155. package/lib/components/Banner/Banner.styles.d.ts +22 -0
  156. package/lib/components/Banner/Banner.styles.d.ts.map +1 -0
  157. package/lib/components/Banner/Banner.styles.js +84 -0
  158. package/lib/components/Banner/Banner.styles.js.map +1 -0
  159. package/lib/components/Breadcrumbs/Breadcrumbs.d.ts +2 -3
  160. package/lib/components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -1
  161. package/lib/components/Button/BareButton.d.ts +1 -1
  162. package/lib/components/Button/BareButton.d.ts.map +1 -1
  163. package/lib/components/Button/BareButton.js +4 -1
  164. package/lib/components/Button/BareButton.js.map +1 -1
  165. package/lib/components/Button/BareRoleButton.d.ts +1 -1
  166. package/lib/components/Button/BareRoleButton.d.ts.map +1 -1
  167. package/lib/components/Button/Button.d.ts +7 -3
  168. package/lib/components/Button/Button.d.ts.map +1 -1
  169. package/lib/components/Button/Button.js +22 -8
  170. package/lib/components/Button/Button.js.map +1 -1
  171. package/lib/components/Card/Card.d.ts +3 -3
  172. package/lib/components/Card/Card.d.ts.map +1 -1
  173. package/lib/components/Card/Card.js +25 -25
  174. package/lib/components/Card/Card.js.map +1 -1
  175. package/lib/components/Card/Card.test-ids.d.ts +2 -0
  176. package/lib/components/Card/Card.test-ids.d.ts.map +1 -0
  177. package/lib/components/Card/Card.test-ids.js +3 -0
  178. package/lib/components/Card/Card.test-ids.js.map +1 -0
  179. package/lib/components/Card/CardContent.d.ts +1 -1
  180. package/lib/components/Card/CardContent.d.ts.map +1 -1
  181. package/lib/components/Card/CardContent.js +6 -1
  182. package/lib/components/Card/CardContent.js.map +1 -1
  183. package/lib/components/Card/CardFooter.d.ts +1 -1
  184. package/lib/components/Card/CardFooter.d.ts.map +1 -1
  185. package/lib/components/Card/CardFooter.js +4 -0
  186. package/lib/components/Card/CardFooter.js.map +1 -1
  187. package/lib/components/Card/CardHeader.d.ts +1 -1
  188. package/lib/components/Card/CardHeader.d.ts.map +1 -1
  189. package/lib/components/Card/CardHeader.js +19 -3
  190. package/lib/components/Card/CardHeader.js.map +1 -1
  191. package/lib/components/Card/CardMedia.d.ts +1 -1
  192. package/lib/components/Card/CardMedia.d.ts.map +1 -1
  193. package/lib/components/Checkbox/Checkbox.test-ids.d.ts +1 -1
  194. package/lib/components/Checkbox/Checkbox.test-ids.d.ts.map +1 -1
  195. package/lib/components/Checkbox/CheckboxCard.d.ts +11 -3
  196. package/lib/components/Checkbox/CheckboxCard.d.ts.map +1 -1
  197. package/lib/components/Checkbox/CheckboxCard.js +5 -22
  198. package/lib/components/Checkbox/CheckboxCard.js.map +1 -1
  199. package/lib/components/CheckboxGroup/CheckboxGroup.d.ts +7 -0
  200. package/lib/components/CheckboxGroup/CheckboxGroup.d.ts.map +1 -0
  201. package/lib/components/CheckboxGroup/CheckboxGroup.js +10 -0
  202. package/lib/components/CheckboxGroup/CheckboxGroup.js.map +1 -0
  203. package/lib/components/CheckboxGroup/index.d.ts +2 -1
  204. package/lib/components/CheckboxGroup/index.d.ts.map +1 -1
  205. package/lib/components/CheckboxGroup/index.js +1 -1
  206. package/lib/components/CheckboxGroup/index.js.map +1 -1
  207. package/lib/components/ClassificationMarking/ClassificationMarking.d.ts +6 -0
  208. package/lib/components/ClassificationMarking/ClassificationMarking.d.ts.map +1 -0
  209. package/lib/components/ClassificationMarking/ClassificationMarking.js +11 -0
  210. package/lib/components/ClassificationMarking/ClassificationMarking.js.map +1 -0
  211. package/lib/components/ClassificationMarking/ClassificationMarking.styles.d.ts +19 -0
  212. package/lib/components/ClassificationMarking/ClassificationMarking.styles.d.ts.map +1 -0
  213. package/lib/components/ClassificationMarking/ClassificationMarking.styles.js +66 -0
  214. package/lib/components/ClassificationMarking/ClassificationMarking.styles.js.map +1 -0
  215. package/lib/components/ClassificationMarking/ClassificationMarking.test-ids.d.ts +2 -0
  216. package/lib/components/ClassificationMarking/ClassificationMarking.test-ids.d.ts.map +1 -0
  217. package/lib/components/ClassificationMarking/ClassificationMarking.test-ids.js +7 -0
  218. package/lib/components/ClassificationMarking/ClassificationMarking.test-ids.js.map +1 -0
  219. package/lib/components/ClassificationMarking/ClassificationMarking.types.d.ts +19 -0
  220. package/lib/components/ClassificationMarking/ClassificationMarking.types.d.ts.map +1 -0
  221. package/lib/components/ClassificationMarking/ClassificationMarking.types.js +2 -0
  222. package/lib/components/ClassificationMarking/ClassificationMarking.types.js.map +1 -0
  223. package/lib/components/ClassificationMarking/index.d.ts +3 -0
  224. package/lib/components/ClassificationMarking/index.d.ts.map +1 -0
  225. package/lib/components/ClassificationMarking/index.js +2 -0
  226. package/lib/components/ClassificationMarking/index.js.map +1 -0
  227. package/lib/components/ComboBox/ComboBox.d.ts.map +1 -1
  228. package/lib/components/ComboBox/ComboBox.js +9 -8
  229. package/lib/components/ComboBox/ComboBox.js.map +1 -1
  230. package/lib/components/ComboBox/ComboBox.styles.d.ts +8 -3
  231. package/lib/components/ComboBox/ComboBox.styles.d.ts.map +1 -1
  232. package/lib/components/ComboBox/ComboBox.styles.js +33 -16
  233. package/lib/components/ComboBox/ComboBox.styles.js.map +1 -1
  234. package/lib/components/ComboBox/ComboBox.types.d.ts +1 -0
  235. package/lib/components/ComboBox/ComboBox.types.d.ts.map +1 -1
  236. package/lib/components/ComboBox/ComboBox.types.js.map +1 -1
  237. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.d.ts +3 -1
  238. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.d.ts.map +1 -1
  239. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js +84 -10
  240. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js.map +1 -1
  241. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.types.d.ts +2 -0
  242. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.types.d.ts.map +1 -1
  243. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.types.js.map +1 -1
  244. package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.d.ts +3 -1
  245. package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.d.ts.map +1 -1
  246. package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.js +33 -4
  247. package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.js.map +1 -1
  248. package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.types.d.ts +2 -0
  249. package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.types.d.ts.map +1 -1
  250. package/lib/components/ComboBox/SingleSelectInput/SingleSelectInput.types.js.map +1 -1
  251. package/lib/components/ComboBox/index.d.ts +1 -0
  252. package/lib/components/ComboBox/index.d.ts.map +1 -1
  253. package/lib/components/ComboBox/index.js +1 -0
  254. package/lib/components/ComboBox/index.js.map +1 -1
  255. package/lib/components/CompositeInput/CompositeInput.d.ts.map +1 -1
  256. package/lib/components/CompositeInput/CompositeInput.js +7 -9
  257. package/lib/components/CompositeInput/CompositeInput.js.map +1 -1
  258. package/lib/components/CompositeInput/CompositeInput.styles.d.ts +8 -3
  259. package/lib/components/CompositeInput/CompositeInput.styles.d.ts.map +1 -1
  260. package/lib/components/CompositeInput/CompositeInput.styles.js +31 -1
  261. package/lib/components/CompositeInput/CompositeInput.styles.js.map +1 -1
  262. package/lib/components/Configuration/Configuration.d.ts +8 -3
  263. package/lib/components/Configuration/Configuration.d.ts.map +1 -1
  264. package/lib/components/Configuration/Configuration.js +17 -3
  265. package/lib/components/Configuration/Configuration.js.map +1 -1
  266. package/lib/components/Configuration/LocaleOverride.d.ts +10 -0
  267. package/lib/components/Configuration/LocaleOverride.d.ts.map +1 -0
  268. package/lib/components/Configuration/LocaleOverride.js +23 -0
  269. package/lib/components/Configuration/LocaleOverride.js.map +1 -0
  270. package/lib/components/Configuration/index.d.ts +2 -0
  271. package/lib/components/Configuration/index.d.ts.map +1 -1
  272. package/lib/components/Configuration/index.js +1 -0
  273. package/lib/components/Configuration/index.js.map +1 -1
  274. package/lib/components/CreditCard/CreditCard.types.d.ts +4 -0
  275. package/lib/components/CreditCard/CreditCard.types.d.ts.map +1 -1
  276. package/lib/components/CreditCard/CreditCard.types.js.map +1 -1
  277. package/lib/components/CreditCard/CreditCardInput.d.ts +2 -1
  278. package/lib/components/CreditCard/CreditCardInput.d.ts.map +1 -1
  279. package/lib/components/CreditCard/CreditCardInput.js +1 -1
  280. package/lib/components/CreditCard/CreditCardInput.js.map +1 -1
  281. package/lib/components/Currency/CurrencyInput.js +1 -1
  282. package/lib/components/Currency/CurrencyInput.js.map +1 -1
  283. package/lib/components/Currency/CurrencyInput.styles.d.ts +4 -2
  284. package/lib/components/Currency/CurrencyInput.styles.d.ts.map +1 -1
  285. package/lib/components/DangerButton/DangerButton.d.ts +3 -1
  286. package/lib/components/DangerButton/DangerButton.d.ts.map +1 -1
  287. package/lib/components/DateTime/DateTime.types.d.ts +7 -1
  288. package/lib/components/DateTime/DateTime.types.d.ts.map +1 -1
  289. package/lib/components/DateTime/DateTime.types.js.map +1 -1
  290. package/lib/components/DateTime/DateTimeDisplay.d.ts +1 -1
  291. package/lib/components/DateTime/DateTimeDisplay.d.ts.map +1 -1
  292. package/lib/components/DateTime/Input/DateInput.d.ts +7 -2
  293. package/lib/components/DateTime/Input/DateInput.d.ts.map +1 -1
  294. package/lib/components/DateTime/Input/DateInput.js +16 -8
  295. package/lib/components/DateTime/Input/DateInput.js.map +1 -1
  296. package/lib/components/DateTime/Input/DateRangeInput.d.ts.map +1 -1
  297. package/lib/components/DateTime/Input/DateRangeInput.js +10 -4
  298. package/lib/components/DateTime/Input/DateRangeInput.js.map +1 -1
  299. package/lib/components/DateTime/Input/DateTime.styles.d.ts +11 -7
  300. package/lib/components/DateTime/Input/DateTime.styles.d.ts.map +1 -1
  301. package/lib/components/DateTime/Input/DateTime.styles.js +5 -2
  302. package/lib/components/DateTime/Input/DateTime.styles.js.map +1 -1
  303. package/lib/components/DateTime/Input/DateTimeInput.d.ts +4 -2
  304. package/lib/components/DateTime/Input/DateTimeInput.d.ts.map +1 -1
  305. package/lib/components/DateTime/Input/DateTimeInput.js +20 -14
  306. package/lib/components/DateTime/Input/DateTimeInput.js.map +1 -1
  307. package/lib/components/DateTime/Input/DayOfWeekInput.d.ts.map +1 -1
  308. package/lib/components/DateTime/Input/DayOfWeekInput.js.map +1 -1
  309. package/lib/components/DateTime/Input/Duration/DurationInput.d.ts.map +1 -1
  310. package/lib/components/DateTime/Input/Duration/DurationInput.js +2 -4
  311. package/lib/components/DateTime/Input/Duration/DurationInput.js.map +1 -1
  312. package/lib/components/DateTime/Input/Duration/NumberUnit.d.ts +3 -1
  313. package/lib/components/DateTime/Input/Duration/NumberUnit.d.ts.map +1 -1
  314. package/lib/components/DateTime/Input/MonthInput.d.ts +3 -1
  315. package/lib/components/DateTime/Input/MonthInput.d.ts.map +1 -1
  316. package/lib/components/DateTime/Input/MonthInput.js +6 -8
  317. package/lib/components/DateTime/Input/MonthInput.js.map +1 -1
  318. package/lib/components/DateTime/Input/PartInput.d.ts.map +1 -1
  319. package/lib/components/DateTime/Input/PartInput.js +21 -12
  320. package/lib/components/DateTime/Input/PartInput.js.map +1 -1
  321. package/lib/components/DateTime/Input/QuarterInput.d.ts +3 -1
  322. package/lib/components/DateTime/Input/QuarterInput.d.ts.map +1 -1
  323. package/lib/components/DateTime/Input/QuarterInput.js +2 -2
  324. package/lib/components/DateTime/Input/QuarterInput.js.map +1 -1
  325. package/lib/components/DateTime/Input/TimeInput.d.ts +3 -1
  326. package/lib/components/DateTime/Input/TimeInput.d.ts.map +1 -1
  327. package/lib/components/DateTime/Input/TimeInput.js +3 -3
  328. package/lib/components/DateTime/Input/TimeInput.js.map +1 -1
  329. package/lib/components/DateTime/Input/TimeRangeInput.d.ts.map +1 -1
  330. package/lib/components/DateTime/Input/TimeRangeInput.js +9 -4
  331. package/lib/components/DateTime/Input/TimeRangeInput.js.map +1 -1
  332. package/lib/components/DateTime/Input/WeekInput.d.ts +3 -1
  333. package/lib/components/DateTime/Input/WeekInput.d.ts.map +1 -1
  334. package/lib/components/DateTime/Input/WeekInput.js +23 -12
  335. package/lib/components/DateTime/Input/WeekInput.js.map +1 -1
  336. package/lib/components/DateTime/Input/local.d.ts +10 -9
  337. package/lib/components/DateTime/Input/local.d.ts.map +1 -1
  338. package/lib/components/DateTime/Input/local.js.map +1 -1
  339. package/lib/components/DateTime/Input/utils.d.ts +11 -11
  340. package/lib/components/DateTime/Input/utils.d.ts.map +1 -1
  341. package/lib/components/DateTime/Input/utils.js +77 -48
  342. package/lib/components/DateTime/Input/utils.js.map +1 -1
  343. package/lib/components/DateTime/Picker/Calendar.d.ts +4 -1
  344. package/lib/components/DateTime/Picker/Calendar.d.ts.map +1 -1
  345. package/lib/components/DateTime/Picker/Calendar.js +28 -26
  346. package/lib/components/DateTime/Picker/Calendar.js.map +1 -1
  347. package/lib/components/DateTime/Picker/Calendar.styles.d.ts +14 -8
  348. package/lib/components/DateTime/Picker/Calendar.styles.d.ts.map +1 -1
  349. package/lib/components/DateTime/Picker/Calendar.styles.js +6 -1
  350. package/lib/components/DateTime/Picker/Calendar.styles.js.map +1 -1
  351. package/lib/components/DateTime/Picker/DatePicker.d.ts.map +1 -1
  352. package/lib/components/DateTime/Picker/DatePicker.js +15 -15
  353. package/lib/components/DateTime/Picker/DatePicker.js.map +1 -1
  354. package/lib/components/DateTime/Picker/DatePicker.styles.d.ts +8 -4
  355. package/lib/components/DateTime/Picker/DatePicker.styles.d.ts.map +1 -1
  356. package/lib/components/DateTime/Picker/DatePicker.styles.js +5 -4
  357. package/lib/components/DateTime/Picker/DatePicker.styles.js.map +1 -1
  358. package/lib/components/DateTime/Picker/DatePicker.types.d.ts +11 -1
  359. package/lib/components/DateTime/Picker/DatePicker.types.d.ts.map +1 -1
  360. package/lib/components/DateTime/Picker/DatePicker.types.js.map +1 -1
  361. package/lib/components/DateTime/Picker/DateRangePicker.d.ts.map +1 -1
  362. package/lib/components/DateTime/Picker/DateRangePicker.js +15 -15
  363. package/lib/components/DateTime/Picker/DateRangePicker.js.map +1 -1
  364. package/lib/components/DateTime/Picker/TimePicker.d.ts +2 -0
  365. package/lib/components/DateTime/Picker/TimePicker.d.ts.map +1 -1
  366. package/lib/components/DateTime/Picker/TimePicker.js +19 -11
  367. package/lib/components/DateTime/Picker/TimePicker.js.map +1 -1
  368. package/lib/components/DateTime/Picker/Weeks.d.ts +3 -2
  369. package/lib/components/DateTime/Picker/Weeks.d.ts.map +1 -1
  370. package/lib/components/DateTime/Picker/Weeks.js +7 -7
  371. package/lib/components/DateTime/Picker/Weeks.js.map +1 -1
  372. package/lib/components/DateTime/Picker/utils.d.ts +4 -3
  373. package/lib/components/DateTime/Picker/utils.d.ts.map +1 -1
  374. package/lib/components/DateTime/Picker/utils.js.map +1 -1
  375. package/lib/components/DateTime/utils.d.ts +8 -1
  376. package/lib/components/DateTime/utils.d.ts.map +1 -1
  377. package/lib/components/DateTime/utils.js +86 -82
  378. package/lib/components/DateTime/utils.js.map +1 -1
  379. package/lib/components/Dialog/Dialog.styles.d.ts +5 -5
  380. package/lib/components/Dialog/Dialog.styles.d.ts.map +1 -1
  381. package/lib/components/Dialog/Dialog.styles.js +7 -0
  382. package/lib/components/Dialog/Dialog.styles.js.map +1 -1
  383. package/lib/components/Dialog/Dialog.types.d.ts +5 -2
  384. package/lib/components/Dialog/Dialog.types.d.ts.map +1 -1
  385. package/lib/components/Dialog/Dialog.types.js.map +1 -1
  386. package/lib/components/Dialog/FormDialog.d.ts +3 -1
  387. package/lib/components/Dialog/FormDialog.d.ts.map +1 -1
  388. package/lib/components/Dialog/FormDialog.js +20 -15
  389. package/lib/components/Dialog/FormDialog.js.map +1 -1
  390. package/lib/components/Dialog/InfoDialog.d.ts.map +1 -1
  391. package/lib/components/Dialog/InfoDialog.js +15 -14
  392. package/lib/components/Dialog/InfoDialog.js.map +1 -1
  393. package/lib/components/Dialog/InfoDialog.styles.d.ts +6 -2
  394. package/lib/components/Dialog/InfoDialog.styles.d.ts.map +1 -1
  395. package/lib/components/Drawer/Drawer.d.ts +2 -2
  396. package/lib/components/Drawer/Drawer.d.ts.map +1 -1
  397. package/lib/components/Drawer/Drawer.js +9 -0
  398. package/lib/components/Drawer/Drawer.js.map +1 -1
  399. package/lib/components/Drawer/ResizeHandle.d.ts +2 -1
  400. package/lib/components/Drawer/ResizeHandle.d.ts.map +1 -1
  401. package/lib/components/Drawer/ResizeHandle.js +3 -2
  402. package/lib/components/Drawer/ResizeHandle.js.map +1 -1
  403. package/lib/components/EmojiPicker/EmojiPicker.styles.d.ts +2 -2
  404. package/lib/components/EmojiPicker/EmojiPicker.styles.d.ts.map +1 -1
  405. package/lib/components/EmojiPicker/EmojiPicker.styles.js +1 -1
  406. package/lib/components/EmojiPicker/EmojiPicker.styles.js.map +1 -1
  407. package/lib/components/EmptyState/EmptyState.d.ts +1 -1
  408. package/lib/components/EmptyState/EmptyState.d.ts.map +1 -1
  409. package/lib/components/ErrorState/ErrorState.d.ts +1 -1
  410. package/lib/components/ErrorState/ErrorState.d.ts.map +1 -1
  411. package/lib/components/ExpandCollapse/ExpandCollapseButton.d.ts +32 -0
  412. package/lib/components/ExpandCollapse/ExpandCollapseButton.d.ts.map +1 -0
  413. package/lib/components/ExpandCollapse/ExpandCollapseButton.js +81 -0
  414. package/lib/components/ExpandCollapse/ExpandCollapseButton.js.map +1 -0
  415. package/lib/components/ExpandCollapse/index.d.ts +2 -0
  416. package/lib/components/ExpandCollapse/index.d.ts.map +1 -1
  417. package/lib/components/ExpandCollapse/index.js +1 -0
  418. package/lib/components/ExpandCollapse/index.js.map +1 -1
  419. package/lib/components/FieldGroup/FieldGroup.d.ts +381 -8
  420. package/lib/components/FieldGroup/FieldGroup.d.ts.map +1 -1
  421. package/lib/components/FieldGroup/FieldGroup.js +27 -22
  422. package/lib/components/FieldGroup/FieldGroup.js.map +1 -1
  423. package/lib/components/FieldGroup/FieldGroupList.d.ts +2 -2
  424. package/lib/components/FieldGroup/FieldGroupList.d.ts.map +1 -1
  425. package/lib/components/FieldGroup/FieldGroupList.js +61 -48
  426. package/lib/components/FieldGroup/FieldGroupList.js.map +1 -1
  427. package/lib/components/FieldValueList/FieldValueList.d.ts +13 -4
  428. package/lib/components/FieldValueList/FieldValueList.d.ts.map +1 -1
  429. package/lib/components/FieldValueList/FieldValueList.js +20 -9
  430. package/lib/components/FieldValueList/FieldValueList.js.map +1 -1
  431. package/lib/components/FieldValueList/index.d.ts +1 -1
  432. package/lib/components/FieldValueList/index.d.ts.map +1 -1
  433. package/lib/components/FieldValueList/index.js +1 -1
  434. package/lib/components/FieldValueList/index.js.map +1 -1
  435. package/lib/components/File/FileDisplay.d.ts +1 -1
  436. package/lib/components/File/FileDisplay.d.ts.map +1 -1
  437. package/lib/components/File/FileDisplay.js +2 -2
  438. package/lib/components/File/FileDisplay.js.map +1 -1
  439. package/lib/components/File/FileInput.d.ts.map +1 -1
  440. package/lib/components/File/FileInput.js +11 -21
  441. package/lib/components/File/FileInput.js.map +1 -1
  442. package/lib/components/File/FileInput.styles.d.ts +753 -17
  443. package/lib/components/File/FileInput.styles.d.ts.map +1 -1
  444. package/lib/components/File/FileInput.styles.js +16 -18
  445. package/lib/components/File/FileInput.styles.js.map +1 -1
  446. package/lib/components/File/FileItem.d.ts +11 -3
  447. package/lib/components/File/FileItem.d.ts.map +1 -1
  448. package/lib/components/File/FileItem.js +29 -12
  449. package/lib/components/File/FileItem.js.map +1 -1
  450. package/lib/components/File/FileList.d.ts +184 -2
  451. package/lib/components/File/FileList.d.ts.map +1 -1
  452. package/lib/components/File/FileList.js.map +1 -1
  453. package/lib/components/File/FileUploadItem.js +1 -1
  454. package/lib/components/File/FileUploadItem.js.map +1 -1
  455. package/lib/components/File/FileVisual.d.ts +4 -3
  456. package/lib/components/File/FileVisual.d.ts.map +1 -1
  457. package/lib/components/Flex/Flex.d.ts +1 -1
  458. package/lib/components/Flex/Flex.d.ts.map +1 -1
  459. package/lib/components/Flex/Flex.js +1 -1
  460. package/lib/components/Flex/Flex.js.map +1 -1
  461. package/lib/components/FormControl/FormControl.d.ts +2 -2
  462. package/lib/components/FormControl/FormControl.d.ts.map +1 -1
  463. package/lib/components/FormControl/FormControl.js +65 -54
  464. package/lib/components/FormControl/FormControl.js.map +1 -1
  465. package/lib/components/FormField/FormField.d.ts +12 -5
  466. package/lib/components/FormField/FormField.d.ts.map +1 -1
  467. package/lib/components/FormField/FormField.js +98 -61
  468. package/lib/components/FormField/FormField.js.map +1 -1
  469. package/lib/components/FormField/index.d.ts +1 -1
  470. package/lib/components/FormField/index.d.ts.map +1 -1
  471. package/lib/components/FormField/index.js +1 -1
  472. package/lib/components/FormField/index.js.map +1 -1
  473. package/lib/components/Fullscreen/Fullscreen.d.ts +3 -5
  474. package/lib/components/Fullscreen/Fullscreen.d.ts.map +1 -1
  475. package/lib/components/Fullscreen/Fullscreen.js +12 -8
  476. package/lib/components/Fullscreen/Fullscreen.js.map +1 -1
  477. package/lib/components/Fullscreen/FullscreenButton.d.ts +3 -1
  478. package/lib/components/Fullscreen/FullscreenButton.d.ts.map +1 -1
  479. package/lib/components/Grid/Grid.d.ts +1 -1
  480. package/lib/components/Grid/Grid.d.ts.map +1 -1
  481. package/lib/components/HTML/HTML.d.ts +3 -3
  482. package/lib/components/HTML/HTML.d.ts.map +1 -1
  483. package/lib/components/HTML/HTML.js +11 -5
  484. package/lib/components/HTML/HTML.js.map +1 -1
  485. package/lib/components/HiddenText/HiddenText.d.ts +1 -1
  486. package/lib/components/HiddenText/HiddenText.d.ts.map +1 -1
  487. package/lib/components/Icon/Icon.d.ts +4 -4
  488. package/lib/components/Icon/Icon.d.ts.map +1 -1
  489. package/lib/components/Icon/Icon.js +7 -2
  490. package/lib/components/Icon/Icon.js.map +1 -1
  491. package/lib/components/Icon/iconNames.d.ts +1 -1
  492. package/lib/components/Icon/iconNames.d.ts.map +1 -1
  493. package/lib/components/Icon/iconNames.js +17 -0
  494. package/lib/components/Icon/iconNames.js.map +1 -1
  495. package/lib/components/Icon/icons/arrow-micro-left-right-reverse.icon.d.ts +5 -0
  496. package/lib/components/Icon/icons/arrow-micro-left-right-reverse.icon.d.ts.map +1 -0
  497. package/lib/components/Icon/icons/arrow-micro-left-right-reverse.icon.js +7 -0
  498. package/lib/components/Icon/icons/arrow-micro-left-right-reverse.icon.js.map +1 -0
  499. package/lib/components/Icon/icons/arrow-micro-left-right.icon.d.ts +5 -0
  500. package/lib/components/Icon/icons/arrow-micro-left-right.icon.d.ts.map +1 -0
  501. package/lib/components/Icon/icons/arrow-micro-left-right.icon.js +7 -0
  502. package/lib/components/Icon/icons/arrow-micro-left-right.icon.js.map +1 -0
  503. package/lib/components/Icon/icons/brain.icon.d.ts +5 -0
  504. package/lib/components/Icon/icons/brain.icon.d.ts.map +1 -0
  505. package/lib/components/Icon/icons/brain.icon.js +7 -0
  506. package/lib/components/Icon/icons/brain.icon.js.map +1 -0
  507. package/lib/components/Icon/icons/chats-ai.icon.d.ts +5 -0
  508. package/lib/components/Icon/icons/chats-ai.icon.d.ts.map +1 -0
  509. package/lib/components/Icon/icons/chats-ai.icon.js +7 -0
  510. package/lib/components/Icon/icons/chats-ai.icon.js.map +1 -0
  511. package/lib/components/Icon/icons/check-solid.icon.d.ts +5 -0
  512. package/lib/components/Icon/icons/check-solid.icon.d.ts.map +1 -0
  513. package/lib/components/Icon/icons/check-solid.icon.js +7 -0
  514. package/lib/components/Icon/icons/check-solid.icon.js.map +1 -0
  515. package/lib/components/Icon/icons/clock-sla.icon.d.ts +5 -0
  516. package/lib/components/Icon/icons/clock-sla.icon.d.ts.map +1 -0
  517. package/lib/components/Icon/icons/clock-sla.icon.js +7 -0
  518. package/lib/components/Icon/icons/clock-sla.icon.js.map +1 -0
  519. package/lib/components/Icon/icons/csr-connected.icon.d.ts +5 -0
  520. package/lib/components/Icon/icons/csr-connected.icon.d.ts.map +1 -0
  521. package/lib/components/Icon/icons/csr-connected.icon.js +7 -0
  522. package/lib/components/Icon/icons/csr-connected.icon.js.map +1 -0
  523. package/lib/components/Icon/icons/dataviz-string-field.icon.d.ts.map +1 -1
  524. package/lib/components/Icon/icons/dataviz-string-field.icon.js +1 -1
  525. package/lib/components/Icon/icons/dataviz-string-field.icon.js.map +1 -1
  526. package/lib/components/Icon/icons/gear-box-dotted.icon.d.ts +5 -0
  527. package/lib/components/Icon/icons/gear-box-dotted.icon.d.ts.map +1 -0
  528. package/lib/components/Icon/icons/gear-box-dotted.icon.js +7 -0
  529. package/lib/components/Icon/icons/gear-box-dotted.icon.js.map +1 -0
  530. package/lib/components/Icon/icons/information-solid.icon.js +1 -1
  531. package/lib/components/Icon/icons/information-solid.icon.js.map +1 -1
  532. package/lib/components/Icon/icons/information.icon.js +1 -1
  533. package/lib/components/Icon/icons/information.icon.js.map +1 -1
  534. package/lib/components/Icon/icons/input-pen.icon.d.ts +5 -0
  535. package/lib/components/Icon/icons/input-pen.icon.d.ts.map +1 -0
  536. package/lib/components/Icon/icons/input-pen.icon.js +7 -0
  537. package/lib/components/Icon/icons/input-pen.icon.js.map +1 -0
  538. package/lib/components/Icon/icons/mcp.icon.d.ts +5 -0
  539. package/lib/components/Icon/icons/mcp.icon.d.ts.map +1 -0
  540. package/lib/components/Icon/icons/mcp.icon.js +7 -0
  541. package/lib/components/Icon/icons/mcp.icon.js.map +1 -0
  542. package/lib/components/Icon/icons/open.icon.d.ts.map +1 -1
  543. package/lib/components/Icon/icons/open.icon.js +2 -2
  544. package/lib/components/Icon/icons/open.icon.js.map +1 -1
  545. package/lib/components/Icon/icons/preview-bottom.icon.d.ts +5 -0
  546. package/lib/components/Icon/icons/preview-bottom.icon.d.ts.map +1 -0
  547. package/lib/components/Icon/icons/preview-bottom.icon.js +7 -0
  548. package/lib/components/Icon/icons/preview-bottom.icon.js.map +1 -0
  549. package/lib/components/Icon/icons/preview-collapse.icon.d.ts +5 -0
  550. package/lib/components/Icon/icons/preview-collapse.icon.d.ts.map +1 -0
  551. package/lib/components/Icon/icons/preview-collapse.icon.js +7 -0
  552. package/lib/components/Icon/icons/preview-collapse.icon.js.map +1 -0
  553. package/lib/components/Icon/icons/preview-expand.icon.d.ts +5 -0
  554. package/lib/components/Icon/icons/preview-expand.icon.d.ts.map +1 -0
  555. package/lib/components/Icon/icons/preview-expand.icon.js +7 -0
  556. package/lib/components/Icon/icons/preview-expand.icon.js.map +1 -0
  557. package/lib/components/Icon/icons/preview-hide.icon.d.ts +5 -0
  558. package/lib/components/Icon/icons/preview-hide.icon.d.ts.map +1 -0
  559. package/lib/components/Icon/icons/preview-hide.icon.js +7 -0
  560. package/lib/components/Icon/icons/preview-hide.icon.js.map +1 -0
  561. package/lib/components/Icon/icons/preview-rtl.icon.d.ts +5 -0
  562. package/lib/components/Icon/icons/preview-rtl.icon.d.ts.map +1 -0
  563. package/lib/components/Icon/icons/preview-rtl.icon.js +7 -0
  564. package/lib/components/Icon/icons/preview-rtl.icon.js.map +1 -0
  565. package/lib/components/Icon/icons/script-solid.icon.d.ts +5 -0
  566. package/lib/components/Icon/icons/script-solid.icon.d.ts.map +1 -0
  567. package/lib/components/Icon/icons/script-solid.icon.js +7 -0
  568. package/lib/components/Icon/icons/script-solid.icon.js.map +1 -0
  569. package/lib/components/Icon/icons/user-laptop.icon.d.ts +5 -0
  570. package/lib/components/Icon/icons/user-laptop.icon.d.ts.map +1 -0
  571. package/lib/components/Icon/icons/user-laptop.icon.js +7 -0
  572. package/lib/components/Icon/icons/user-laptop.icon.js.map +1 -0
  573. package/lib/components/Icon/index.d.ts +1 -1
  574. package/lib/components/Icon/index.d.ts.map +1 -1
  575. package/lib/components/Icon/index.js +1 -1
  576. package/lib/components/Icon/index.js.map +1 -1
  577. package/lib/components/Icon/streamline-icons/animal-print.icon.d.ts +5 -0
  578. package/lib/components/Icon/streamline-icons/animal-print.icon.d.ts.map +1 -0
  579. package/lib/components/Icon/streamline-icons/animal-print.icon.js +7 -0
  580. package/lib/components/Icon/streamline-icons/animal-print.icon.js.map +1 -0
  581. package/lib/components/Icon/streamline-icons/boat-cargo.icon.d.ts +5 -0
  582. package/lib/components/Icon/streamline-icons/boat-cargo.icon.d.ts.map +1 -0
  583. package/lib/components/Icon/streamline-icons/boat-cargo.icon.js +7 -0
  584. package/lib/components/Icon/streamline-icons/boat-cargo.icon.js.map +1 -0
  585. package/lib/components/Icon/streamline-icons/bolt-solid.icon.d.ts +5 -0
  586. package/lib/components/Icon/streamline-icons/bolt-solid.icon.d.ts.map +1 -0
  587. package/lib/components/Icon/streamline-icons/bolt-solid.icon.js +7 -0
  588. package/lib/components/Icon/streamline-icons/bolt-solid.icon.js.map +1 -0
  589. package/lib/components/Icon/streamline-icons/bolt.icon.d.ts +5 -0
  590. package/lib/components/Icon/streamline-icons/bolt.icon.d.ts.map +1 -0
  591. package/lib/components/Icon/streamline-icons/bolt.icon.js +7 -0
  592. package/lib/components/Icon/streamline-icons/bolt.icon.js.map +1 -0
  593. package/lib/components/Icon/streamline-icons/browser-site.icon.d.ts +5 -0
  594. package/lib/components/Icon/streamline-icons/browser-site.icon.d.ts.map +1 -0
  595. package/lib/components/Icon/streamline-icons/browser-site.icon.js +7 -0
  596. package/lib/components/Icon/streamline-icons/browser-site.icon.js.map +1 -0
  597. package/lib/components/Icon/streamline-icons/building-globe.icon.d.ts +5 -0
  598. package/lib/components/Icon/streamline-icons/building-globe.icon.d.ts.map +1 -0
  599. package/lib/components/Icon/streamline-icons/building-globe.icon.js +7 -0
  600. package/lib/components/Icon/streamline-icons/building-globe.icon.js.map +1 -0
  601. package/lib/components/Icon/streamline-icons/check-polaris-solid.icon.d.ts +5 -0
  602. package/lib/components/Icon/streamline-icons/check-polaris-solid.icon.d.ts.map +1 -0
  603. package/lib/components/Icon/streamline-icons/check-polaris-solid.icon.js +7 -0
  604. package/lib/components/Icon/streamline-icons/check-polaris-solid.icon.js.map +1 -0
  605. package/lib/components/Icon/streamline-icons/chess.icon.d.ts +5 -0
  606. package/lib/components/Icon/streamline-icons/chess.icon.d.ts.map +1 -0
  607. package/lib/components/Icon/streamline-icons/chess.icon.js +7 -0
  608. package/lib/components/Icon/streamline-icons/chess.icon.js.map +1 -0
  609. package/lib/components/Icon/streamline-icons/clock-sla.icon.d.ts +5 -0
  610. package/lib/components/Icon/streamline-icons/clock-sla.icon.d.ts.map +1 -0
  611. package/lib/components/Icon/streamline-icons/clock-sla.icon.js +7 -0
  612. package/lib/components/Icon/streamline-icons/clock-sla.icon.js.map +1 -0
  613. package/lib/components/Icon/streamline-icons/cloud-nodes.icon.d.ts +5 -0
  614. package/lib/components/Icon/streamline-icons/cloud-nodes.icon.d.ts.map +1 -0
  615. package/lib/components/Icon/streamline-icons/cloud-nodes.icon.js +7 -0
  616. package/lib/components/Icon/streamline-icons/cloud-nodes.icon.js.map +1 -0
  617. package/lib/components/Icon/streamline-icons/confetti.icon.d.ts +5 -0
  618. package/lib/components/Icon/streamline-icons/confetti.icon.d.ts.map +1 -0
  619. package/lib/components/Icon/streamline-icons/confetti.icon.js +7 -0
  620. package/lib/components/Icon/streamline-icons/confetti.icon.js.map +1 -0
  621. package/lib/components/Icon/streamline-icons/conveyor-cargo.icon.d.ts +5 -0
  622. package/lib/components/Icon/streamline-icons/conveyor-cargo.icon.d.ts.map +1 -0
  623. package/lib/components/Icon/streamline-icons/conveyor-cargo.icon.js +7 -0
  624. package/lib/components/Icon/streamline-icons/conveyor-cargo.icon.js.map +1 -0
  625. package/lib/components/Icon/streamline-icons/cpu-chip.icon.d.ts +5 -0
  626. package/lib/components/Icon/streamline-icons/cpu-chip.icon.d.ts.map +1 -0
  627. package/lib/components/Icon/streamline-icons/cpu-chip.icon.js +7 -0
  628. package/lib/components/Icon/streamline-icons/cpu-chip.icon.js.map +1 -0
  629. package/lib/components/Icon/streamline-icons/desktop-pencil.icon.d.ts +5 -0
  630. package/lib/components/Icon/streamline-icons/desktop-pencil.icon.d.ts.map +1 -0
  631. package/lib/components/Icon/streamline-icons/desktop-pencil.icon.js +7 -0
  632. package/lib/components/Icon/streamline-icons/desktop-pencil.icon.js.map +1 -0
  633. package/lib/components/Icon/streamline-icons/disc-document.icon.d.ts +5 -0
  634. package/lib/components/Icon/streamline-icons/disc-document.icon.d.ts.map +1 -0
  635. package/lib/components/Icon/streamline-icons/disc-document.icon.js +7 -0
  636. package/lib/components/Icon/streamline-icons/disc-document.icon.js.map +1 -0
  637. package/lib/components/Icon/streamline-icons/disc-nodes.icon.d.ts +5 -0
  638. package/lib/components/Icon/streamline-icons/disc-nodes.icon.d.ts.map +1 -0
  639. package/lib/components/Icon/streamline-icons/disc-nodes.icon.js +7 -0
  640. package/lib/components/Icon/streamline-icons/disc-nodes.icon.js.map +1 -0
  641. package/lib/components/Icon/streamline-icons/doc-ai.icon.d.ts +5 -0
  642. package/lib/components/Icon/streamline-icons/doc-ai.icon.d.ts.map +1 -0
  643. package/lib/components/Icon/streamline-icons/doc-ai.icon.js +7 -0
  644. package/lib/components/Icon/streamline-icons/doc-ai.icon.js.map +1 -0
  645. package/lib/components/Icon/streamline-icons/document-json.icon.d.ts +5 -0
  646. package/lib/components/Icon/streamline-icons/document-json.icon.d.ts.map +1 -0
  647. package/lib/components/Icon/streamline-icons/document-json.icon.js +7 -0
  648. package/lib/components/Icon/streamline-icons/document-json.icon.js.map +1 -0
  649. package/lib/components/Icon/streamline-icons/exchange-case-user.icon.d.ts +5 -0
  650. package/lib/components/Icon/streamline-icons/exchange-case-user.icon.d.ts.map +1 -0
  651. package/lib/components/Icon/streamline-icons/exchange-case-user.icon.js +7 -0
  652. package/lib/components/Icon/streamline-icons/exchange-case-user.icon.js.map +1 -0
  653. package/lib/components/Icon/streamline-icons/exchange-cases.icon.d.ts +5 -0
  654. package/lib/components/Icon/streamline-icons/exchange-cases.icon.d.ts.map +1 -0
  655. package/lib/components/Icon/streamline-icons/exchange-cases.icon.js +7 -0
  656. package/lib/components/Icon/streamline-icons/exchange-cases.icon.js.map +1 -0
  657. package/lib/components/Icon/streamline-icons/factory.icon.d.ts +5 -0
  658. package/lib/components/Icon/streamline-icons/factory.icon.d.ts.map +1 -0
  659. package/lib/components/Icon/streamline-icons/factory.icon.js +7 -0
  660. package/lib/components/Icon/streamline-icons/factory.icon.js.map +1 -0
  661. package/lib/components/Icon/streamline-icons/fast-food.icon.d.ts +5 -0
  662. package/lib/components/Icon/streamline-icons/fast-food.icon.d.ts.map +1 -0
  663. package/lib/components/Icon/streamline-icons/fast-food.icon.js +7 -0
  664. package/lib/components/Icon/streamline-icons/fast-food.icon.js.map +1 -0
  665. package/lib/components/Icon/streamline-icons/field-cursor.icon.js +1 -1
  666. package/lib/components/Icon/streamline-icons/field-cursor.icon.js.map +1 -1
  667. package/lib/components/Icon/streamline-icons/field-group.icon.d.ts +5 -0
  668. package/lib/components/Icon/streamline-icons/field-group.icon.d.ts.map +1 -0
  669. package/lib/components/Icon/streamline-icons/field-group.icon.js +7 -0
  670. package/lib/components/Icon/streamline-icons/field-group.icon.js.map +1 -0
  671. package/lib/components/Icon/streamline-icons/gear-nodes.icon.d.ts +5 -0
  672. package/lib/components/Icon/streamline-icons/gear-nodes.icon.d.ts.map +1 -0
  673. package/lib/components/Icon/streamline-icons/gear-nodes.icon.js +7 -0
  674. package/lib/components/Icon/streamline-icons/gear-nodes.icon.js.map +1 -0
  675. package/lib/components/Icon/streamline-icons/heart-rate.icon.d.ts +5 -0
  676. package/lib/components/Icon/streamline-icons/heart-rate.icon.d.ts.map +1 -0
  677. package/lib/components/Icon/streamline-icons/heart-rate.icon.js +7 -0
  678. package/lib/components/Icon/streamline-icons/heart-rate.icon.js.map +1 -0
  679. package/lib/components/Icon/streamline-icons/hexagons.icon.d.ts +5 -0
  680. package/lib/components/Icon/streamline-icons/hexagons.icon.d.ts.map +1 -0
  681. package/lib/components/Icon/streamline-icons/hexagons.icon.js +7 -0
  682. package/lib/components/Icon/streamline-icons/hexagons.icon.js.map +1 -0
  683. package/lib/components/Icon/streamline-icons/language-pack.icon.d.ts +5 -0
  684. package/lib/components/Icon/streamline-icons/language-pack.icon.d.ts.map +1 -0
  685. package/lib/components/Icon/streamline-icons/language-pack.icon.js +7 -0
  686. package/lib/components/Icon/streamline-icons/language-pack.icon.js.map +1 -0
  687. package/lib/components/Icon/streamline-icons/layout.icon.d.ts +5 -0
  688. package/lib/components/Icon/streamline-icons/layout.icon.d.ts.map +1 -0
  689. package/lib/components/Icon/streamline-icons/layout.icon.js +7 -0
  690. package/lib/components/Icon/streamline-icons/layout.icon.js.map +1 -0
  691. package/lib/components/Icon/streamline-icons/mcp.icon.d.ts +5 -0
  692. package/lib/components/Icon/streamline-icons/mcp.icon.d.ts.map +1 -0
  693. package/lib/components/Icon/streamline-icons/mcp.icon.js +7 -0
  694. package/lib/components/Icon/streamline-icons/mcp.icon.js.map +1 -0
  695. package/lib/components/Icon/streamline-icons/motherboard.icon.d.ts +5 -0
  696. package/lib/components/Icon/streamline-icons/motherboard.icon.d.ts.map +1 -0
  697. package/lib/components/Icon/streamline-icons/motherboard.icon.js +7 -0
  698. package/lib/components/Icon/streamline-icons/motherboard.icon.js.map +1 -0
  699. package/lib/components/Icon/streamline-icons/oil-tower.icon.d.ts +5 -0
  700. package/lib/components/Icon/streamline-icons/oil-tower.icon.d.ts.map +1 -0
  701. package/lib/components/Icon/streamline-icons/oil-tower.icon.js +7 -0
  702. package/lib/components/Icon/streamline-icons/oil-tower.icon.js.map +1 -0
  703. package/lib/components/Icon/streamline-icons/phone-stethescope.icon.d.ts +5 -0
  704. package/lib/components/Icon/streamline-icons/phone-stethescope.icon.d.ts.map +1 -0
  705. package/lib/components/Icon/streamline-icons/phone-stethescope.icon.js +7 -0
  706. package/lib/components/Icon/streamline-icons/phone-stethescope.icon.js.map +1 -0
  707. package/lib/components/Icon/streamline-icons/piggybank.icon.d.ts +5 -0
  708. package/lib/components/Icon/streamline-icons/piggybank.icon.d.ts.map +1 -0
  709. package/lib/components/Icon/streamline-icons/piggybank.icon.js +7 -0
  710. package/lib/components/Icon/streamline-icons/piggybank.icon.js.map +1 -0
  711. package/lib/components/Icon/streamline-icons/plug-connect.icon.d.ts +5 -0
  712. package/lib/components/Icon/streamline-icons/plug-connect.icon.d.ts.map +1 -0
  713. package/lib/components/Icon/streamline-icons/plug-connect.icon.js +7 -0
  714. package/lib/components/Icon/streamline-icons/plug-connect.icon.js.map +1 -0
  715. package/lib/components/Icon/streamline-icons/prescription.icon.d.ts +5 -0
  716. package/lib/components/Icon/streamline-icons/prescription.icon.d.ts.map +1 -0
  717. package/lib/components/Icon/streamline-icons/prescription.icon.js +7 -0
  718. package/lib/components/Icon/streamline-icons/prescription.icon.js.map +1 -0
  719. package/lib/components/Icon/streamline-icons/preview-bottom.icon.d.ts +5 -0
  720. package/lib/components/Icon/streamline-icons/preview-bottom.icon.d.ts.map +1 -0
  721. package/lib/components/Icon/streamline-icons/preview-bottom.icon.js +7 -0
  722. package/lib/components/Icon/streamline-icons/preview-bottom.icon.js.map +1 -0
  723. package/lib/components/Icon/streamline-icons/preview-hide.icon.d.ts +5 -0
  724. package/lib/components/Icon/streamline-icons/preview-hide.icon.d.ts.map +1 -0
  725. package/lib/components/Icon/streamline-icons/preview-hide.icon.js +7 -0
  726. package/lib/components/Icon/streamline-icons/preview-hide.icon.js.map +1 -0
  727. package/lib/components/Icon/streamline-icons/preview-rtl.icon.d.ts +5 -0
  728. package/lib/components/Icon/streamline-icons/preview-rtl.icon.d.ts.map +1 -0
  729. package/lib/components/Icon/streamline-icons/preview-rtl.icon.js +7 -0
  730. package/lib/components/Icon/streamline-icons/preview-rtl.icon.js.map +1 -0
  731. package/lib/components/Icon/streamline-icons/preview.icon.d.ts +5 -0
  732. package/lib/components/Icon/streamline-icons/preview.icon.d.ts.map +1 -0
  733. package/lib/components/Icon/streamline-icons/preview.icon.js +7 -0
  734. package/lib/components/Icon/streamline-icons/preview.icon.js.map +1 -0
  735. package/lib/components/Icon/streamline-icons/return.icon.d.ts +5 -0
  736. package/lib/components/Icon/streamline-icons/return.icon.d.ts.map +1 -0
  737. package/lib/components/Icon/streamline-icons/return.icon.js +7 -0
  738. package/lib/components/Icon/streamline-icons/return.icon.js.map +1 -0
  739. package/lib/components/Icon/streamline-icons/robot-assembly.icon.d.ts +5 -0
  740. package/lib/components/Icon/streamline-icons/robot-assembly.icon.d.ts.map +1 -0
  741. package/lib/components/Icon/streamline-icons/robot-assembly.icon.js +7 -0
  742. package/lib/components/Icon/streamline-icons/robot-assembly.icon.js.map +1 -0
  743. package/lib/components/Icon/streamline-icons/scale-unequal.icon.d.ts +5 -0
  744. package/lib/components/Icon/streamline-icons/scale-unequal.icon.d.ts.map +1 -0
  745. package/lib/components/Icon/streamline-icons/scale-unequal.icon.js +7 -0
  746. package/lib/components/Icon/streamline-icons/scale-unequal.icon.js.map +1 -0
  747. package/lib/components/Icon/streamline-icons/selection-cursor.icon.d.ts +5 -0
  748. package/lib/components/Icon/streamline-icons/selection-cursor.icon.d.ts.map +1 -0
  749. package/lib/components/Icon/streamline-icons/selection-cursor.icon.js +7 -0
  750. package/lib/components/Icon/streamline-icons/selection-cursor.icon.js.map +1 -0
  751. package/lib/components/Icon/streamline-icons/send-solid.icon.d.ts +5 -0
  752. package/lib/components/Icon/streamline-icons/send-solid.icon.d.ts.map +1 -0
  753. package/lib/components/Icon/streamline-icons/send-solid.icon.js +7 -0
  754. package/lib/components/Icon/streamline-icons/send-solid.icon.js.map +1 -0
  755. package/lib/components/Icon/streamline-icons/sewing-machine.icon.d.ts +5 -0
  756. package/lib/components/Icon/streamline-icons/sewing-machine.icon.d.ts.map +1 -0
  757. package/lib/components/Icon/streamline-icons/sewing-machine.icon.js +7 -0
  758. package/lib/components/Icon/streamline-icons/sewing-machine.icon.js.map +1 -0
  759. package/lib/components/Icon/streamline-icons/shapes.icon.d.ts +5 -0
  760. package/lib/components/Icon/streamline-icons/shapes.icon.d.ts.map +1 -0
  761. package/lib/components/Icon/streamline-icons/shapes.icon.js +7 -0
  762. package/lib/components/Icon/streamline-icons/shapes.icon.js.map +1 -0
  763. package/lib/components/Icon/streamline-icons/share-case.icon.d.ts +5 -0
  764. package/lib/components/Icon/streamline-icons/share-case.icon.d.ts.map +1 -0
  765. package/lib/components/Icon/streamline-icons/share-case.icon.js +7 -0
  766. package/lib/components/Icon/streamline-icons/share-case.icon.js.map +1 -0
  767. package/lib/components/Icon/streamline-icons/share-document.icon.d.ts +5 -0
  768. package/lib/components/Icon/streamline-icons/share-document.icon.d.ts.map +1 -0
  769. package/lib/components/Icon/streamline-icons/share-document.icon.js +7 -0
  770. package/lib/components/Icon/streamline-icons/share-document.icon.js.map +1 -0
  771. package/lib/components/Icon/streamline-icons/shield-currency.icon.d.ts +5 -0
  772. package/lib/components/Icon/streamline-icons/shield-currency.icon.d.ts.map +1 -0
  773. package/lib/components/Icon/streamline-icons/shield-currency.icon.js +7 -0
  774. package/lib/components/Icon/streamline-icons/shield-currency.icon.js.map +1 -0
  775. package/lib/components/Icon/streamline-icons/shield-lock.icon.d.ts +5 -0
  776. package/lib/components/Icon/streamline-icons/shield-lock.icon.d.ts.map +1 -0
  777. package/lib/components/Icon/streamline-icons/shield-lock.icon.js +7 -0
  778. package/lib/components/Icon/streamline-icons/shield-lock.icon.js.map +1 -0
  779. package/lib/components/Icon/streamline-icons/table-disc.icon.d.ts +5 -0
  780. package/lib/components/Icon/streamline-icons/table-disc.icon.d.ts.map +1 -0
  781. package/lib/components/Icon/streamline-icons/table-disc.icon.js +7 -0
  782. package/lib/components/Icon/streamline-icons/table-disc.icon.js.map +1 -0
  783. package/lib/components/Icon/streamline-icons/tablet-rate.icon.d.ts +5 -0
  784. package/lib/components/Icon/streamline-icons/tablet-rate.icon.d.ts.map +1 -0
  785. package/lib/components/Icon/streamline-icons/tablet-rate.icon.js +7 -0
  786. package/lib/components/Icon/streamline-icons/tablet-rate.icon.js.map +1 -0
  787. package/lib/components/Icon/streamline-icons/ticket-movie.icon.d.ts +5 -0
  788. package/lib/components/Icon/streamline-icons/ticket-movie.icon.d.ts.map +1 -0
  789. package/lib/components/Icon/streamline-icons/ticket-movie.icon.js +7 -0
  790. package/lib/components/Icon/streamline-icons/ticket-movie.icon.js.map +1 -0
  791. package/lib/components/Icon/streamline-icons/train.icon.d.ts +5 -0
  792. package/lib/components/Icon/streamline-icons/train.icon.d.ts.map +1 -0
  793. package/lib/components/Icon/streamline-icons/train.icon.js +7 -0
  794. package/lib/components/Icon/streamline-icons/train.icon.js.map +1 -0
  795. package/lib/components/Icon/streamline-icons/translate.icon.d.ts +5 -0
  796. package/lib/components/Icon/streamline-icons/translate.icon.d.ts.map +1 -0
  797. package/lib/components/Icon/streamline-icons/translate.icon.js +7 -0
  798. package/lib/components/Icon/streamline-icons/translate.icon.js.map +1 -0
  799. package/lib/components/Icon/streamline-icons/truck-cargo.icon.d.ts +5 -0
  800. package/lib/components/Icon/streamline-icons/truck-cargo.icon.d.ts.map +1 -0
  801. package/lib/components/Icon/streamline-icons/truck-cargo.icon.js +7 -0
  802. package/lib/components/Icon/streamline-icons/truck-cargo.icon.js.map +1 -0
  803. package/lib/components/Icon/streamline-icons/truck-clock.icon.d.ts +5 -0
  804. package/lib/components/Icon/streamline-icons/truck-clock.icon.d.ts.map +1 -0
  805. package/lib/components/Icon/streamline-icons/truck-clock.icon.js +7 -0
  806. package/lib/components/Icon/streamline-icons/truck-clock.icon.js.map +1 -0
  807. package/lib/components/Icon/streamline-icons/truck.icon.d.ts +5 -0
  808. package/lib/components/Icon/streamline-icons/truck.icon.d.ts.map +1 -0
  809. package/lib/components/Icon/streamline-icons/truck.icon.js +7 -0
  810. package/lib/components/Icon/streamline-icons/truck.icon.js.map +1 -0
  811. package/lib/components/Icon/streamline-icons/user-laptop.icon.d.ts +5 -0
  812. package/lib/components/Icon/streamline-icons/user-laptop.icon.d.ts.map +1 -0
  813. package/lib/components/Icon/streamline-icons/user-laptop.icon.js +7 -0
  814. package/lib/components/Icon/streamline-icons/user-laptop.icon.js.map +1 -0
  815. package/lib/components/Icon/streamline-icons/user-plane.icon.d.ts +5 -0
  816. package/lib/components/Icon/streamline-icons/user-plane.icon.d.ts.map +1 -0
  817. package/lib/components/Icon/streamline-icons/user-plane.icon.js +7 -0
  818. package/lib/components/Icon/streamline-icons/user-plane.icon.js.map +1 -0
  819. package/lib/components/Icon/streamline-icons/user-polaris-solid.icon.d.ts +5 -0
  820. package/lib/components/Icon/streamline-icons/user-polaris-solid.icon.d.ts.map +1 -0
  821. package/lib/components/Icon/streamline-icons/user-polaris-solid.icon.js +7 -0
  822. package/lib/components/Icon/streamline-icons/user-polaris-solid.icon.js.map +1 -0
  823. package/lib/components/Icon/streamline-icons/veterinarian-dog.icon.d.ts +5 -0
  824. package/lib/components/Icon/streamline-icons/veterinarian-dog.icon.d.ts.map +1 -0
  825. package/lib/components/Icon/streamline-icons/veterinarian-dog.icon.js +7 -0
  826. package/lib/components/Icon/streamline-icons/veterinarian-dog.icon.js.map +1 -0
  827. package/lib/components/Icon/streamline-icons/video-player.icon.d.ts +5 -0
  828. package/lib/components/Icon/streamline-icons/video-player.icon.d.ts.map +1 -0
  829. package/lib/components/Icon/streamline-icons/video-player.icon.js +7 -0
  830. package/lib/components/Icon/streamline-icons/video-player.icon.js.map +1 -0
  831. package/lib/components/Icon/streamlineIconNames.d.ts +1 -1
  832. package/lib/components/Icon/streamlineIconNames.d.ts.map +1 -1
  833. package/lib/components/Icon/streamlineIconNames.js +63 -0
  834. package/lib/components/Icon/streamlineIconNames.js.map +1 -1
  835. package/lib/components/Image/Image.d.ts +1 -1
  836. package/lib/components/Image/Image.d.ts.map +1 -1
  837. package/lib/components/Image/Image.js +1 -0
  838. package/lib/components/Image/Image.js.map +1 -1
  839. package/lib/components/InlineEdit/InlineEdit.d.ts +26 -0
  840. package/lib/components/InlineEdit/InlineEdit.d.ts.map +1 -0
  841. package/lib/components/InlineEdit/InlineEdit.js +21 -0
  842. package/lib/components/InlineEdit/InlineEdit.js.map +1 -0
  843. package/lib/components/InlineEdit/InlineEdit.styles.d.ts +27 -0
  844. package/lib/components/InlineEdit/InlineEdit.styles.d.ts.map +1 -0
  845. package/lib/components/InlineEdit/InlineEdit.styles.js +49 -0
  846. package/lib/components/InlineEdit/InlineEdit.styles.js.map +1 -0
  847. package/lib/components/InlineEdit/InlineEdit.test-ids.d.ts +3 -0
  848. package/lib/components/InlineEdit/InlineEdit.test-ids.d.ts.map +1 -0
  849. package/lib/components/InlineEdit/InlineEdit.test-ids.js +4 -0
  850. package/lib/components/InlineEdit/InlineEdit.test-ids.js.map +1 -0
  851. package/lib/components/InlineEdit/index.d.ts +3 -0
  852. package/lib/components/InlineEdit/index.d.ts.map +1 -0
  853. package/lib/components/InlineEdit/index.js +2 -0
  854. package/lib/components/InlineEdit/index.js.map +1 -0
  855. package/lib/components/Input/Input.js +3 -3
  856. package/lib/components/Input/Input.js.map +1 -1
  857. package/lib/components/Input/Input.styles.d.ts +2 -2
  858. package/lib/components/Input/Input.styles.d.ts.map +1 -1
  859. package/lib/components/KeyboardCommands/KeyboardCommands.d.ts +6 -0
  860. package/lib/components/KeyboardCommands/KeyboardCommands.d.ts.map +1 -0
  861. package/lib/components/KeyboardCommands/KeyboardCommands.js +73 -0
  862. package/lib/components/KeyboardCommands/KeyboardCommands.js.map +1 -0
  863. package/lib/components/KeyboardCommands/index.d.ts +3 -0
  864. package/lib/components/KeyboardCommands/index.d.ts.map +1 -0
  865. package/lib/components/KeyboardCommands/index.js +3 -0
  866. package/lib/components/KeyboardCommands/index.js.map +1 -0
  867. package/lib/components/Label/Label.d.ts +4 -2
  868. package/lib/components/Label/Label.d.ts.map +1 -1
  869. package/lib/components/Label/Label.js +5 -1
  870. package/lib/components/Label/Label.js.map +1 -1
  871. package/lib/components/Lightbox/Lightbox.d.ts.map +1 -1
  872. package/lib/components/Lightbox/Lightbox.js +44 -20
  873. package/lib/components/Lightbox/Lightbox.js.map +1 -1
  874. package/lib/components/Lightbox/Lightbox.styles.d.ts +24 -11
  875. package/lib/components/Lightbox/Lightbox.styles.d.ts.map +1 -1
  876. package/lib/components/Lightbox/Lightbox.styles.js +33 -5
  877. package/lib/components/Lightbox/Lightbox.styles.js.map +1 -1
  878. package/lib/components/Lightbox/Lightbox.types.d.ts +13 -0
  879. package/lib/components/Lightbox/Lightbox.types.d.ts.map +1 -1
  880. package/lib/components/Lightbox/Lightbox.types.js.map +1 -1
  881. package/lib/components/Lightbox/index.d.ts +1 -1
  882. package/lib/components/Lightbox/index.d.ts.map +1 -1
  883. package/lib/components/Lightbox/index.js.map +1 -1
  884. package/lib/components/Link/Link.d.ts +17 -6
  885. package/lib/components/Link/Link.d.ts.map +1 -1
  886. package/lib/components/Link/Link.js +9 -7
  887. package/lib/components/Link/Link.js.map +1 -1
  888. package/lib/components/List/CommaSeparatedList.d.ts +2 -2
  889. package/lib/components/List/CommaSeparatedList.d.ts.map +1 -1
  890. package/lib/components/List/List.d.ts +3 -3
  891. package/lib/components/List/List.d.ts.map +1 -1
  892. package/lib/components/ListToolbar/ListToolbar.d.ts +1 -1
  893. package/lib/components/ListToolbar/ListToolbar.d.ts.map +1 -1
  894. package/lib/components/ListToolbar/ListToolbar.js +53 -81
  895. package/lib/components/ListToolbar/ListToolbar.js.map +1 -1
  896. package/lib/components/ListToolbar/ListToolbar.styles.d.ts +405 -15
  897. package/lib/components/ListToolbar/ListToolbar.styles.d.ts.map +1 -1
  898. package/lib/components/ListToolbar/ListToolbar.styles.js +58 -36
  899. package/lib/components/ListToolbar/ListToolbar.styles.js.map +1 -1
  900. package/lib/components/ListToolbar/ListToolbar.test-ids.d.ts +1 -1
  901. package/lib/components/ListToolbar/ListToolbar.test-ids.d.ts.map +1 -1
  902. package/lib/components/ListToolbar/ListToolbar.test-ids.js +0 -1
  903. package/lib/components/ListToolbar/ListToolbar.test-ids.js.map +1 -1
  904. package/lib/components/ListToolbar/ListToolbar.types.d.ts +9 -6
  905. package/lib/components/ListToolbar/ListToolbar.types.d.ts.map +1 -1
  906. package/lib/components/ListToolbar/ListToolbar.types.js.map +1 -1
  907. package/lib/components/LiveLog/LiveLog.js +2 -2
  908. package/lib/components/LiveLog/LiveLog.js.map +1 -1
  909. package/lib/components/LiveLog/LiveLog.styles.d.ts +1 -1
  910. package/lib/components/LiveLog/LiveLog.styles.d.ts.map +1 -1
  911. package/lib/components/LiveLog/LiveLog.types.d.ts +1 -1
  912. package/lib/components/LiveLog/LiveLog.types.js.map +1 -1
  913. package/lib/components/Location/GoogleMapsAPI.d.ts +4 -5
  914. package/lib/components/Location/GoogleMapsAPI.d.ts.map +1 -1
  915. package/lib/components/Location/GoogleMapsAPI.js +66 -69
  916. package/lib/components/Location/GoogleMapsAPI.js.map +1 -1
  917. package/lib/components/Location/LocationAPI.types.d.ts +2 -3
  918. package/lib/components/Location/LocationAPI.types.d.ts.map +1 -1
  919. package/lib/components/Location/LocationAPI.types.js.map +1 -1
  920. package/lib/components/Location/LocationInput.d.ts.map +1 -1
  921. package/lib/components/Location/LocationInput.js +72 -48
  922. package/lib/components/Location/LocationInput.js.map +1 -1
  923. package/lib/components/Location/LocationView.d.ts +2 -0
  924. package/lib/components/Location/LocationView.d.ts.map +1 -1
  925. package/lib/components/Location/LocationView.js +3 -3
  926. package/lib/components/Location/LocationView.js.map +1 -1
  927. package/lib/components/Location/LocationView.styles.d.ts +8 -6
  928. package/lib/components/Location/LocationView.styles.d.ts.map +1 -1
  929. package/lib/components/Mark/Mark.d.ts +5 -1
  930. package/lib/components/Mark/Mark.d.ts.map +1 -1
  931. package/lib/components/Mark/Mark.js +8 -7
  932. package/lib/components/Mark/Mark.js.map +1 -1
  933. package/lib/components/Menu/Menu.d.ts.map +1 -1
  934. package/lib/components/Menu/Menu.js +59 -7
  935. package/lib/components/Menu/Menu.js.map +1 -1
  936. package/lib/components/Menu/Menu.styles.d.ts +21 -15
  937. package/lib/components/Menu/Menu.styles.d.ts.map +1 -1
  938. package/lib/components/Menu/Menu.styles.js +138 -6
  939. package/lib/components/Menu/Menu.styles.js.map +1 -1
  940. package/lib/components/Menu/Menu.types.d.ts +10 -1
  941. package/lib/components/Menu/Menu.types.d.ts.map +1 -1
  942. package/lib/components/Menu/Menu.types.js.map +1 -1
  943. package/lib/components/Menu/MenuItem.d.ts.map +1 -1
  944. package/lib/components/Menu/MenuItem.js +19 -20
  945. package/lib/components/Menu/MenuItem.js.map +1 -1
  946. package/lib/components/MenuButton/MenuButton.d.ts +2 -6
  947. package/lib/components/MenuButton/MenuButton.d.ts.map +1 -1
  948. package/lib/components/MenuButton/MenuButton.js +64 -11
  949. package/lib/components/MenuButton/MenuButton.js.map +1 -1
  950. package/lib/components/MetaList/MetaList.d.ts +4 -4
  951. package/lib/components/MetaList/MetaList.d.ts.map +1 -1
  952. package/lib/components/Modal/Contexts.d.ts.map +1 -1
  953. package/lib/components/Modal/Contexts.js +2 -1
  954. package/lib/components/Modal/Contexts.js.map +1 -1
  955. package/lib/components/Modal/DockedModals.d.ts.map +1 -1
  956. package/lib/components/Modal/DockedModals.js +2 -1
  957. package/lib/components/Modal/DockedModals.js.map +1 -1
  958. package/lib/components/Modal/MinimizedModal.d.ts.map +1 -1
  959. package/lib/components/Modal/MinimizedModal.js +30 -8
  960. package/lib/components/Modal/MinimizedModal.js.map +1 -1
  961. package/lib/components/Modal/Modal.d.ts.map +1 -1
  962. package/lib/components/Modal/Modal.js +54 -17
  963. package/lib/components/Modal/Modal.js.map +1 -1
  964. package/lib/components/Modal/Modal.styles.d.ts +5 -6
  965. package/lib/components/Modal/Modal.styles.d.ts.map +1 -1
  966. package/lib/components/Modal/Modal.styles.js +66 -15
  967. package/lib/components/Modal/Modal.styles.js.map +1 -1
  968. package/lib/components/Modal/Modal.types.d.ts +19 -3
  969. package/lib/components/Modal/Modal.types.d.ts.map +1 -1
  970. package/lib/components/Modal/Modal.types.js.map +1 -1
  971. package/lib/components/Modal/ModalManager.d.ts.map +1 -1
  972. package/lib/components/Modal/ModalManager.js +28 -9
  973. package/lib/components/Modal/ModalManager.js.map +1 -1
  974. package/lib/components/Modal/useModalMove.d.ts +30 -0
  975. package/lib/components/Modal/useModalMove.d.ts.map +1 -0
  976. package/lib/components/Modal/useModalMove.js +148 -0
  977. package/lib/components/Modal/useModalMove.js.map +1 -0
  978. package/lib/components/MultiStepForm/FormProgress.styles.d.ts +208 -12
  979. package/lib/components/MultiStepForm/FormProgress.styles.d.ts.map +1 -1
  980. package/lib/components/MultiStepForm/FormProgress.styles.js +199 -69
  981. package/lib/components/MultiStepForm/FormProgress.styles.js.map +1 -1
  982. package/lib/components/MultiStepForm/HorizontalFormProgress.d.ts +2 -1
  983. package/lib/components/MultiStepForm/HorizontalFormProgress.d.ts.map +1 -1
  984. package/lib/components/MultiStepForm/HorizontalFormProgress.js +44 -25
  985. package/lib/components/MultiStepForm/HorizontalFormProgress.js.map +1 -1
  986. package/lib/components/MultiStepForm/MultiStepForm.d.ts +190 -5
  987. package/lib/components/MultiStepForm/MultiStepForm.d.ts.map +1 -1
  988. package/lib/components/MultiStepForm/MultiStepForm.js +40 -11
  989. package/lib/components/MultiStepForm/MultiStepForm.js.map +1 -1
  990. package/lib/components/MultiStepForm/MultiStepForm.types.d.ts +20 -6
  991. package/lib/components/MultiStepForm/MultiStepForm.types.d.ts.map +1 -1
  992. package/lib/components/MultiStepForm/MultiStepForm.types.js.map +1 -1
  993. package/lib/components/MultiStepForm/VerticalFormProgress.d.ts +1 -1
  994. package/lib/components/MultiStepForm/VerticalFormProgress.d.ts.map +1 -1
  995. package/lib/components/MultiStepForm/VerticalFormProgress.js +7 -4
  996. package/lib/components/MultiStepForm/VerticalFormProgress.js.map +1 -1
  997. package/lib/components/MultiStepForm/useFormProgressOverflow.d.ts +6 -0
  998. package/lib/components/MultiStepForm/useFormProgressOverflow.d.ts.map +1 -0
  999. package/lib/components/MultiStepForm/useFormProgressOverflow.js +35 -0
  1000. package/lib/components/MultiStepForm/useFormProgressOverflow.js.map +1 -0
  1001. package/lib/components/Number/NumberInput.d.ts.map +1 -1
  1002. package/lib/components/Number/NumberInput.js +1 -3
  1003. package/lib/components/Number/NumberInput.js.map +1 -1
  1004. package/lib/components/Number/NumberInput.styles.d.ts +8 -4
  1005. package/lib/components/Number/NumberInput.styles.d.ts.map +1 -1
  1006. package/lib/components/Number/NumberInput.types.d.ts +4 -0
  1007. package/lib/components/Number/NumberInput.types.d.ts.map +1 -1
  1008. package/lib/components/Number/NumberInput.types.js.map +1 -1
  1009. package/lib/components/Number/NumberRangeInput.d.ts.map +1 -1
  1010. package/lib/components/Number/NumberRangeInput.js +2 -5
  1011. package/lib/components/Number/NumberRangeInput.js.map +1 -1
  1012. package/lib/components/PageTemplates/CategorySubPage.styles.d.ts +22 -18
  1013. package/lib/components/PageTemplates/CategorySubPage.styles.d.ts.map +1 -1
  1014. package/lib/components/PageTemplates/CategorySubPage.styles.js +24 -5
  1015. package/lib/components/PageTemplates/CategorySubPage.styles.js.map +1 -1
  1016. package/lib/components/PageTemplates/DashboardPage.d.ts +12 -6
  1017. package/lib/components/PageTemplates/DashboardPage.d.ts.map +1 -1
  1018. package/lib/components/PageTemplates/DashboardPage.js +1 -1
  1019. package/lib/components/PageTemplates/DashboardPage.js.map +1 -1
  1020. package/lib/components/PageTemplates/GridLayout/EditorBackground.d.ts.map +1 -1
  1021. package/lib/components/PageTemplates/GridLayout/EditorBackground.js +1 -0
  1022. package/lib/components/PageTemplates/GridLayout/EditorBackground.js.map +1 -1
  1023. package/lib/components/PageTemplates/GridLayout/EditorGridItem.d.ts.map +1 -1
  1024. package/lib/components/PageTemplates/GridLayout/EditorGridItem.js +6 -0
  1025. package/lib/components/PageTemplates/GridLayout/EditorGridItem.js.map +1 -1
  1026. package/lib/components/PageTemplates/GridLayout/GridLayoutEditor.d.ts +6 -0
  1027. package/lib/components/PageTemplates/GridLayout/GridLayoutEditor.d.ts.map +1 -1
  1028. package/lib/components/PageTemplates/GridLayout/GridLayoutEditor.js +2 -2
  1029. package/lib/components/PageTemplates/GridLayout/GridLayoutEditor.js.map +1 -1
  1030. package/lib/components/PageTemplates/GridLayout/GridLayoutViewer.d.ts +6 -0
  1031. package/lib/components/PageTemplates/GridLayout/GridLayoutViewer.d.ts.map +1 -1
  1032. package/lib/components/PageTemplates/GridLayout/GridLayoutViewer.js +2 -2
  1033. package/lib/components/PageTemplates/GridLayout/GridLayoutViewer.js.map +1 -1
  1034. package/lib/components/PageTemplates/GridLayout/ReactGridLayoutStyles.d.ts +1 -1
  1035. package/lib/components/PageTemplates/GridLayout/ReactGridLayoutStyles.d.ts.map +1 -1
  1036. package/lib/components/PageTemplates/GridLayout/ReactResizableStyles.d.ts +1 -1
  1037. package/lib/components/PageTemplates/GridLayout/ReactResizableStyles.d.ts.map +1 -1
  1038. package/lib/components/PageTemplates/GridLayout/utils.d.ts +2 -1
  1039. package/lib/components/PageTemplates/GridLayout/utils.d.ts.map +1 -1
  1040. package/lib/components/PageTemplates/GridLayout/utils.js +4 -3
  1041. package/lib/components/PageTemplates/GridLayout/utils.js.map +1 -1
  1042. package/lib/components/PageTemplates/PageTemplates.d.ts +191 -9
  1043. package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
  1044. package/lib/components/PageTemplates/PageTemplates.js +31 -16
  1045. package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
  1046. package/lib/components/Phone/PhoneInput.d.ts +3 -0
  1047. package/lib/components/Phone/PhoneInput.d.ts.map +1 -1
  1048. package/lib/components/Phone/PhoneInput.js +8 -4
  1049. package/lib/components/Phone/PhoneInput.js.map +1 -1
  1050. package/lib/components/Phone/utils.d.ts +1 -1
  1051. package/lib/components/Phone/utils.d.ts.map +1 -1
  1052. package/lib/components/Phone/utils.js +5 -2
  1053. package/lib/components/Phone/utils.js.map +1 -1
  1054. package/lib/components/Popover/Popover.d.ts.map +1 -1
  1055. package/lib/components/Popover/Popover.js +18 -10
  1056. package/lib/components/Popover/Popover.js.map +1 -1
  1057. package/lib/components/Popover/Popover.styles.d.ts +3 -3
  1058. package/lib/components/Popover/Popover.styles.d.ts.map +1 -1
  1059. package/lib/components/Popover/Popover.styles.js +13 -9
  1060. package/lib/components/Popover/Popover.styles.js.map +1 -1
  1061. package/lib/components/Popover/modifiers.js +1 -1
  1062. package/lib/components/Popover/modifiers.js.map +1 -1
  1063. package/lib/components/Preview/Contexts.d.ts +5 -0
  1064. package/lib/components/Preview/Contexts.d.ts.map +1 -0
  1065. package/lib/components/Preview/Contexts.js +19 -0
  1066. package/lib/components/Preview/Contexts.js.map +1 -0
  1067. package/lib/components/Preview/Preview.types.d.ts +46 -0
  1068. package/lib/components/Preview/Preview.types.d.ts.map +1 -0
  1069. package/lib/components/Preview/Preview.types.js +2 -0
  1070. package/lib/components/Preview/Preview.types.js.map +1 -0
  1071. package/lib/components/Preview/PreviewManager.d.ts +11 -0
  1072. package/lib/components/Preview/PreviewManager.d.ts.map +1 -0
  1073. package/lib/components/Preview/PreviewManager.js +125 -0
  1074. package/lib/components/Preview/PreviewManager.js.map +1 -0
  1075. package/lib/components/Preview/PreviewPanel.d.ts +7 -0
  1076. package/lib/components/Preview/PreviewPanel.d.ts.map +1 -0
  1077. package/lib/components/Preview/PreviewPanel.js +110 -0
  1078. package/lib/components/Preview/PreviewPanel.js.map +1 -0
  1079. package/lib/components/Preview/PreviewPanel.test-ids.d.ts +2 -0
  1080. package/lib/components/Preview/PreviewPanel.test-ids.d.ts.map +1 -0
  1081. package/lib/components/Preview/PreviewPanel.test-ids.js +6 -0
  1082. package/lib/components/Preview/PreviewPanel.test-ids.js.map +1 -0
  1083. package/lib/components/Preview/index.d.ts +5 -0
  1084. package/lib/components/Preview/index.d.ts.map +1 -0
  1085. package/lib/components/Preview/index.js +4 -0
  1086. package/lib/components/Preview/index.js.map +1 -0
  1087. package/lib/components/Progress/Progress.js +1 -1
  1088. package/lib/components/Progress/Progress.js.map +1 -1
  1089. package/lib/components/Progress/Progress.styles.d.ts +199 -9
  1090. package/lib/components/Progress/Progress.styles.d.ts.map +1 -1
  1091. package/lib/components/Progress/Progress.styles.js +1 -1
  1092. package/lib/components/Progress/Progress.styles.js.map +1 -1
  1093. package/lib/components/QRCode/QRCode.d.ts +1 -1
  1094. package/lib/components/QRCode/QRCode.d.ts.map +1 -1
  1095. package/lib/components/RadioButton/RadioButton.test-ids.d.ts +1 -1
  1096. package/lib/components/RadioButton/RadioButton.test-ids.d.ts.map +1 -1
  1097. package/lib/components/RadioButton/RadioButtonCard.d.ts +11 -3
  1098. package/lib/components/RadioButton/RadioButtonCard.d.ts.map +1 -1
  1099. package/lib/components/RadioButton/RadioButtonCard.js +5 -22
  1100. package/lib/components/RadioButton/RadioButtonCard.js.map +1 -1
  1101. package/lib/components/RadioButtonGroup/RadioButtonGroup.d.ts +7 -0
  1102. package/lib/components/RadioButtonGroup/RadioButtonGroup.d.ts.map +1 -0
  1103. package/lib/components/RadioButtonGroup/RadioButtonGroup.js +10 -0
  1104. package/lib/components/RadioButtonGroup/RadioButtonGroup.js.map +1 -0
  1105. package/lib/components/RadioButtonGroup/index.d.ts +2 -1
  1106. package/lib/components/RadioButtonGroup/index.d.ts.map +1 -1
  1107. package/lib/components/RadioButtonGroup/index.js +1 -1
  1108. package/lib/components/RadioButtonGroup/index.js.map +1 -1
  1109. package/lib/components/RadioCheck/RadioCheck.d.ts +9 -4
  1110. package/lib/components/RadioCheck/RadioCheck.d.ts.map +1 -1
  1111. package/lib/components/RadioCheck/RadioCheck.js +97 -75
  1112. package/lib/components/RadioCheck/RadioCheck.js.map +1 -1
  1113. package/lib/components/RadioCheckGroup/RadioCheckGroup.d.ts +11 -5
  1114. package/lib/components/RadioCheckGroup/RadioCheckGroup.d.ts.map +1 -1
  1115. package/lib/components/RadioCheckGroup/RadioCheckGroup.js +70 -19
  1116. package/lib/components/RadioCheckGroup/RadioCheckGroup.js.map +1 -1
  1117. package/lib/components/Rating/Rating.d.ts +1 -1
  1118. package/lib/components/Rating/Rating.d.ts.map +1 -1
  1119. package/lib/components/ResponsiveActions/ResponsiveActions.d.ts +2 -2
  1120. package/lib/components/ResponsiveActions/ResponsiveActions.d.ts.map +1 -1
  1121. package/lib/components/ResponsiveActions/ResponsiveActions.js +12 -15
  1122. package/lib/components/ResponsiveActions/ResponsiveActions.js.map +1 -1
  1123. package/lib/components/SearchInput/SearchInput.d.ts +7 -7
  1124. package/lib/components/SearchInput/SearchInput.d.ts.map +1 -1
  1125. package/lib/components/SearchInput/SearchInput.js +41 -29
  1126. package/lib/components/SearchInput/SearchInput.js.map +1 -1
  1127. package/lib/components/SearchInput/SearchInput.styles.d.ts +21 -13
  1128. package/lib/components/SearchInput/SearchInput.styles.d.ts.map +1 -1
  1129. package/lib/components/SearchInput/SearchInput.styles.js +3 -5
  1130. package/lib/components/SearchInput/SearchInput.styles.js.map +1 -1
  1131. package/lib/components/Select/Select.d.ts +3 -3
  1132. package/lib/components/Select/Select.d.ts.map +1 -1
  1133. package/lib/components/Select/Select.js +14 -11
  1134. package/lib/components/Select/Select.js.map +1 -1
  1135. package/lib/components/SelectionCard/SelectionCard.d.ts +1 -1
  1136. package/lib/components/SelectionCard/SelectionCard.d.ts.map +1 -1
  1137. package/lib/components/SelectionCard/SelectionCard.js +50 -29
  1138. package/lib/components/SelectionCard/SelectionCard.js.map +1 -1
  1139. package/lib/components/SelectionCard/SelectionCard.styles.d.ts +36 -11
  1140. package/lib/components/SelectionCard/SelectionCard.styles.d.ts.map +1 -1
  1141. package/lib/components/SelectionCard/SelectionCard.styles.js +226 -62
  1142. package/lib/components/SelectionCard/SelectionCard.styles.js.map +1 -1
  1143. package/lib/components/SelectionCard/SelectionCard.test-ids.d.ts +2 -2
  1144. package/lib/components/SelectionCard/SelectionCard.test-ids.d.ts.map +1 -1
  1145. package/lib/components/SelectionCard/SelectionCard.test-ids.js +1 -1
  1146. package/lib/components/SelectionCard/SelectionCard.test-ids.js.map +1 -1
  1147. package/lib/components/SelectionCard/SelectionCard.types.d.ts +24 -6
  1148. package/lib/components/SelectionCard/SelectionCard.types.d.ts.map +1 -1
  1149. package/lib/components/SelectionCard/SelectionCard.types.js.map +1 -1
  1150. package/lib/components/SelectionCard/SelectionCardActions.d.ts +8 -0
  1151. package/lib/components/SelectionCard/SelectionCardActions.d.ts.map +1 -0
  1152. package/lib/components/SelectionCard/SelectionCardActions.js +48 -0
  1153. package/lib/components/SelectionCard/SelectionCardActions.js.map +1 -0
  1154. package/lib/components/SelectionCard/SelectionCardDisplay.d.ts +12 -4
  1155. package/lib/components/SelectionCard/SelectionCardDisplay.d.ts.map +1 -1
  1156. package/lib/components/SelectionCard/SelectionCardDisplay.js +6 -3
  1157. package/lib/components/SelectionCard/SelectionCardDisplay.js.map +1 -1
  1158. package/lib/components/SelectionCard/index.d.ts +1 -1
  1159. package/lib/components/SelectionCard/index.d.ts.map +1 -1
  1160. package/lib/components/SelectionCard/index.js.map +1 -1
  1161. package/lib/components/Sentiment/Sentiment.d.ts +1 -1
  1162. package/lib/components/Sentiment/Sentiment.d.ts.map +1 -1
  1163. package/lib/components/ShowMoreLess/ShowMoreLess.d.ts +3 -1
  1164. package/lib/components/ShowMoreLess/ShowMoreLess.d.ts.map +1 -1
  1165. package/lib/components/Skeleton/LineSkeleton.d.ts +1 -1
  1166. package/lib/components/Skeleton/LineSkeleton.d.ts.map +1 -1
  1167. package/lib/components/Skeleton/RectangleSkeleton.d.ts +1 -1
  1168. package/lib/components/Skeleton/RectangleSkeleton.d.ts.map +1 -1
  1169. package/lib/components/SkipLinks/SkipLinks.d.ts +0 -1
  1170. package/lib/components/SkipLinks/SkipLinks.d.ts.map +1 -1
  1171. package/lib/components/SkipLinks/SkipLinks.js +10 -53
  1172. package/lib/components/SkipLinks/SkipLinks.js.map +1 -1
  1173. package/lib/components/SkipLinks/SkipLinks.styles.d.ts +6 -0
  1174. package/lib/components/SkipLinks/SkipLinks.styles.d.ts.map +1 -0
  1175. package/lib/components/SkipLinks/SkipLinks.styles.js +61 -0
  1176. package/lib/components/SkipLinks/SkipLinks.styles.js.map +1 -0
  1177. package/lib/components/SkipLinks/index.d.ts +1 -1
  1178. package/lib/components/SkipLinks/index.d.ts.map +1 -1
  1179. package/lib/components/SkipLinks/index.js +1 -1
  1180. package/lib/components/SkipLinks/index.js.map +1 -1
  1181. package/lib/components/Slider/Slider.d.ts.map +1 -1
  1182. package/lib/components/Slider/Slider.js +18 -3
  1183. package/lib/components/Slider/Slider.js.map +1 -1
  1184. package/lib/components/Slider/Slider.styles.d.ts +15 -13
  1185. package/lib/components/Slider/Slider.styles.d.ts.map +1 -1
  1186. package/lib/components/Slider/Slider.styles.js +2 -2
  1187. package/lib/components/Slider/Slider.styles.js.map +1 -1
  1188. package/lib/components/SpeechToTextButton/SpeechToTextButton.d.ts +13 -0
  1189. package/lib/components/SpeechToTextButton/SpeechToTextButton.d.ts.map +1 -0
  1190. package/lib/components/SpeechToTextButton/SpeechToTextButton.js +29 -0
  1191. package/lib/components/SpeechToTextButton/SpeechToTextButton.js.map +1 -0
  1192. package/lib/components/SpeechToTextButton/SpeechToTextButton.test-ids.d.ts +2 -0
  1193. package/lib/components/SpeechToTextButton/SpeechToTextButton.test-ids.d.ts.map +1 -0
  1194. package/lib/components/SpeechToTextButton/SpeechToTextButton.test-ids.js +3 -0
  1195. package/lib/components/SpeechToTextButton/SpeechToTextButton.test-ids.js.map +1 -0
  1196. package/lib/components/SpeechToTextButton/index.d.ts +3 -0
  1197. package/lib/components/SpeechToTextButton/index.d.ts.map +1 -0
  1198. package/lib/components/SpeechToTextButton/index.js +2 -0
  1199. package/lib/components/SpeechToTextButton/index.js.map +1 -0
  1200. package/lib/components/SummaryItem/SummaryItem.d.ts +371 -7
  1201. package/lib/components/SummaryItem/SummaryItem.d.ts.map +1 -1
  1202. package/lib/components/SummaryItem/SummaryItem.js +3 -1
  1203. package/lib/components/SummaryItem/SummaryItem.js.map +1 -1
  1204. package/lib/components/SummaryList/SummaryList.d.ts +26 -8
  1205. package/lib/components/SummaryList/SummaryList.d.ts.map +1 -1
  1206. package/lib/components/SummaryList/SummaryList.js +54 -9
  1207. package/lib/components/SummaryList/SummaryList.js.map +1 -1
  1208. package/lib/components/SummaryList/ViewAll.d.ts +10 -4
  1209. package/lib/components/SummaryList/ViewAll.d.ts.map +1 -1
  1210. package/lib/components/SummaryList/ViewAll.js +23 -3
  1211. package/lib/components/SummaryList/ViewAll.js.map +1 -1
  1212. package/lib/components/SummaryList/index.d.ts +1 -0
  1213. package/lib/components/SummaryList/index.d.ts.map +1 -1
  1214. package/lib/components/SummaryList/index.js.map +1 -1
  1215. package/lib/components/Switch/Switch.d.ts +3 -3
  1216. package/lib/components/Switch/Switch.d.ts.map +1 -1
  1217. package/lib/components/Switch/Switch.js +14 -5
  1218. package/lib/components/Switch/Switch.js.map +1 -1
  1219. package/lib/components/Table/Table.d.ts +2 -1
  1220. package/lib/components/Table/Table.d.ts.map +1 -1
  1221. package/lib/components/Table/Table.js +1 -0
  1222. package/lib/components/Table/Table.js.map +1 -1
  1223. package/lib/components/Tabs/Tab.d.ts +3 -4
  1224. package/lib/components/Tabs/Tab.d.ts.map +1 -1
  1225. package/lib/components/Tabs/Tab.js +111 -106
  1226. package/lib/components/Tabs/Tab.js.map +1 -1
  1227. package/lib/components/Tabs/TabPanel.d.ts +184 -2
  1228. package/lib/components/Tabs/TabPanel.d.ts.map +1 -1
  1229. package/lib/components/Tabs/TabPanel.js +4 -2
  1230. package/lib/components/Tabs/TabPanel.js.map +1 -1
  1231. package/lib/components/Tabs/Tabs.d.ts.map +1 -1
  1232. package/lib/components/Tabs/Tabs.js +24 -1
  1233. package/lib/components/Tabs/Tabs.js.map +1 -1
  1234. package/lib/components/Tabs/Tabs.styles.d.ts +12 -10
  1235. package/lib/components/Tabs/Tabs.styles.d.ts.map +1 -1
  1236. package/lib/components/Tabs/Tabs.styles.js +126 -11
  1237. package/lib/components/Tabs/Tabs.styles.js.map +1 -1
  1238. package/lib/components/Text/Text.d.ts +1 -1
  1239. package/lib/components/Text/Text.d.ts.map +1 -1
  1240. package/lib/components/TextArea/TextArea.d.ts +3 -1
  1241. package/lib/components/TextArea/TextArea.d.ts.map +1 -1
  1242. package/lib/components/TextArea/TextArea.js +95 -28
  1243. package/lib/components/TextArea/TextArea.js.map +1 -1
  1244. package/lib/components/TextArea/TextArea.styles.d.ts +3 -2
  1245. package/lib/components/TextArea/TextArea.styles.d.ts.map +1 -1
  1246. package/lib/components/TextArea/TextArea.styles.js +2 -0
  1247. package/lib/components/TextArea/TextArea.styles.js.map +1 -1
  1248. package/lib/components/Toaster/Toaster.d.ts +1 -1
  1249. package/lib/components/Toaster/Toaster.d.ts.map +1 -1
  1250. package/lib/components/Toaster/Toaster.js +5 -5
  1251. package/lib/components/Toaster/Toaster.js.map +1 -1
  1252. package/lib/components/Toaster/Toaster.types.d.ts +0 -13
  1253. package/lib/components/Toaster/Toaster.types.d.ts.map +1 -1
  1254. package/lib/components/Toaster/Toaster.types.js.map +1 -1
  1255. package/lib/components/Tooltip/Tooltip.d.ts +1 -1
  1256. package/lib/components/Tooltip/Tooltip.d.ts.map +1 -1
  1257. package/lib/components/Tooltip/Tooltip.js +5 -0
  1258. package/lib/components/Tooltip/Tooltip.js.map +1 -1
  1259. package/lib/components/Tree/StandardTree.d.ts.map +1 -1
  1260. package/lib/components/Tree/StandardTree.js +4 -3
  1261. package/lib/components/Tree/StandardTree.js.map +1 -1
  1262. package/lib/components/Tree/StandardTree.styles.d.ts +20 -16
  1263. package/lib/components/Tree/StandardTree.styles.d.ts.map +1 -1
  1264. package/lib/components/Tree/StandardTree.styles.js +11 -10
  1265. package/lib/components/Tree/StandardTree.styles.js.map +1 -1
  1266. package/lib/components/Tree/StandardTree.types.d.ts +2 -2
  1267. package/lib/components/Tree/StandardTree.types.d.ts.map +1 -1
  1268. package/lib/components/Tree/StandardTree.types.js.map +1 -1
  1269. package/lib/components/Tree/Tree.d.ts +2 -2
  1270. package/lib/components/Tree/Tree.d.ts.map +1 -1
  1271. package/lib/components/VisuallyHiddenText/VisuallyHiddenText.d.ts +1 -1
  1272. package/lib/components/VisuallyHiddenText/VisuallyHiddenText.d.ts.map +1 -1
  1273. package/lib/hooks/index.d.ts +5 -0
  1274. package/lib/hooks/index.d.ts.map +1 -1
  1275. package/lib/hooks/index.js +5 -0
  1276. package/lib/hooks/index.js.map +1 -1
  1277. package/lib/hooks/useActiveDescendant.d.ts +6 -1
  1278. package/lib/hooks/useActiveDescendant.d.ts.map +1 -1
  1279. package/lib/hooks/useActiveDescendant.js +5 -5
  1280. package/lib/hooks/useActiveDescendant.js.map +1 -1
  1281. package/lib/hooks/useAnimatedText.d.ts +3 -1
  1282. package/lib/hooks/useAnimatedText.d.ts.map +1 -1
  1283. package/lib/hooks/useAnimatedText.js +66 -46
  1284. package/lib/hooks/useAnimatedText.js.map +1 -1
  1285. package/lib/hooks/useArrows.d.ts +27 -7
  1286. package/lib/hooks/useArrows.d.ts.map +1 -1
  1287. package/lib/hooks/useArrows.js +50 -26
  1288. package/lib/hooks/useArrows.js.map +1 -1
  1289. package/lib/hooks/useContentTabIndex.d.ts +17 -0
  1290. package/lib/hooks/useContentTabIndex.d.ts.map +1 -0
  1291. package/lib/hooks/useContentTabIndex.js +48 -0
  1292. package/lib/hooks/useContentTabIndex.js.map +1 -0
  1293. package/lib/hooks/useFocusTrap.d.ts.map +1 -1
  1294. package/lib/hooks/useFocusTrap.js +1 -0
  1295. package/lib/hooks/useFocusTrap.js.map +1 -1
  1296. package/lib/hooks/useFocusWithin.d.ts.map +1 -1
  1297. package/lib/hooks/useFocusWithin.js +11 -6
  1298. package/lib/hooks/useFocusWithin.js.map +1 -1
  1299. package/lib/hooks/useHighlight.d.ts +12 -0
  1300. package/lib/hooks/useHighlight.d.ts.map +1 -0
  1301. package/lib/hooks/useHighlight.js +55 -0
  1302. package/lib/hooks/useHighlight.js.map +1 -0
  1303. package/lib/hooks/useI18n.d.ts +331 -16
  1304. package/lib/hooks/useI18n.d.ts.map +1 -1
  1305. package/lib/hooks/useOS.d.ts +1 -1
  1306. package/lib/hooks/usePreviewContext.d.ts +7 -0
  1307. package/lib/hooks/usePreviewContext.d.ts.map +1 -0
  1308. package/lib/hooks/usePreviewContext.js +12 -0
  1309. package/lib/hooks/usePreviewContext.js.map +1 -0
  1310. package/lib/hooks/usePreviewManager.d.ts +8 -0
  1311. package/lib/hooks/usePreviewManager.d.ts.map +1 -0
  1312. package/lib/hooks/usePreviewManager.js +16 -0
  1313. package/lib/hooks/usePreviewManager.js.map +1 -0
  1314. package/lib/hooks/useScrollStick.js +1 -1
  1315. package/lib/hooks/useScrollStick.js.map +1 -1
  1316. package/lib/hooks/useSpeechRecognition.d.ts +21 -0
  1317. package/lib/hooks/useSpeechRecognition.d.ts.map +1 -0
  1318. package/lib/hooks/useSpeechRecognition.js +123 -0
  1319. package/lib/hooks/useSpeechRecognition.js.map +1 -0
  1320. package/lib/hooks/useThemeMode.d.ts +10 -0
  1321. package/lib/hooks/useThemeMode.d.ts.map +1 -0
  1322. package/lib/hooks/useThemeMode.js +11 -0
  1323. package/lib/hooks/useThemeMode.js.map +1 -0
  1324. package/lib/hooks/useTransitionState.d.ts +3 -2
  1325. package/lib/hooks/useTransitionState.d.ts.map +1 -1
  1326. package/lib/hooks/useTransitionState.js.map +1 -1
  1327. package/lib/i18n/default.d.ts +340 -17
  1328. package/lib/i18n/default.d.ts.map +1 -1
  1329. package/lib/i18n/default.js +379 -36
  1330. package/lib/i18n/default.js.map +1 -1
  1331. package/lib/i18n/i18n.d.ts +331 -16
  1332. package/lib/i18n/i18n.d.ts.map +1 -1
  1333. package/lib/i18n/translate.d.ts +0 -1
  1334. package/lib/i18n/translate.d.ts.map +1 -1
  1335. package/lib/i18n/translate.js +0 -1
  1336. package/lib/i18n/translate.js.map +1 -1
  1337. package/lib/index.d.ts +13 -0
  1338. package/lib/index.d.ts.map +1 -1
  1339. package/lib/index.js +13 -0
  1340. package/lib/index.js.map +1 -1
  1341. package/lib/styles/GlobalStyle.d.ts +3 -3
  1342. package/lib/styles/GlobalStyle.d.ts.map +1 -1
  1343. package/lib/styles/GlobalStyle.js +22 -4
  1344. package/lib/styles/GlobalStyle.js.map +1 -1
  1345. package/lib/styles/animations.d.ts +8 -8
  1346. package/lib/styles/animations.d.ts.map +1 -1
  1347. package/lib/styles/animations.js +71 -53
  1348. package/lib/styles/animations.js.map +1 -1
  1349. package/lib/styles/constants.d.ts +4 -0
  1350. package/lib/styles/constants.d.ts.map +1 -1
  1351. package/lib/styles/constants.js +12 -0
  1352. package/lib/styles/constants.js.map +1 -1
  1353. package/lib/styles/mixins.d.ts +3 -3
  1354. package/lib/styles/mixins.d.ts.map +1 -1
  1355. package/lib/styles/utils.d.ts +35 -4
  1356. package/lib/styles/utils.d.ts.map +1 -1
  1357. package/lib/styles/utils.js +93 -11
  1358. package/lib/styles/utils.js.map +1 -1
  1359. package/lib/theme/index.d.ts +4 -0
  1360. package/lib/theme/index.d.ts.map +1 -1
  1361. package/lib/theme/index.js +4 -0
  1362. package/lib/theme/index.js.map +1 -1
  1363. package/lib/theme/theme.d.ts +348 -0
  1364. package/lib/theme/theme.d.ts.map +1 -1
  1365. package/lib/theme/themeDefinition.json +212 -4
  1366. package/lib/theme/themeOverrides.schema.json +346 -170
  1367. package/lib/theme/themes/andromeda2025Theme.json +2 -2
  1368. package/lib/theme/themes/aries2023DarkTheme.json +22 -0
  1369. package/lib/theme/themes/bootes2025DarkTheme.json +32 -1
  1370. package/lib/theme/themes/bootes2025Theme.json +11 -2
  1371. package/lib/theme/themes/darkTheme.json +22 -0
  1372. package/lib/theme/themes/orionDarkTheme.json +175 -0
  1373. package/lib/theme/themes/orionTheme.json +155 -0
  1374. package/lib/theme/themes/studioDarkTheme.json +25 -7
  1375. package/lib/theme/themes/studioTheme.json +37 -19
  1376. package/lib/theme/themes/virgoDarkTheme.json +206 -0
  1377. package/lib/theme/themes/virgoTheme.json +166 -0
  1378. package/lib/utils/focusHeadingOrContainer.d.ts.map +1 -1
  1379. package/lib/utils/focusHeadingOrContainer.js +2 -17
  1380. package/lib/utils/focusHeadingOrContainer.js.map +1 -1
  1381. package/lib/utils/focusNonInteractiveElement.d.ts +1 -1
  1382. package/lib/utils/focusNonInteractiveElement.d.ts.map +1 -1
  1383. package/lib/utils/focusNonInteractiveElement.js.map +1 -1
  1384. package/lib/utils/formatListToLocaleString.d.ts +0 -1
  1385. package/lib/utils/formatListToLocaleString.d.ts.map +1 -1
  1386. package/lib/utils/formatListToLocaleString.js +0 -1
  1387. package/lib/utils/formatListToLocaleString.js.map +1 -1
  1388. package/lib/utils/getAllPopovers.d.ts.map +1 -1
  1389. package/lib/utils/getAllPopovers.js +2 -1
  1390. package/lib/utils/getAllPopovers.js.map +1 -1
  1391. package/lib/utils/getEffectiveRect.d.ts +13 -0
  1392. package/lib/utils/getEffectiveRect.d.ts.map +1 -0
  1393. package/lib/utils/getEffectiveRect.js +93 -0
  1394. package/lib/utils/getEffectiveRect.js.map +1 -0
  1395. package/lib/utils/getFocusables.d.ts.map +1 -1
  1396. package/lib/utils/getFocusables.js +2 -1
  1397. package/lib/utils/getFocusables.js.map +1 -1
  1398. package/lib/utils/getParentWindow.d.ts +3 -0
  1399. package/lib/utils/getParentWindow.d.ts.map +1 -0
  1400. package/lib/utils/getParentWindow.js +12 -0
  1401. package/lib/utils/getParentWindow.js.map +1 -0
  1402. package/lib/utils/handleLinkClick.d.ts +33 -0
  1403. package/lib/utils/handleLinkClick.d.ts.map +1 -0
  1404. package/lib/utils/handleLinkClick.js +41 -0
  1405. package/lib/utils/handleLinkClick.js.map +1 -0
  1406. package/lib/utils/index.d.ts +3 -0
  1407. package/lib/utils/index.d.ts.map +1 -1
  1408. package/lib/utils/index.js +3 -0
  1409. package/lib/utils/index.js.map +1 -1
  1410. package/lib/utils/markdownTokenizer.d.ts +4 -1
  1411. package/lib/utils/markdownTokenizer.d.ts.map +1 -1
  1412. package/lib/utils/markdownTokenizer.js +46 -13
  1413. package/lib/utils/markdownTokenizer.js.map +1 -1
  1414. package/package.json +6 -5
@@ -1 +1 @@
1
- {"version":3,"file":"LocationInput.js","sourceRoot":"","sources":["../../../src/components/Location/LocationInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjF,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,QAAQ,MAAM,aAAa,CAAC;AAEnC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACtE,OA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AK,CAAC,CAAC,CAAC,CACb,KAAC,SAAS,IACR,MAAM,EAAE,OAAO,EACf,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,WAAW,EACxB,EAAE,EAAE,EAAE,EACN,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,GAAG,EACR,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,cAAc,EAAE,cAAc,YAE7B,IAAI,GACK,CACb,CAAC,CAAC,CAAC,CACF,IAAI,CACL,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC,aAAa,EAAE,uBAAuB,CAAC,CAAC","sourcesContent":["import { forwardRef, useCallback, useContext, useEffect, useState } from 'react';\nimport type { ChangeEvent, FC, PropsWithoutRef, Ref } from 'react';\nimport styled from 'styled-components';\n\nimport ComboBox from '../ComboBox';\nimport type { MenuItemProps, MenuProps } from '../Menu';\nimport { useI18n, useTestIds, useUID } from '../../hooks';\nimport { createUID, withTestIds, createClassName } from '../../utils';\nimport FormField from '../FormField';\nimport type { FormControlProps } from '../FormControl';\nimport type { BaseProps, ForwardProps, TestIdProp } from '../../types';\nimport Flex from '../Flex';\nimport { defaultThemeProp } from '../../theme';\n\nimport PoweredByGoogleImage from './PoweredByGoogleImage';\nimport CurrentLocationButton from './CurrentLocationButton';\nimport MapsContext from './MapsContext';\nimport { getNavigatorPosition, isValueACoordinate, loadMapsAPI } from './utils';\nimport type { Bias, LatLng } from './Location.types';\nimport LocationView from './LocationView';\nimport { StyledLocationView } from './LocationView.styles';\nimport type { LocationViewProps } from './LocationView';\nimport { getLocationInputTestIds } from './Location.test-ids';\n\nexport interface LocationInputProps extends BaseProps, FormControlProps, TestIdProp {\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 /** 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 * Only select coordinates on map clicks.\n * @default false\n */\n onlyCoordinates?: boolean;\n /** Biasing query results towards user location/preference. */\n bias?: Bias;\n /**\n * Set to true renders the map view below input.\n * @default false\n */\n map?: {\n /** Location coordinates used for the map view. */\n location?: LatLng;\n height: LocationViewProps['height'];\n zoomLevel?: LocationViewProps['zoomLevel'];\n onClick?: LocationViewProps['onClick'];\n };\n /** Callback fired when an error occurs. This function gets called with one argument of type Error. */\n onError?: (error: Error) => void;\n}\n\nconst StyledLocationInput = styled(ComboBox)`\n z-index: 1;\n`;\n\nStyledLocationInput.defaultProps = defaultThemeProp;\n\nconst StyledLocationMap = styled.div`\n ${StyledLocationView} {\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n }\n`;\n\nStyledLocationMap.defaultProps = defaultThemeProp;\n\nconst LocationInput: FC<LocationInputProps & ForwardProps> = forwardRef(function LocationInput(\n props: PropsWithoutRef<LocationInputProps>,\n ref: Ref<HTMLInputElement>\n) {\n const uid = useUID();\n const {\n testId,\n label,\n labelHidden,\n id = uid,\n value = '',\n info,\n status,\n required,\n readOnly,\n disabled,\n additionalInfo,\n onSelect,\n onError,\n onChange,\n onBlur,\n bias,\n defaultToCurrentLocation,\n onlyCoordinates = false,\n map,\n className,\n ...restProps\n } = props;\n\n const testIds = useTestIds(testId, getLocationInputTestIds);\n\n const { name, ...providerOpts } = useContext(MapsContext);\n const t = useI18n();\n const [placePredictionMenuItems, setPlacePredictionMenuItems] = useState<MenuProps['items']>([]);\n const [filterValue, setFilterValue] = useState('');\n const [mapLoading, setMapLoading] = useState(false);\n\n useEffect(() => {\n (async () => {\n if (defaultToCurrentLocation) {\n setMapLoading(true);\n const mapAPIObj = await loadMapsAPI(name, providerOpts);\n\n const navigatorPosition = await getNavigatorPosition();\n const currentLocationAddress = await mapAPIObj.getAddress(navigatorPosition);\n setMapLoading(false);\n onSelect?.(currentLocationAddress);\n }\n })();\n }, []);\n\n useEffect(() => {\n (async () => {\n try {\n const mapAPIObj = await loadMapsAPI(name, providerOpts);\n\n if (filterValue) {\n if (onlyCoordinates) {\n const { latitude, longitude } = await mapAPIObj.getCoords(filterValue);\n setPlacePredictionMenuItems([\n {\n primary: t('exact_location'),\n secondary: [`${latitude}, ${longitude}`],\n id: createUID(),\n onClick: () => {\n setFilterValue('');\n onSelect?.({ latitude, longitude });\n }\n }\n ]);\n } else {\n if (isValueACoordinate(filterValue)) {\n const { latitude, longitude } = await mapAPIObj.getCoords(filterValue);\n const { name: addressName, address } = await mapAPIObj.getAddress({\n latitude,\n longitude\n });\n const menuItems = [\n {\n primary: t('exact_location'),\n secondary: [`${latitude}, ${longitude}`],\n id: createUID(),\n onClick: () => {\n setFilterValue('');\n onSelect?.({\n latitude,\n longitude\n });\n }\n },\n {\n primary: addressName,\n secondary: [address],\n id: createUID(),\n onClick: () => {\n setFilterValue('');\n onSelect?.({ name: addressName, address, latitude, longitude });\n }\n }\n ];\n\n setPlacePredictionMenuItems(menuItems);\n return;\n }\n const { placeSuggestions, token } = await mapAPIObj.getPlacePredictions(\n filterValue,\n bias\n );\n if (placeSuggestions.length === 1) {\n const exactLocation = await mapAPIObj.getPlaceById(\n placeSuggestions[0].placeId,\n token\n );\n const menuItems = placeSuggestions.map(item => ({\n id: item.placeId,\n primary: item.mainText,\n secondary: [item.secondaryText],\n onClick: (menuItemId: MenuItemProps['id']) => {\n mapAPIObj.getPlaceById(menuItemId, token).then(menuItemLocation => {\n setFilterValue('');\n onSelect?.(menuItemLocation);\n });\n }\n }));\n if (exactLocation) {\n menuItems.push({\n primary: t('exact_location'),\n secondary: [`${exactLocation.latitude}, ${exactLocation.longitude}`],\n id: createUID(),\n onClick: () => {\n setFilterValue('');\n onSelect?.({\n latitude: exactLocation.latitude,\n longitude: exactLocation.longitude\n });\n }\n });\n }\n setPlacePredictionMenuItems(menuItems);\n } else {\n setPlacePredictionMenuItems(\n placeSuggestions.map(item => ({\n id: item.placeId,\n primary: item.mainText,\n secondary: [item.secondaryText],\n onClick: (menuItemId: MenuItemProps['id']) => {\n mapAPIObj.getPlaceById(menuItemId, token).then(menuItemLocation => {\n setFilterValue('');\n onSelect?.(menuItemLocation);\n });\n }\n }))\n );\n }\n }\n } else {\n setPlacePredictionMenuItems([]);\n }\n } catch (e: any) {\n setPlacePredictionMenuItems([]);\n onError?.(e);\n }\n })();\n }, [filterValue, bias, onError, onSelect, onlyCoordinates]);\n\n const onInputChange = useCallback(\n (e: ChangeEvent<HTMLInputElement>) => {\n setFilterValue(e.target.value.trim());\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 if (readOnly) return;\n\n if (onlyCoordinates) {\n const coords = {\n latitude: placeInfo.latitude,\n longitude: placeInfo.longitude\n };\n onSelect?.(coords);\n map?.onClick?.(coords);\n } else {\n onSelect?.(placeInfo);\n map?.onClick?.(placeInfo);\n }\n },\n [readOnly, onSelect, map?.onClick, onlyCoordinates]\n );\n\n const Comp = (\n <>\n <StyledLocationInput\n id={id}\n info={info}\n data-testid={testIds.control}\n placeholder={t('location_input_placeholder')}\n menu={\n filterValue\n ? {\n items: placePredictionMenuItems.concat([\n {\n id: createUID(),\n primary: t('use_input_value', [filterValue]),\n onClick: () => {\n setFilterValue('');\n onSelect?.({ name: filterValue });\n }\n }\n ]),\n emptyText: t('location_not_found_text'),\n mode: 'action',\n footer: !map && (\n <Flex container={{ justify: 'end' }}>\n <PoweredByGoogleImage />\n </Flex>\n )\n }\n : undefined\n }\n actions={\n !disabled &&\n !readOnly && (\n <CurrentLocationButton\n onError={onError}\n onResolve={resolved => {\n if (onlyCoordinates) {\n onSelect?.({ latitude: resolved.latitude, longitude: resolved.longitude });\n } else {\n onSelect?.(resolved);\n }\n }}\n />\n )\n }\n onChange={onInputChange}\n onBlur={() => {\n setFilterValue('');\n onBlur?.(value);\n }}\n value={value}\n required={required}\n disabled={disabled}\n readOnly={readOnly}\n status={status}\n {...restProps}\n className={createClassName('location-input', className, { status })}\n />\n {map && (\n <StyledLocationMap>\n <LocationView\n {...map}\n pins={map.location ? [{ ...map.location }] : []}\n onClick={onMapClick}\n onError={onError}\n disabled={disabled}\n loading={mapLoading}\n centerMapOnChange\n />\n </StyledLocationMap>\n )}\n </>\n );\n\n return label ? (\n <FormField\n testId={testIds}\n label={label}\n labelHidden={labelHidden}\n id={id}\n info={info}\n readOnly={readOnly}\n status={status}\n ref={ref}\n required={required}\n disabled={disabled}\n additionalInfo={additionalInfo}\n >\n {Comp}\n </FormField>\n ) : (\n Comp\n );\n});\n\nexport default withTestIds(LocationInput, getLocationInputTestIds);\n"]}
1
+ {"version":3,"file":"LocationInput.js","sourceRoot":"","sources":["../../../src/components/Location/LocationInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzF,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,QAAQ,MAAM,aAAa,CAAC;AAEnC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,SAAS,MAAM,cAAc,CAAC;AAGrC,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE/C,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAC1D,OAAO,qBAAqB,MAAM,yBAAyB,CAAC;AAC5D,OAAO,WAAW,MAAM,eAAe,CAA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ACF,IAAI,CACL,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC,aAAa,EAAE,uBAAuB,CAAC,CAAC","sourcesContent":["import { forwardRef, useCallback, useContext, useEffect, useRef, useState } from 'react';\nimport type { ChangeEvent, FC, PropsWithoutRef, Ref } from 'react';\nimport styled from 'styled-components';\n\nimport ComboBox from '../ComboBox';\nimport type { MenuItemProps, MenuProps } from '../Menu';\nimport { useI18n, useTestIds, useUID } from '../../hooks';\nimport { createUID, withTestIds, createClassName } from '../../utils';\nimport FormField from '../FormField';\nimport type { FormControlProps } from '../FormControl';\nimport type { BaseProps, ForwardProps, TestIdProp } from '../../types';\nimport Flex from '../Flex';\nimport { defaultThemeProp } from '../../theme';\n\nimport PoweredByGoogleImage from './PoweredByGoogleImage';\nimport CurrentLocationButton from './CurrentLocationButton';\nimport MapsContext from './MapsContext';\nimport { getNavigatorPosition, isValueACoordinate, loadMapsAPI } from './utils';\nimport type { Bias, LatLng } from './Location.types';\nimport LocationView from './LocationView';\nimport { StyledLocationView } from './LocationView.styles';\nimport type { LocationViewProps } from './LocationView';\nimport { getLocationInputTestIds } from './Location.test-ids';\n\n// Session token timeout in milliseconds for single user interaction.\nconst sessionTokenTimeout = 120_000;\n\nexport interface LocationInputProps extends BaseProps, FormControlProps, TestIdProp {\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 /** 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 * Only select coordinates on map clicks.\n * @default false\n */\n onlyCoordinates?: boolean;\n /** Biasing query results towards user location/preference. */\n bias?: Bias;\n /**\n * Set to true renders the map view below input.\n * @default false\n */\n map?: {\n /** Location coordinates used for the map view. */\n location?: LatLng;\n height: LocationViewProps['height'];\n zoomLevel?: LocationViewProps['zoomLevel'];\n onClick?: LocationViewProps['onClick'];\n };\n /** Callback fired when an error occurs. This function gets called with one argument of type Error. */\n onError?: (error: Error) => void;\n}\n\nconst StyledLocationInput = styled(ComboBox)`\n z-index: 1;\n`;\n\nStyledLocationInput.defaultProps = defaultThemeProp;\n\nconst StyledLocationMap = styled.div`\n ${StyledLocationView} {\n border-top-left-radius: 0;\n border-top-right-radius: 0;\n }\n`;\n\nStyledLocationMap.defaultProps = defaultThemeProp;\n\nconst LocationInput: FC<LocationInputProps & ForwardProps> = forwardRef(function LocationInput(\n props: PropsWithoutRef<LocationInputProps>,\n ref: Ref<HTMLInputElement>\n) {\n const uid = useUID();\n const {\n testId,\n label,\n labelHidden,\n id = uid,\n value = '',\n info,\n status,\n required,\n readOnly,\n disabled,\n additionalInfo,\n onSelect,\n onError,\n onChange,\n onBlur,\n bias,\n defaultToCurrentLocation,\n onlyCoordinates = false,\n map,\n className,\n ...restProps\n } = props;\n\n const testIds = useTestIds(testId, getLocationInputTestIds);\n\n const { name, ...providerOpts } = useContext(MapsContext);\n const t = useI18n();\n const [placePredictionMenuItems, setPlacePredictionMenuItems] = useState<MenuProps['items']>([]);\n const [filterValue, setFilterValue] = useState('');\n const [debouncedFilterValue, setDebouncedFilterValue] = useState('');\n const [mapLoading, setMapLoading] = useState(false);\n const sessionTokenRef = useRef<google.maps.places.AutocompleteSessionToken | undefined>();\n const interactionTimerRef = useRef<number | undefined>();\n\n const clearInteractionTimer = useCallback(() => {\n if (interactionTimerRef.current !== undefined) {\n window.clearTimeout(interactionTimerRef.current);\n interactionTimerRef.current = undefined;\n }\n }, []);\n\n const startInteractionTimer = useCallback(() => {\n if (interactionTimerRef.current !== undefined) return;\n interactionTimerRef.current = window.setTimeout(() => {\n sessionTokenRef.current = undefined;\n interactionTimerRef.current = undefined;\n }, sessionTokenTimeout);\n }, []);\n\n useEffect(() => clearInteractionTimer, [clearInteractionTimer]);\n\n const getSessionToken = useCallback(() => sessionTokenRef.current, []);\n\n useEffect(() => {\n (async () => {\n if (defaultToCurrentLocation) {\n setMapLoading(true);\n const mapAPIObj = await loadMapsAPI(name, providerOpts);\n\n const navigatorPosition = await getNavigatorPosition();\n const currentLocationAddress = await mapAPIObj.getAddress(navigatorPosition);\n setMapLoading(false);\n onSelect?.(currentLocationAddress);\n }\n })();\n }, []);\n\n useEffect(() => {\n if (!filterValue) {\n setDebouncedFilterValue('');\n return;\n }\n const timer = window.setTimeout(() => setDebouncedFilterValue(filterValue), 500);\n return () => window.clearTimeout(timer);\n }, [filterValue]);\n\n useEffect(() => {\n let isCurrent = true;\n\n (async () => {\n try {\n const mapAPIObj = await loadMapsAPI(name, providerOpts);\n\n if (debouncedFilterValue) {\n if (onlyCoordinates) {\n const { latitude, longitude } = await mapAPIObj.getCoords(debouncedFilterValue);\n if (!isCurrent) return;\n setPlacePredictionMenuItems([\n {\n primary: t('exact_location'),\n secondary: [`${latitude}, ${longitude}`],\n id: createUID(),\n onClick: () => {\n setFilterValue('');\n onSelect?.({ latitude, longitude });\n }\n }\n ]);\n } else {\n if (isValueACoordinate(debouncedFilterValue)) {\n const { latitude, longitude } = await mapAPIObj.getCoords(debouncedFilterValue);\n const { name: addressName, address } = await mapAPIObj.getAddress({\n latitude,\n longitude\n });\n if (!isCurrent) return;\n const menuItems = [\n {\n primary: t('exact_location'),\n secondary: [`${latitude}, ${longitude}`],\n id: createUID(),\n onClick: () => {\n setFilterValue('');\n onSelect?.({\n latitude,\n longitude\n });\n }\n },\n {\n primary: addressName,\n secondary: [address],\n id: createUID(),\n onClick: () => {\n setFilterValue('');\n onSelect?.({ name: addressName, address, latitude, longitude });\n }\n }\n ];\n\n setPlacePredictionMenuItems(menuItems);\n return;\n }\n if (!sessionTokenRef.current) {\n sessionTokenRef.current = new google.maps.places.AutocompleteSessionToken();\n }\n const activeToken = sessionTokenRef.current;\n const { placeSuggestions } = await mapAPIObj.getPlacePredictions(\n debouncedFilterValue,\n bias,\n activeToken\n );\n if (!isCurrent) return;\n startInteractionTimer();\n\n setPlacePredictionMenuItems(\n placeSuggestions.map(item => ({\n id: item.placeId,\n primary: item.mainText,\n secondary: [item.secondaryText],\n onClick: (menuItemId: MenuItemProps['id']) => {\n mapAPIObj.getPlaceById(menuItemId, activeToken).then(\n menuItemLocation => {\n sessionTokenRef.current = undefined;\n clearInteractionTimer();\n setFilterValue('');\n onSelect?.(menuItemLocation);\n },\n e => {\n sessionTokenRef.current = undefined;\n clearInteractionTimer();\n setFilterValue('');\n onError?.(e instanceof Error ? e : new Error(String(e)));\n }\n );\n }\n }))\n );\n }\n } else {\n setPlacePredictionMenuItems([]);\n }\n } catch (e: any) {\n if (!isCurrent) return;\n setPlacePredictionMenuItems([]);\n onError?.(e);\n }\n })();\n\n return () => {\n isCurrent = false;\n };\n }, [debouncedFilterValue, bias, onError, onSelect, onlyCoordinates]);\n\n const onInputChange = useCallback(\n (e: ChangeEvent<HTMLInputElement>) => {\n setFilterValue(e.target.value.trim());\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 if (readOnly) return;\n\n sessionTokenRef.current = undefined;\n clearInteractionTimer();\n\n if (onlyCoordinates) {\n const coords = {\n latitude: placeInfo.latitude,\n longitude: placeInfo.longitude\n };\n onSelect?.(coords);\n map?.onClick?.(coords);\n } else {\n onSelect?.(placeInfo);\n map?.onClick?.(placeInfo);\n }\n },\n [readOnly, onSelect, map?.onClick, onlyCoordinates]\n );\n\n const Comp = (\n <>\n <StyledLocationInput\n id={id}\n info={info}\n data-testid={testIds.control}\n placeholder={t('location_input_placeholder')}\n menu={\n filterValue\n ? {\n items: placePredictionMenuItems.concat([\n {\n id: createUID(),\n primary: t('use_input_value', [filterValue]),\n onClick: () => {\n setFilterValue('');\n onSelect?.({ name: filterValue });\n }\n }\n ]),\n emptyText: t('location_not_found_text'),\n mode: 'action',\n footer: !map && (\n <Flex container={{ justify: 'end' }}>\n <PoweredByGoogleImage />\n </Flex>\n )\n }\n : undefined\n }\n actions={\n !disabled &&\n !readOnly && (\n <CurrentLocationButton\n onError={onError}\n onResolve={resolved => {\n if (onlyCoordinates) {\n onSelect?.({ latitude: resolved.latitude, longitude: resolved.longitude });\n } else {\n onSelect?.(resolved);\n }\n }}\n />\n )\n }\n onChange={onInputChange}\n onBlur={() => {\n setFilterValue('');\n onBlur?.(value);\n }}\n value={value}\n required={required}\n disabled={disabled}\n readOnly={readOnly}\n status={status}\n {...restProps}\n className={createClassName('location-input', className)}\n />\n {map && (\n <StyledLocationMap>\n <LocationView\n {...map}\n pins={map.location ? [{ ...map.location }] : []}\n onClick={onMapClick}\n onError={onError}\n disabled={disabled}\n loading={mapLoading}\n centerMapOnChange\n getSessionToken={getSessionToken}\n />\n </StyledLocationMap>\n )}\n </>\n );\n\n return label ? (\n <FormField\n testId={testIds}\n label={label}\n labelHidden={labelHidden}\n id={id}\n info={info}\n readOnly={readOnly}\n status={status}\n ref={ref}\n required={required}\n disabled={disabled}\n additionalInfo={additionalInfo}\n >\n {Comp}\n </FormField>\n ) : (\n Comp\n );\n});\n\nexport default withTestIds(LocationInput, getLocationInputTestIds);\n"]}
@@ -42,6 +42,8 @@ export type LocationViewProps = WithAttributes<'div', {
42
42
  drawRoute?: boolean;
43
43
  /** Callback fired when an error occurs. This function gets called with one argument of type Error. */
44
44
  onError?: (error: Error) => void;
45
+ /** Function that returns the current autocomplete session token. */
46
+ getSessionToken?: () => google.maps.places.AutocompleteSessionToken | undefined;
45
47
  }>;
46
48
  declare const LocationView: import("react").ForwardRefExoticComponent<Omit<LocationViewProps, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
47
49
  export default LocationView;
@@ -1 +1 @@
1
- {"version":3,"file":"LocationView.d.ts","sourceRoot":"","sources":["../../../src/components/Location/LocationView.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAc,cAAc,EAAE,MAAM,aAAa,CAAC;AAK9D,OAAO,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAKpD,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAC5C,KAAK,EACL;IACE;;;OAGG;IACH,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;IACb;;;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,CACR,YAAY,EAAE,MAAM,GAAG;QACrB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,KACE,IAAI,CAAC;IACV;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,sGAAsG;IACtG,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CAClC,CACF,CAAC;AAqBF,QAAA,MAAM,YAAY,2HA2OjB,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"LocationView.d.ts","sourceRoot":"","sources":["../../../src/components/Location/LocationView.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAc,cAAc,EAAE,MAAM,aAAa,CAAC;AAK9D,OAAO,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAKpD,MAAM,MAAM,iBAAiB,GAAG,cAAc,CAC5C,KAAK,EACL;IACE;;;OAGG;IACH,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;IACb;;;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,CACR,YAAY,EAAE,MAAM,GAAG;QACrB,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB,KACE,IAAI,CAAC;IACV;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IAEpB,sGAAsG;IACtG,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACjC,oEAAoE;IACpE,eAAe,CAAC,EAAE,MAAM,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,wBAAwB,GAAG,SAAS,CAAC;CACjF,CACF,CAAC;AAqBF,QAAA,MAAM,YAAY,2HA4OjB,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -23,7 +23,7 @@ const hasPlaceId = (obj) => {
23
23
  /* cSpell:ignore 'ABCDEFGHIJKLMNOPQRSTUVWYZ' */
24
24
  const markerLabels = 'ABCDEFGHIJKLMNOPQRSTUVWYZ';
25
25
  const LocationView = forwardRef(function LocationView(props, ref) {
26
- const { pins = [], zoomLevel = 13, height = '25rem', centerMapOnChange = false, onClick, onError, disabled = false, loading = false, drawRoute = false, ...restProps } = props;
26
+ const { pins = [], zoomLevel = 13, height = '25rem', centerMapOnChange = false, onClick, onError, disabled = false, loading = false, drawRoute = false, getSessionToken, ...restProps } = props;
27
27
  const t = useI18n();
28
28
  const { name, ...providerOpts } = useContext(MapsContext);
29
29
  const [status, setStatus] = useState(LoadStatus.Init);
@@ -41,7 +41,7 @@ const LocationView = forwardRef(function LocationView(props, ref) {
41
41
  if (!isLatLngObject(e.latLng) || !mapAPIObj)
42
42
  return;
43
43
  if (hasPlaceId(e)) {
44
- mapAPIObj.getPlaceById(e.placeId).then(placeInfo => {
44
+ mapAPIObj.getPlaceById(e.placeId, getSessionToken?.()).then(placeInfo => {
45
45
  onClick?.({
46
46
  ...placeInfo,
47
47
  latitude: e.latLng.lat(),
@@ -95,7 +95,7 @@ const LocationView = forwardRef(function LocationView(props, ref) {
95
95
  return;
96
96
  const l = map.current.addListener('click', onMapClick);
97
97
  return () => google.maps.event.removeListener(l);
98
- }, [onClick, map.current]);
98
+ }, [onClick, map.current, getSessionToken]);
99
99
  useEffect(() => {
100
100
  let mounted = true;
101
101
  loadMapsAPI(name, providerOpts)
@@ -1 +1 @@
1
- {"version":3,"file":"LocationView.js","sourceRoot":"","sources":["../../../src/components/Location/LocationView.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzF,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,QAAQ,MAAM,aAAa,CAAC;AAEnC,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAE3F,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAqDtE,IAAK,UAIJ;AAJD,WAAK,UAAU;IACb,2BAAa,CAAA;IACb,6BAAe,CAAA;IACf,6BAAe,CAAA;AACjB,CAAC,EAJI,UAAU,KAAV,UAAU,QAId;AAED,MAAM,UAAU,GAAG,CAAC,GAAY,EAA2D,EAAE;IAC3F,OAAO,CACL,OAAO,GAAG,KAAK,QAAQ;QACvB,CAAC,CAAC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kBAAkB,eAAU,MAAM,EAAE,GAAG,EAAE,GAAG,aAC3C,KAAC,SAAS,IACR,GAAG,EAAE,UAAiC,EACtC,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,KACV,SAAS,GACb,EACD,CAAC,MAAM,KAAK,UAAU,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,KAAC,QAAQ,IAAC,SAAS,EAAC,OAAO,GAAG,EACzE,MAAM,KAAK,UAAU,CAAC,KAAK,IAAI,QAAQ,IAAI,CAC1C,KAAC,mBAAmB,kBAAa,QAAQ,EAAE,OAAO,EAAC,MAAM,YACtD,QAAQ,GACW,CACvB,EACA,gBAAgB,KAAK,SAAS,IAAI,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,OAAO,IAAI,CACrE,4BAAG,YAAY,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,OAAO,EAAE,iBAAiB,CAAC,OAAO,CAAC,GAAI,CAC/E,IACkB,CACtB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import type { PropsWithoutRef, Ref } from 'react';\nimport { forwardRef, useCallback, useContext, useEffect, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\n\nimport { useI18n, useTheme } from '../../hooks';\nimport type { RefElement, WithAttributes } from '../../types';\nimport { createUID } from '../../utils';\nimport Progress from '../Progress';\n\nimport { StyledLocationError, StyledLocationView, StyledMap } from './LocationView.styles';\nimport type { LatLng, Pin } from './Location.types';\nimport MapsContext from './MapsContext';\nimport { isLatLngObject, loadMapsAPI, toGoogleLatLng } from './utils';\nimport type { LocationAPI } from './LocationAPI.types';\n\nexport type LocationViewProps = WithAttributes<\n 'div',\n {\n /**\n * Array of location objects.\n * @default []\n */\n pins?: Pin[];\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?: (\n locationData: LatLng & {\n name?: string;\n address?: string;\n }\n ) => void;\n /**\n * Renders loading indicator when true. Informs the user location resolution is in progress.\n */\n loading?: boolean;\n /**\n * Disables dragging and clicking when true.\n * @default false\n */\n disabled?: boolean;\n /**\n * Indicates if route between pins should be rendered.\n * @default false\n */\n drawRoute?: boolean;\n\n /** Callback fired when an error occurs. This function gets called with one argument of type Error. */\n onError?: (error: Error) => void;\n }\n>;\n\nenum LoadStatus {\n Init = 'init',\n Ready = 'ready',\n Error = 'error'\n}\n\nconst hasPlaceId = (obj: unknown): obj is google.maps.IconMouseEvent & { placeId: string } => {\n return (\n typeof obj === 'object' &&\n !!obj &&\n 'placeId' in obj &&\n !!obj.placeId &&\n typeof obj.placeId === 'string'\n );\n};\n\n/* cSpell:ignore 'ABCDEFGHIJKLMNOPQRSTUVWYZ' */\nconst markerLabels = 'ABCDEFGHIJKLMNOPQRSTUVWYZ';\n\nconst LocationView = forwardRef<RefElement<LocationViewProps>, PropsWithoutRef<LocationViewProps>>(\n function LocationView(props, ref) {\n const {\n pins = [],\n zoomLevel = 13,\n height = '25rem',\n centerMapOnChange = false,\n onClick,\n onError,\n disabled = false,\n loading = false,\n drawRoute = false,\n ...restProps\n } = props;\n const t = useI18n();\n const { name, ...providerOpts } = useContext(MapsContext);\n const [status, setStatus] = useState<LoadStatus>(LoadStatus.Init);\n const [eMessage, setEMessage] = useState('');\n const [selectedPinIndex, setSelectedPinIndex] = useState<number | undefined>(undefined);\n const [mapAPIObj, setmapAPIObj] = useState<LocationAPI>();\n const mapElemRef = useRef<HTMLDivElement>();\n const map = useRef<google.maps.Map>();\n const markers = useRef<google.maps.marker.AdvancedMarkerElement[]>([]);\n const ds = useRef<google.maps.DirectionsService>();\n const dr = useRef<google.maps.DirectionsRenderer>();\n const infoWindowContent = useRef<HTMLDivElement>(document.createElement('div'));\n const theme = useTheme();\n\n const onMapClick = (e: google.maps.MapMouseEvent) => {\n if (!isLatLngObject(e.latLng) || !mapAPIObj) return;\n\n if (hasPlaceId(e)) {\n mapAPIObj.getPlaceById(e.placeId).then(placeInfo => {\n onClick?.({\n ...placeInfo,\n latitude: e.latLng!.lat(),\n longitude: e.latLng!.lng()\n });\n });\n } else {\n mapAPIObj\n .getAddress({\n latitude: e.latLng.lat(),\n longitude: e.latLng.lng()\n })\n .then(onClick)\n .catch(err => onError?.(err));\n }\n };\n\n const centerMap = useCallback((coords: LatLng[]) => {\n if (!map.current || coords.length === 0) return;\n\n if (coords.length === 1) {\n map.current.setCenter(toGoogleLatLng(coords[0]));\n map.current.setZoom(zoomLevel);\n } else {\n const bounds = new google.maps.LatLngBounds();\n coords.forEach(({ latitude, longitude }) => {\n bounds.extend(toGoogleLatLng({ latitude, longitude }));\n });\n map.current.fitBounds(bounds);\n }\n }, []);\n\n const initialize = () => {\n if (mapElemRef.current) {\n const position = toGoogleLatLng({ latitude: 0, longitude: 0 });\n map.current = new google.maps.Map(mapElemRef.current, {\n mapId: createUID(),\n center: position,\n zoom: 2,\n draggable: !disabled,\n draggableCursor: 'auto',\n draggingCursor: 'move'\n });\n ds.current = new google.maps.DirectionsService();\n dr.current = new google.maps.DirectionsRenderer({ suppressMarkers: true });\n centerMap(pins);\n }\n };\n\n useEffect(() => {\n if (!onClick || !map.current) return;\n\n const l = map.current.addListener('click', onMapClick);\n return () => google.maps.event.removeListener(l);\n }, [onClick, map.current]);\n\n useEffect(() => {\n let mounted = true;\n loadMapsAPI(name, providerOpts)\n .then(APIObj => {\n setmapAPIObj(APIObj);\n\n if (mounted) {\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 mounted = false;\n if (map.current) google.maps.event.clearInstanceListeners(map.current);\n };\n }, []);\n\n useEffect(() => {\n if (\n status !== LoadStatus.Ready ||\n !map.current ||\n !dr.current ||\n !ds.current ||\n // FIXME: Workaround for marker library not being imported\n !google.maps.marker\n )\n return;\n\n if (drawRoute && pins.length > 1) {\n dr.current.setMap(map.current);\n const request: google.maps.DirectionsRequest = {\n origin: toGoogleLatLng({ latitude: pins[0].latitude, longitude: pins[0].longitude }),\n destination: toGoogleLatLng({\n latitude: pins[pins.length - 1].latitude,\n longitude: pins[pins.length - 1].longitude\n }),\n waypoints: pins.slice(1, pins.length - 1).map(l => {\n return {\n stopover: true,\n location: toGoogleLatLng({\n latitude: l.latitude,\n longitude: l.longitude\n })\n };\n }),\n travelMode: google.maps.TravelMode.DRIVING\n };\n\n ds.current.route(request)?.then(dr.current.setDirections.bind(dr.current), onError);\n }\n\n const infoWindow = new google.maps.InfoWindow();\n\n try {\n markers.current = pins.map(({ latitude, longitude, title, content, selected }, index) => {\n const gCoords = toGoogleLatLng({ latitude, longitude });\n\n const contentConfig: google.maps.marker.PinElementOptions = {\n glyphColor: theme.base.colors.white\n };\n const label = markerLabels[index % markerLabels.length];\n if (pins.length > 1) {\n const glyphWrapper = document.createElement('span');\n glyphWrapper.style.fontSize = '0.9rem';\n glyphWrapper.style.paddingTop = '0.1rem';\n glyphWrapper.innerHTML = label;\n contentConfig.glyph = glyphWrapper;\n }\n if (selected) {\n contentConfig.background = theme.base.colors.red.dark;\n contentConfig.borderColor = theme.base.colors.red.dark;\n contentConfig.scale = 1.15;\n }\n const pin = new google.maps.marker.PinElement(contentConfig);\n const marker = new google.maps.marker.AdvancedMarkerElement({\n map: map.current,\n position: gCoords,\n title,\n content: pin.element\n });\n if (content) {\n marker.addListener('click', () => {\n setSelectedPinIndex(index);\n infoWindow.setOptions({\n ariaLabel: `${t('location_info')} - ${title ?? label}`,\n headerContent: title ?? label\n });\n infoWindow.setContent(infoWindowContent.current);\n infoWindow.open({\n anchor: marker,\n map: map.current\n });\n });\n }\n return marker;\n });\n } catch {\n markers.current = [];\n }\n\n if (centerMapOnChange) {\n centerMap(pins);\n }\n\n return () => {\n markers.current.forEach(m => {\n m.map = null;\n });\n dr.current?.setMap(null);\n };\n }, [\n JSON.stringify(pins, ['title', 'selected', 'latitude', 'longitude']),\n status,\n zoomLevel,\n disabled,\n drawRoute,\n centerMapOnChange,\n onError\n ]);\n\n return (\n <StyledLocationView $height={height} ref={ref}>\n <StyledMap\n ref={mapElemRef as Ref<HTMLDivElement>}\n disabled={disabled}\n status={status}\n {...restProps}\n />\n {(status === LoadStatus.Init || loading) && <Progress placement='local' />}\n {status === LoadStatus.Error && eMessage && (\n <StyledLocationError aria-label={eMessage} variant='info'>\n {eMessage}\n </StyledLocationError>\n )}\n {selectedPinIndex !== undefined && !!pins[selectedPinIndex].content && (\n <>{createPortal(pins[selectedPinIndex].content, infoWindowContent.current)}</>\n )}\n </StyledLocationView>\n );\n }\n);\n\nexport default LocationView;\n"]}
1
+ {"version":3,"file":"LocationView.js","sourceRoot":"","sources":["../../../src/components/Location/LocationView.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzF,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEhD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,QAAQ,MAAM,aAAa,CAAC;AAEnC,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAE3F,OAAO,WAAW,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAuDtE,IAAK,UAIJ;AAJD,WAAK,UAAU;IACb,2BAAa,CAAA;IACb,6BAAe,CAAA;IACf,6BAAe,CAAA;AACjB,CAAC,E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IAAI,EAAE,CAAC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC;QACpE,MAAM;QACN,SAAS;QACT,QAAQ;QACR,SAAS;QACT,iBAAiB;QACjB,OAAO;KACR,CAAC,CAAC;IAEH,OAAO,CACL,MAAC,kBAAkB,eAAU,MAAM,EAAE,GAAG,EAAE,GAAG,aAC3C,KAAC,SAAS,IACR,GAAG,EAAE,UAAiC,EACtC,QAAQ,EAAE,QAAQ,EAClB,MAAM,EAAE,MAAM,KACV,SAAS,GACb,EACD,CAAC,MAAM,KAAK,UAAU,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,KAAC,QAAQ,IAAC,SAAS,EAAC,OAAO,GAAG,EACzE,MAAM,KAAK,UAAU,CAAC,KAAK,IAAI,QAAQ,IAAI,CAC1C,KAAC,mBAAmB,kBAAa,QAAQ,EAAE,OAAO,EAAC,MAAM,YACtD,QAAQ,GACW,CACvB,EACA,gBAAgB,KAAK,SAAS,IAAI,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,OAAO,IAAI,CACrE,4BAAG,YAAY,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,OAAO,EAAE,iBAAiB,CAAC,OAAO,CAAC,GAAI,CAC/E,IACkB,CACtB,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import type { PropsWithoutRef, Ref } from 'react';\nimport { forwardRef, useCallback, useContext, useEffect, useRef, useState } from 'react';\nimport { createPortal } from 'react-dom';\n\nimport { useI18n, useTheme } from '../../hooks';\nimport type { RefElement, WithAttributes } from '../../types';\nimport { createUID } from '../../utils';\nimport Progress from '../Progress';\n\nimport { StyledLocationError, StyledLocationView, StyledMap } from './LocationView.styles';\nimport type { LatLng, Pin } from './Location.types';\nimport MapsContext from './MapsContext';\nimport { isLatLngObject, loadMapsAPI, toGoogleLatLng } from './utils';\nimport type { LocationAPI } from './LocationAPI.types';\n\nexport type LocationViewProps = WithAttributes<\n 'div',\n {\n /**\n * Array of location objects.\n * @default []\n */\n pins?: Pin[];\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?: (\n locationData: LatLng & {\n name?: string;\n address?: string;\n }\n ) => void;\n /**\n * Renders loading indicator when true. Informs the user location resolution is in progress.\n */\n loading?: boolean;\n /**\n * Disables dragging and clicking when true.\n * @default false\n */\n disabled?: boolean;\n /**\n * Indicates if route between pins should be rendered.\n * @default false\n */\n drawRoute?: boolean;\n\n /** Callback fired when an error occurs. This function gets called with one argument of type Error. */\n onError?: (error: Error) => void;\n /** Function that returns the current autocomplete session token. */\n getSessionToken?: () => google.maps.places.AutocompleteSessionToken | undefined;\n }\n>;\n\nenum LoadStatus {\n Init = 'init',\n Ready = 'ready',\n Error = 'error'\n}\n\nconst hasPlaceId = (obj: unknown): obj is google.maps.IconMouseEvent & { placeId: string } => {\n return (\n typeof obj === 'object' &&\n !!obj &&\n 'placeId' in obj &&\n !!obj.placeId &&\n typeof obj.placeId === 'string'\n );\n};\n\n/* cSpell:ignore 'ABCDEFGHIJKLMNOPQRSTUVWYZ' */\nconst markerLabels = 'ABCDEFGHIJKLMNOPQRSTUVWYZ';\n\nconst LocationView = forwardRef<RefElement<LocationViewProps>, PropsWithoutRef<LocationViewProps>>(\n function LocationView(props, ref) {\n const {\n pins = [],\n zoomLevel = 13,\n height = '25rem',\n centerMapOnChange = false,\n onClick,\n onError,\n disabled = false,\n loading = false,\n drawRoute = false,\n getSessionToken,\n ...restProps\n } = props;\n const t = useI18n();\n const { name, ...providerOpts } = useContext(MapsContext);\n const [status, setStatus] = useState<LoadStatus>(LoadStatus.Init);\n const [eMessage, setEMessage] = useState('');\n const [selectedPinIndex, setSelectedPinIndex] = useState<number | undefined>(undefined);\n const [mapAPIObj, setmapAPIObj] = useState<LocationAPI>();\n const mapElemRef = useRef<HTMLDivElement>();\n const map = useRef<google.maps.Map>();\n const markers = useRef<google.maps.marker.AdvancedMarkerElement[]>([]);\n const ds = useRef<google.maps.DirectionsService>();\n const dr = useRef<google.maps.DirectionsRenderer>();\n const infoWindowContent = useRef<HTMLDivElement>(document.createElement('div'));\n const theme = useTheme();\n\n const onMapClick = (e: google.maps.MapMouseEvent) => {\n if (!isLatLngObject(e.latLng) || !mapAPIObj) return;\n\n if (hasPlaceId(e)) {\n mapAPIObj.getPlaceById(e.placeId, getSessionToken?.()).then(placeInfo => {\n onClick?.({\n ...placeInfo,\n latitude: e.latLng!.lat(),\n longitude: e.latLng!.lng()\n });\n });\n } else {\n mapAPIObj\n .getAddress({\n latitude: e.latLng.lat(),\n longitude: e.latLng.lng()\n })\n .then(onClick)\n .catch(err => onError?.(err));\n }\n };\n\n const centerMap = useCallback((coords: LatLng[]) => {\n if (!map.current || coords.length === 0) return;\n\n if (coords.length === 1) {\n map.current.setCenter(toGoogleLatLng(coords[0]));\n map.current.setZoom(zoomLevel);\n } else {\n const bounds = new google.maps.LatLngBounds();\n coords.forEach(({ latitude, longitude }) => {\n bounds.extend(toGoogleLatLng({ latitude, longitude }));\n });\n map.current.fitBounds(bounds);\n }\n }, []);\n\n const initialize = () => {\n if (mapElemRef.current) {\n const position = toGoogleLatLng({ latitude: 0, longitude: 0 });\n map.current = new google.maps.Map(mapElemRef.current, {\n mapId: createUID(),\n center: position,\n zoom: 2,\n draggable: !disabled,\n draggableCursor: 'auto',\n draggingCursor: 'move'\n });\n ds.current = new google.maps.DirectionsService();\n dr.current = new google.maps.DirectionsRenderer({ suppressMarkers: true });\n centerMap(pins);\n }\n };\n\n useEffect(() => {\n if (!onClick || !map.current) return;\n\n const l = map.current.addListener('click', onMapClick);\n return () => google.maps.event.removeListener(l);\n }, [onClick, map.current, getSessionToken]);\n\n useEffect(() => {\n let mounted = true;\n loadMapsAPI(name, providerOpts)\n .then(APIObj => {\n setmapAPIObj(APIObj);\n\n if (mounted) {\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 mounted = false;\n if (map.current) google.maps.event.clearInstanceListeners(map.current);\n };\n }, []);\n\n useEffect(() => {\n if (\n status !== LoadStatus.Ready ||\n !map.current ||\n !dr.current ||\n !ds.current ||\n // FIXME: Workaround for marker library not being imported\n !google.maps.marker\n )\n return;\n\n if (drawRoute && pins.length > 1) {\n dr.current.setMap(map.current);\n const request: google.maps.DirectionsRequest = {\n origin: toGoogleLatLng({ latitude: pins[0].latitude, longitude: pins[0].longitude }),\n destination: toGoogleLatLng({\n latitude: pins[pins.length - 1].latitude,\n longitude: pins[pins.length - 1].longitude\n }),\n waypoints: pins.slice(1, pins.length - 1).map(l => {\n return {\n stopover: true,\n location: toGoogleLatLng({\n latitude: l.latitude,\n longitude: l.longitude\n })\n };\n }),\n travelMode: google.maps.TravelMode.DRIVING\n };\n\n ds.current.route(request)?.then(dr.current.setDirections.bind(dr.current), onError);\n }\n\n const infoWindow = new google.maps.InfoWindow();\n\n try {\n markers.current = pins.map(({ latitude, longitude, title, content, selected }, index) => {\n const gCoords = toGoogleLatLng({ latitude, longitude });\n\n const contentConfig: google.maps.marker.PinElementOptions = {\n glyphColor: theme.base.colors.white\n };\n const label = markerLabels[index % markerLabels.length];\n if (pins.length > 1) {\n const glyphWrapper = document.createElement('span');\n glyphWrapper.style.fontSize = '0.9rem';\n glyphWrapper.style.paddingTop = '0.1rem';\n glyphWrapper.innerHTML = label;\n contentConfig.glyph = glyphWrapper;\n }\n if (selected) {\n contentConfig.background = theme.base.colors.red.dark;\n contentConfig.borderColor = theme.base.colors.red.dark;\n contentConfig.scale = 1.15;\n }\n const pin = new google.maps.marker.PinElement(contentConfig);\n const marker = new google.maps.marker.AdvancedMarkerElement({\n map: map.current,\n position: gCoords,\n title,\n content: pin.element\n });\n if (content) {\n marker.addListener('click', () => {\n setSelectedPinIndex(index);\n infoWindow.setOptions({\n ariaLabel: `${t('location_info')} - ${title ?? label}`,\n headerContent: title ?? label\n });\n infoWindow.setContent(infoWindowContent.current);\n infoWindow.open({\n anchor: marker,\n map: map.current\n });\n });\n }\n return marker;\n });\n } catch {\n markers.current = [];\n }\n\n if (centerMapOnChange) {\n centerMap(pins);\n }\n\n return () => {\n markers.current.forEach(m => {\n m.map = null;\n });\n dr.current?.setMap(null);\n };\n }, [\n JSON.stringify(pins, ['title', 'selected', 'latitude', 'longitude']),\n status,\n zoomLevel,\n disabled,\n drawRoute,\n centerMapOnChange,\n onError\n ]);\n\n return (\n <StyledLocationView $height={height} ref={ref}>\n <StyledMap\n ref={mapElemRef as Ref<HTMLDivElement>}\n disabled={disabled}\n status={status}\n {...restProps}\n />\n {(status === LoadStatus.Init || loading) && <Progress placement='local' />}\n {status === LoadStatus.Error && eMessage && (\n <StyledLocationError aria-label={eMessage} variant='info'>\n {eMessage}\n </StyledLocationError>\n )}\n {selectedPinIndex !== undefined && !!pins[selectedPinIndex].content && (\n <>{createPortal(pins[selectedPinIndex].content, infoWindowContent.current)}</>\n )}\n </StyledLocationView>\n );\n }\n);\n\nexport default LocationView;\n"]}
@@ -1,11 +1,13 @@
1
- export declare const StyledLocationError: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<Omit<import("../Badges").StatusProps, "ref"> & import("react").RefAttributes<HTMLSpanElement>> & {
1
+ export declare const StyledLocationError: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<Omit<Omit<import("../Badges").StatusProps, "ref"> & import("react").RefAttributes<HTMLSpanElement>, "ref"> & {
2
+ ref?: ((instance: HTMLSpanElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLSpanElement> | null | undefined;
3
+ }, never>> & string & Omit<import("react").ForwardRefExoticComponent<Omit<import("../Badges").StatusProps, "ref"> & import("react").RefAttributes<HTMLSpanElement>> & {
2
4
  getTestIds: (testIdProp?: import("../..").TestIdProp["testId"]) => import("../..").TestIdsRecord<readonly []>;
3
- }, import("styled-components").DefaultTheme, {}, never>;
4
- export declare const StyledLocationView: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
5
+ }, keyof import("react").Component<any, {}, any>>;
6
+ export declare const StyledLocationView: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
5
7
  $height: string;
6
- }, never>;
7
- export declare const StyledMap: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
8
+ }>> & string;
9
+ export declare const StyledMap: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
8
10
  status: string;
9
11
  disabled: boolean;
10
- }, never>;
12
+ }>> & string;
11
13
  //# sourceMappingURL=LocationView.styles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"LocationView.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Location/LocationView.styles.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,mBAAmB;;uDAK/B,CAAC;AAIF,eAAO,MAAM,kBAAkB;aAAyB,MAAM;SA0F5D,CAAC;AAIH,eAAO,MAAM,SAAS;YACZ,MAAM;cACJ,OAAO;SAwBlB,CAAC"}
1
+ {"version":3,"file":"LocationView.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Location/LocationView.styles.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,mBAAmB;;;;iDAK/B,CAAC;AAIF,eAAO,MAAM,kBAAkB;aAAyB,MAAM;YA0F5D,CAAC;AAIH,eAAO,MAAM,SAAS;YACZ,MAAM;cACJ,OAAO;YAwBlB,CAAC"}
@@ -1,6 +1,10 @@
1
1
  import type { FunctionComponent } from 'react';
2
+ import type { DefaultTheme } from 'styled-components';
2
3
  import type { ForwardProps } from '../../types';
3
- export declare const StyledMark: import("styled-components").StyledComponent<"mark", import("styled-components").DefaultTheme, {}, never>;
4
+ export declare const markStyles: ({ theme }: {
5
+ theme: DefaultTheme;
6
+ }) => import("styled-components").RuleSet<object>;
7
+ export declare const StyledMark: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, never>> & string;
4
8
  declare const Mark: FunctionComponent<ForwardProps>;
5
9
  export default Mark;
6
10
  //# sourceMappingURL=Mark.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Mark.d.ts","sourceRoot":"","sources":["../../../src/components/Mark/Mark.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAI/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,eAAO,MAAM,UAAU,0GAMrB,CAAC;AAIH,QAAA,MAAM,IAAI,EAAE,iBAAiB,CAAC,YAAY,CAEzC,CAAC;AAEF,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"Mark.d.ts","sourceRoot":"","sources":["../../../src/components/Mark/Mark.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAE/C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAGtD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,eAAO,MAAM,UAAU,GAAI,WAAW;IAAE,KAAK,EAAE,YAAY,CAAA;CAAE,gDAI5D,CAAC;AAEF,eAAO,MAAM,UAAU,uNAEtB,CAAC;AAIF,QAAA,MAAM,IAAI,EAAE,iBAAiB,CAAC,YAAY,CAEzC,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -1,13 +1,14 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import styled, { css } from 'styled-components';
3
3
  import { defaultThemeProp } from '../../theme';
4
- export const StyledMark = styled.mark(({ theme }) => {
5
- return css `
6
- color: ${theme.base.colors.black};
7
- background-color: ${theme.components.mark['background-color']};
8
- font-weight: ${theme.components.mark['font-weight']};
9
- `;
10
- });
4
+ export const markStyles = ({ theme }) => css `
5
+ color: ${theme.base.colors.black};
6
+ background-color: ${theme.components.mark['background-color']};
7
+ font-weight: ${theme.components.mark['font-weight']};
8
+ `;
9
+ export const StyledMark = styled.mark `
10
+ ${markStyles}
11
+ `;
11
12
  StyledMark.defaultProps = defaultThemeProp;
12
13
  const Mark = props => {
13
14
  return _jsx(StyledMark, { ...props });
@@ -1 +1 @@
1
- {"version":3,"file":"Mark.js","sourceRoot":"","sources":["../../../src/components/Mark/Mark.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAG/C,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE;IAClD,OAAO,GAAG,CAAA;aACC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK;wBACZ,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,kBAAkB,CAAC;mBAC9C,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC;GACpD,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,UAAU,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE3C,MAAM,IAAI,GAAoC,KAAK,CAAC,EAAE;IACpD,OAAO,KAAC,UAAU,OAAK,KAAK,GAAI,CAAC;AACnC,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["import type { FunctionComponent } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport { defaultThemeProp } from '../../theme';\nimport type { ForwardProps } from '../../types';\n\nexport const StyledMark = styled.mark(({ theme }) => {\n return css`\n color: ${theme.base.colors.black};\n background-color: ${theme.components.mark['background-color']};\n font-weight: ${theme.components.mark['font-weight']};\n `;\n});\n\nStyledMark.defaultProps = defaultThemeProp;\n\nconst Mark: FunctionComponent<ForwardProps> = props => {\n return <StyledMark {...props} />;\n};\n\nexport default Mark;\n"]}
1
+ {"version":3,"file":"Mark.js","sourceRoot":"","sources":["../../../src/components/Mark/Mark.tsx"],"names":[],"mappings":";AACA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAG/C,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,EAAE,KAAK,EAA2B,EAAE,EAAE,CAAC,GAAG,CAAA;WAC1D,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK;sBACZ,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,kBAAkB,CAAC;iBAC9C,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,aAAa,CAAC;CACpD,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAAG,MAAM,CAAC,IAAI,CAAA;IACjC,UAAU;CACb,CAAC;AAEF,UAAU,CAAC,YAAY,GAAG,gBAAgB,CAAC;AAE3C,MAAM,IAAI,GAAoC,KAAK,CAAC,EAAE;IACpD,OAAO,KAAC,UAAU,OAAK,KAAK,GAAI,CAAC;AACnC,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC","sourcesContent":["import type { FunctionComponent } from 'react';\nimport styled, { css } from 'styled-components';\nimport type { DefaultTheme } from 'styled-components';\n\nimport { defaultThemeProp } from '../../theme';\nimport type { ForwardProps } from '../../types';\n\nexport const markStyles = ({ theme }: { theme: DefaultTheme }) => css`\n color: ${theme.base.colors.black};\n background-color: ${theme.components.mark['background-color']};\n font-weight: ${theme.components.mark['font-weight']};\n`;\n\nexport const StyledMark = styled.mark`\n ${markStyles}\n`;\n\nStyledMark.defaultProps = defaultThemeProp;\n\nconst Mark: FunctionComponent<ForwardProps> = props => {\n return <StyledMark {...props} />;\n};\n\nexport default Mark;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/Menu.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,aAAa,CAAC;AAUnE,OAAO,KAAK,EAEV,SAAS,EAGV,MAAM,cAAc,CAAC;;;;AAwZtB,wBAAiD"}
1
+ {"version":3,"file":"Menu.d.ts","sourceRoot":"","sources":["../../../src/components/Menu/Menu.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,aAAa,CAAC;AAiBnE,OAAO,KAAK,EAEV,SAAS,EAGV,MAAM,cAAc,CAAC;;;;AAoftB,wBAAiD"}
@@ -1,23 +1,27 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { forwardRef, useCallback, useEffect, useState, useRef, useMemo, useImperativeHandle } from 'react';
3
3
  import { useConsolidatedRef, useUID, useActiveDescendant, useLazyDescendant, useI18n, usePrevious, useDirection, useTestIds } from '../../hooks';
4
- import { cap, withTestIds } from '../../utils';
4
+ import { cap, withTestIds, getActiveElement } from '../../utils';
5
5
  import VisuallyHiddenText from '../VisuallyHiddenText';
6
6
  import Button from '../Button/Button';
7
7
  import Icon from '../Icon/Icon';
8
+ import Input from '../Input';
9
+ import HiddenText from '../HiddenText';
8
10
  import FlyoutMenuList from './FlyoutMenuList';
9
11
  import MenuContext from './Menu.context';
10
- import { StyledMenu, StyledMenuListWrapper } from './Menu.styles';
12
+ import { StyledMenu, StyledMenuFilter, StyledMenuListWrapper, StyledFilterIcon } from './Menu.styles';
11
13
  import { getMenuTestIds } from './Menu.test-ids';
12
14
  import MenuList from './MenuList';
13
15
  const Menu = forwardRef(function Menu(props, ref) {
14
16
  const uid = useUID();
15
- const { testId, id = uid, items = [], itemLayout = 'stacked', onCreateNew, mode = 'action', accent, scrollAt = 7, emptyText, onItemClick, onItemActive, onItemExpand, loadMore, onItemCollapse, loading = false, currentItemId, header, footer, variant = 'drill-down', focusControlEl, arrowNavigationUnsupported, 'aria-describedby': ariaDescribedBy, 'aria-label': label, role = 'menu', listId, pauseDescendantEvaluation, menuList: customMenuList, handleRef, ...restProps } = props;
17
+ const { testId, id = uid, items = [], itemLayout = 'stacked', onCreateNew, mode = 'action', accent, scrollAt = 7, emptyText, onItemClick, onItemActive, onItemExpand, loadMore, onItemCollapse, loading = false, currentItemId, header, footer, variant = 'drill-down', focusControlEl, arrowNavigationUnsupported, 'aria-describedby': ariaDescribedBy, 'aria-label': label, role = 'menu', listId, pauseDescendantEvaluation, cycle = true, filterInputProps, menuList: customMenuList, handleRef, ...restProps } = props;
16
18
  const testIds = useTestIds(testId, getMenuTestIds);
17
19
  const t = useI18n();
20
+ const instructionTextId = useUID();
18
21
  const { end: endDirection, start: startDirection } = useDirection();
19
22
  const radioName = useUID();
20
23
  const menuRef = useConsolidatedRef(ref);
24
+ const filterElRef = useConsolidatedRef(filterInputProps?.ref);
21
25
  const previousItemCount = useRef(0);
22
26
  const [activeDescendantUpdateId, setActiveDescendantUpdateId] = useState(0);
23
27
  const [focusDescendant, setFocusDescendant] = useState(null);
@@ -29,8 +33,14 @@ const Menu = forwardRef(function Menu(props, ref) {
29
33
  const menuAsFocusControl = !focusControlEl;
30
34
  const activeFlyoutSelector = useMemo(() => `fieldset[data-flyout-menu-id="${flyOutActiveIdStack[flyOutActiveIdStack.length - 1]}"]`, [flyOutActiveIdStack]);
31
35
  const focusControl = useMemo(() => {
36
+ if (filterElRef.current) {
37
+ return filterElRef.current;
38
+ }
32
39
  return focusControlEl || menuRef.current;
33
40
  }, [focusControlEl, menuRef.current]);
41
+ useEffect(() => {
42
+ filterElRef.current?.focus();
43
+ }, []);
34
44
  useImperativeHandle(handleRef, () => {
35
45
  return {
36
46
  expandTo: itemId => {
@@ -77,7 +87,8 @@ const Menu = forwardRef(function Menu(props, ref) {
77
87
  clearPreventScroll: () => {
78
88
  setPreventInitialScroll(false);
79
89
  },
80
- pauseDescendantEvaluation
90
+ pauseDescendantEvaluation,
91
+ cycle
81
92
  }), [
82
93
  focusControl,
83
94
  menuRef.current,
@@ -86,7 +97,8 @@ const Menu = forwardRef(function Menu(props, ref) {
86
97
  focusDescendant,
87
98
  currentItemId,
88
99
  preventInitialScroll,
89
- pauseDescendantEvaluation
100
+ pauseDescendantEvaluation,
101
+ cycle
90
102
  ]);
91
103
  const { activeDescendant, descendants } = useActiveDescendant(uadConfig, [
92
104
  activeDescendantUpdateId
@@ -198,6 +210,38 @@ const Menu = forwardRef(function Menu(props, ref) {
198
210
  }, 0);
199
211
  return () => clearTimeout(timeoutId);
200
212
  }, [items]);
213
+ // Cannot use previousActiveDescendant here because usePrevious uses useLayoutEffect, which runs before useEffect.
214
+ // This means by the time any useEffect fires, previousActiveDescendant has already been updated to the current value.
215
+ // So previousActiveDescendant can't be used to track the previous active element inside an effect.
216
+ // So, we are using a ref to store the last active descendant instead.
217
+ const lastActiveDescendantRef = useRef();
218
+ useEffect(() => {
219
+ const scopeIsActive = menuRef.current?.getAttribute('data-active-scope') === 'true';
220
+ const focusControlIsActive = getActiveElement() === focusControl;
221
+ if (!scopeIsActive && !focusControlIsActive) {
222
+ lastActiveDescendantRef.current = undefined;
223
+ return;
224
+ }
225
+ const prev = lastActiveDescendantRef.current;
226
+ if (prev && prev !== activeDescendant) {
227
+ prev.dispatchEvent(new FocusEvent('focusout'));
228
+ }
229
+ if (activeDescendant && prev !== activeDescendant) {
230
+ activeDescendant.dispatchEvent(new FocusEvent('focusin'));
231
+ }
232
+ lastActiveDescendantRef.current = activeDescendant;
233
+ }, [activeDescendant, focusControl]);
234
+ useEffect(() => {
235
+ const handleBlur = () => {
236
+ const last = lastActiveDescendantRef.current;
237
+ if (last) {
238
+ last.dispatchEvent(new FocusEvent('focusout'));
239
+ lastActiveDescendantRef.current = undefined;
240
+ }
241
+ };
242
+ focusControl?.addEventListener('blur', handleBlur);
243
+ return () => focusControl?.removeEventListener('blur', handleBlur);
244
+ }, [focusControl]);
201
245
  const contextValue = useMemo(() => {
202
246
  return {
203
247
  componentId: id,
@@ -264,8 +308,16 @@ const Menu = forwardRef(function Menu(props, ref) {
264
308
  expandToParentItem
265
309
  ]);
266
310
  const menuList = customMenuList ??
267
- (variant === 'drill-down' ? (_jsx(MenuList, { items: items, id: listId, menuRole: role, "aria-multiselectable": mode === 'multi-select', "aria-labelledby": label ? `${id}-menuLabel` : undefined })) : (_jsx(FlyoutMenuList, { items: items, menuRole: role })));
268
- return (_jsxs(StyledMenu, { "data-testid": testIds.root, id: id, "aria-describedby": menuAsFocusControl ? `${id}-menuDescription` : undefined, ...restProps, ref: menuRef, tabIndex: menuAsFocusControl ? 0 : undefined, children: [menuAsFocusControl && (_jsx("span", { id: `${id}-menuDescription`, hidden: true, children: (`${t('menu_selection_instructions')} ` && ariaDescribedBy) || '' })), label && _jsx(VisuallyHiddenText, { id: `${id}-menuLabel`, children: label }), header && _jsx("header", { "data-popover-scroll-el": true, children: header }), _jsx(StyledMenuListWrapper, { "data-popover-scroll-el": true, children: _jsx(MenuContext.Provider, { value: contextValue, children: menuList }) }), (onCreateNew || footer) && (_jsx("footer", { "data-popover-scroll-el": true, children: onCreateNew ? (_jsxs(Button, { "data-testid": testIds.createNew, variant: 'link', onClick: onCreateNew, children: [_jsx(Icon, { name: 'plus' }), " ", t('create_new')] })) : (footer) }))] }));
311
+ (variant === 'drill-down' ? (_jsx(MenuList, { items: items, id: listId, menuRole: role, "aria-multiselectable": role === 'listbox' ? mode === 'multi-select' : undefined, "aria-labelledby": label ? `${id}-menuLabel` : undefined })) : (_jsx(FlyoutMenuList, { items: items, menuRole: role })));
312
+ return (_jsxs(StyledMenu, { "data-testid": testIds.root, id: id, "aria-describedby": menuAsFocusControl ? `${id}-menuDescription` : undefined, ...restProps, ref: menuRef, tabIndex: menuAsFocusControl ? 0 : undefined, children: [menuAsFocusControl && (_jsx("span", { id: `${id}-menuDescription`, hidden: true, children: (`${t('menu_selection_instructions')} ` && ariaDescribedBy) || '' })), label && _jsx(VisuallyHiddenText, { id: `${id}-menuLabel`, children: label }), (filterInputProps || header) && (_jsx("header", { "data-popover-scroll-el": true, onMouseDownCapture: e => {
313
+ if (filterElRef.current && e.target !== filterElRef.current) {
314
+ e.preventDefault();
315
+ }
316
+ }, children: filterInputProps ? (_jsxs(StyledMenuFilter, { children: [_jsx(StyledFilterIcon, { name: 'search' }), _jsx(Input, { ...filterInputProps, type: 'search', role: 'combobox', "aria-label": t('menu_filter_instructions'), "aria-controls": listId, "aria-expanded": 'true', "aria-describedby": instructionTextId, ref: filterElRef }), _jsx(HiddenText, { id: instructionTextId, children: t('search_instructions') })] })) : (header) })), _jsx(StyledMenuListWrapper, { "data-popover-scroll-el": true, children: _jsx(MenuContext.Provider, { value: contextValue, children: menuList }) }), (onCreateNew || footer) && (_jsx("footer", { "data-popover-scroll-el": true, children: onCreateNew ? (_jsxs(Button, { "data-testid": testIds.createNew, variant: 'link', onClick: () => {
317
+ (typeof onCreateNew !== 'function' ? onCreateNew.handler : onCreateNew)();
318
+ }, disabled: typeof onCreateNew !== 'function' ? onCreateNew.disabled : undefined, children: [_jsx(Icon, { name: 'plus' }), ' ', typeof onCreateNew !== 'function' && onCreateNew.text
319
+ ? onCreateNew.text
320
+ : t('create_new')] })) : (footer) }))] }));
269
321
  });
270
322
  export default withTestIds(Menu, getMenuTestIds);
271
323
  //# sourceMappingURL=Menu.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Menu.js","sourceRoot":"","sources":["../../../src/components/Menu/Menu.tsx"],"names":[],"mappings":";AAAA,OAAO,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,CAC1B,2DACG,WAAW,CAAC,CAAC,CAAC,CACb,MAAC,MAAM,mBAAc,OAAO,CAAC,SAAS,EAAE,OAAO,EAAC,MAAM,EAAC,OAAO,EAAE,WAAW,aACzE,KAAC,IAAI,IAAC,IAAI,EAAC,MAAM,GAAG,OAAE,CAAC,CAAC,YAAY,CAAC,IAC9B,CACV,CAAC,CAAC,CAAC,CACF,MAAM,CACP,GACM,CACV,IACU,CACd,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC","sourcesContent":["import {\n forwardRef,\n useCallback,\n useEffect,\n useState,\n useRef,\n useMemo,\n useImperativeHandle\n} from 'react';\nimport type { PropsWithoutRef, MouseEvent } from 'react';\n\nimport {\n useConsolidatedRef,\n useUID,\n useActiveDescendant,\n useLazyDescendant,\n useI18n,\n usePrevious,\n useDirection,\n useTestIds\n} from '../../hooks';\nimport type { ForwardRefForwardPropsComponent } from '../../types';\nimport { cap, withTestIds } from '../../utils';\nimport VisuallyHiddenText from '../VisuallyHiddenText';\nimport Button from '../Button/Button';\nimport Icon from '../Icon/Icon';\n\nimport FlyoutMenuList from './FlyoutMenuList';\nimport MenuContext from './Menu.context';\nimport { StyledMenu, StyledMenuListWrapper } from './Menu.styles';\nimport { getMenuTestIds } from './Menu.test-ids';\nimport type {\n MenuContextProps,\n MenuProps,\n MenuItemProps,\n AcceptedMouseEventElement\n} from './Menu.types';\nimport MenuList from './MenuList';\n\nconst Menu: ForwardRefForwardPropsComponent<MenuProps> = forwardRef(function Menu(\n props: PropsWithoutRef<MenuProps>,\n ref: MenuProps['ref']\n) {\n const uid = useUID();\n const {\n testId,\n id = uid,\n items = [],\n itemLayout = 'stacked',\n onCreateNew,\n mode = 'action',\n accent,\n scrollAt = 7,\n emptyText,\n onItemClick,\n onItemActive,\n onItemExpand,\n loadMore,\n onItemCollapse,\n loading = false,\n currentItemId,\n header,\n footer,\n variant = 'drill-down',\n focusControlEl,\n arrowNavigationUnsupported,\n 'aria-describedby': ariaDescribedBy,\n 'aria-label': label,\n role = 'menu',\n listId,\n pauseDescendantEvaluation,\n menuList: customMenuList,\n handleRef,\n ...restProps\n } = props;\n\n const testIds = useTestIds(testId, getMenuTestIds);\n\n const t = useI18n();\n\n const { end: endDirection, start: startDirection } = useDirection();\n const radioName = useUID();\n const menuRef = useConsolidatedRef(ref);\n const previousItemCount = useRef(0);\n const [activeDescendantUpdateId, setActiveDescendantUpdateId] = useState(0);\n const [focusDescendant, setFocusDescendant] = useState<HTMLElement | null>(null);\n const [flyOutActiveIdStack, setFlyoutActiveIdStack] = useState<string[]>([id]);\n const [focusReturnEl, setFocusReturnEl] = useState<HTMLElement | null>();\n const [preventInitialScroll, setPreventInitialScroll] = useState(false);\n const [flyoutFocusReturnStack, setFlyoutFocusReturnStack] = useState<(HTMLElement | null)[]>([]);\n const [expandToParentItem, setExpandToParentItem] = useState<string | undefined>();\n\n const menuAsFocusControl = !focusControlEl;\n\n const activeFlyoutSelector = useMemo(\n () => `fieldset[data-flyout-menu-id=\"${flyOutActiveIdStack[flyOutActiveIdStack.length - 1]}\"]`,\n [flyOutActiveIdStack]\n );\n\n const focusControl = useMemo(() => {\n return focusControlEl || menuRef.current;\n }, [focusControlEl, menuRef.current]);\n\n useImperativeHandle(\n handleRef,\n () => {\n return {\n expandTo: itemId => {\n setExpandToParentItem(itemId);\n }\n };\n },\n []\n );\n\n const pushFlyoutId = useCallback(\n (flyoutId: string) => {\n setFlyoutActiveIdStack([...flyOutActiveIdStack, flyoutId]);\n },\n [flyOutActiveIdStack]\n );\n\n useEffect(() => {\n setFlyoutActiveIdStack([...flyOutActiveIdStack, id]);\n }, [id]);\n\n const updateParentDescendantStack = useCallback(\n (item: HTMLElement | null) => {\n setFlyoutFocusReturnStack([...flyoutFocusReturnStack, item]);\n },\n [flyoutFocusReturnStack]\n );\n\n const getScopedItemId = useCallback(\n (itemId: string) => {\n return btoa(encodeURIComponent(itemId));\n },\n [id]\n );\n\n const getUnscopedItemId = useCallback(\n (itemId: string) => {\n return decodeURIComponent(atob(itemId));\n },\n [id]\n );\n\n const updateActiveDescendants: MenuContextProps['updateActiveDescendants'] = useCallback(\n ({ preventScroll = false } = {}) => {\n setPreventInitialScroll(preventScroll);\n setActiveDescendantUpdateId(Math.random());\n },\n []\n );\n\n const uadConfig = useMemo(\n () => ({\n focusEl: focusControl,\n scope: menuRef.current,\n scopeSelector:\n variant === 'drill-down'\n ? ('fieldset[aria-hidden=\"false\"]' as keyof HTMLElementTagNameMap)\n : activeFlyoutSelector,\n selector: `[role=\"${\n role === 'menu' ? 'menuitem' : 'option'\n }\"], legend` as keyof HTMLElementTagNameMap,\n focusDescendantEl: focusDescendant,\n clearFocusDescendant: () => {\n setFocusDescendant(null);\n },\n focusReturnEl,\n clearFocusReturn: () => {\n setFocusReturnEl(null);\n },\n currentDescendantId: currentItemId ? getScopedItemId(currentItemId) : undefined,\n preventInitialScroll,\n clearPreventScroll: () => {\n setPreventInitialScroll(false);\n },\n pauseDescendantEvaluation\n }),\n [\n focusControl,\n menuRef.current,\n activeFlyoutSelector,\n focusReturnEl,\n focusDescendant,\n currentItemId,\n preventInitialScroll,\n pauseDescendantEvaluation\n ]\n );\n\n const { activeDescendant, descendants } = useActiveDescendant(uadConfig, [\n activeDescendantUpdateId\n ]);\n\n const previousActiveDescendant = usePrevious(activeDescendant);\n\n useLazyDescendant({\n loading,\n descendants,\n previousActiveDescendant,\n activeDescendant,\n focusReturnEl,\n setFocusReturnEl,\n scrollEl: uadConfig.scope?.querySelector(uadConfig.scopeSelector)?.querySelector('ul')\n });\n\n // ## Bind Menu-specific navigation keyDown.\n useEffect(() => {\n const expandOrCollapse: (action?: 'collapse' | 'expand' | null) => void = (action = null) => {\n if (activeDescendant) {\n // expand\n if (activeDescendant.dataset.expand === 'true' && action !== 'collapse') {\n const clickEl =\n activeDescendant.querySelector<HTMLSpanElement>('span[aria-hidden=\"true\"]') ??\n activeDescendant;\n clickEl.click();\n return;\n }\n\n // collapse\n if (action !== 'expand') {\n if (\n variant === 'flyout' &&\n flyOutActiveIdStack.length > 1 &&\n flyoutFocusReturnStack.length > 0\n ) {\n setFlyoutActiveIdStack([...flyOutActiveIdStack].slice(0, -1));\n\n const parentDescendant = flyoutFocusReturnStack.pop();\n if (parentDescendant !== undefined) setFocusReturnEl(parentDescendant);\n updateActiveDescendants();\n } else if (activeDescendant.dataset.collapse === 'true') activeDescendant.click();\n }\n }\n };\n\n const additionalKeydown = (e: KeyboardEvent) => {\n switch (e.key) {\n case `Arrow${cap(endDirection)}`: {\n if (arrowNavigationUnsupported) break;\n expandOrCollapse('expand');\n break;\n }\n case `Arrow${cap(startDirection)}`: {\n if (arrowNavigationUnsupported) break;\n expandOrCollapse('collapse');\n break;\n }\n case 'Escape': {\n if (\n variant === 'flyout' &&\n flyOutActiveIdStack.length > 1 &&\n flyoutFocusReturnStack.length > 0\n ) {\n e.preventDefault();\n e.stopPropagation();\n\n setFlyoutActiveIdStack([...flyOutActiveIdStack].slice(0, -1));\n const parentDescendant = flyoutFocusReturnStack.pop();\n if (parentDescendant !== undefined) setFocusReturnEl(parentDescendant);\n updateActiveDescendants();\n }\n break;\n }\n default:\n break;\n }\n\n if (arrowNavigationUnsupported && (e.key === ' ' || e.key === 'Spacebar') && e.shiftKey) {\n e.preventDefault();\n expandOrCollapse();\n }\n };\n\n if (activeDescendant) onItemActive?.(getUnscopedItemId(activeDescendant.id));\n\n focusControl?.addEventListener('keydown', additionalKeydown);\n\n return () => focusControl?.removeEventListener('keydown', additionalKeydown);\n }, [focusControl, activeDescendant, flyOutActiveIdStack]);\n\n // ## Update useActiveDescendant on change of items, not selection of items.\n useEffect(() => {\n // Next tick for DOM updates.\n const timeoutId = setTimeout(() => {\n if (items.length === previousItemCount.current) {\n const previousDescendantIds = descendants?.map(node => node.id);\n const newDescendants = uadConfig.scope\n ?.querySelector(uadConfig.scopeSelector)\n ?.querySelectorAll(uadConfig.selector);\n\n if (!newDescendants) {\n updateActiveDescendants();\n return;\n }\n\n const scopedDescendants = Array.from(newDescendants);\n\n if (scopedDescendants?.length !== previousDescendantIds?.length) {\n updateActiveDescendants();\n return;\n }\n\n const itemsUnchanged = scopedDescendants.every(\n (node, index) => node.id === previousDescendantIds[index]\n );\n\n if (!itemsUnchanged) {\n updateActiveDescendants();\n }\n\n return;\n }\n\n previousItemCount.current = items.length;\n updateActiveDescendants();\n }, 0);\n\n return () => clearTimeout(timeoutId);\n }, [items]);\n\n const contextValue = useMemo(() => {\n return {\n componentId: id,\n 'aria-label': label,\n mode,\n arrowNavigationUnsupported,\n onItemClick: (\n clickedId: MenuItemProps['id'],\n event: MouseEvent<AcceptedMouseEventElement>\n ) => {\n if (menuAsFocusControl) {\n menuRef.current?.focus();\n }\n\n onItemClick?.(clickedId, event);\n },\n onItemActive,\n onItemExpand,\n onItemCollapse,\n itemLayout,\n accent,\n scrollAt,\n emptyText,\n radioName,\n loadMore,\n loading,\n variant,\n focusControl,\n updateActiveDescendants,\n setFocusReturnEl,\n setFocusDescendant,\n getScopedItemId,\n pushFlyoutId,\n flyOutActiveIdStack,\n updateParentDescendantStack,\n expandTo: {\n parentItemId: expandToParentItem,\n onComplete: () => {\n setExpandToParentItem(undefined);\n }\n }\n };\n }, [\n id,\n label,\n mode,\n arrowNavigationUnsupported,\n onItemClick,\n onItemActive,\n onItemExpand,\n onItemCollapse,\n itemLayout,\n accent,\n scrollAt,\n emptyText,\n radioName,\n loadMore,\n loading,\n variant,\n focusControl,\n updateActiveDescendants,\n setFocusReturnEl,\n setFocusDescendant,\n getScopedItemId,\n pushFlyoutId,\n flyOutActiveIdStack,\n updateParentDescendantStack,\n expandToParentItem\n ]);\n\n const menuList =\n customMenuList ??\n (variant === 'drill-down' ? (\n <MenuList\n items={items}\n id={listId}\n menuRole={role}\n aria-multiselectable={mode === 'multi-select'}\n aria-labelledby={label ? `${id}-menuLabel` : undefined}\n />\n ) : (\n <FlyoutMenuList items={items} menuRole={role} />\n ));\n\n return (\n <StyledMenu\n data-testid={testIds.root}\n id={id}\n aria-describedby={menuAsFocusControl ? `${id}-menuDescription` : undefined}\n {...restProps}\n ref={menuRef}\n tabIndex={menuAsFocusControl ? 0 : undefined}\n >\n {menuAsFocusControl && (\n <span id={`${id}-menuDescription`} hidden>\n {(`${t('menu_selection_instructions')} ` && ariaDescribedBy) || ''}\n </span>\n )}\n {label && <VisuallyHiddenText id={`${id}-menuLabel`}>{label}</VisuallyHiddenText>}\n\n {header && <header data-popover-scroll-el>{header}</header>}\n\n <StyledMenuListWrapper data-popover-scroll-el>\n <MenuContext.Provider value={contextValue}>{menuList}</MenuContext.Provider>\n </StyledMenuListWrapper>\n {(onCreateNew || footer) && (\n <footer data-popover-scroll-el>\n {onCreateNew ? (\n <Button data-testid={testIds.createNew} variant='link' onClick={onCreateNew}>\n <Icon name='plus' /> {t('create_new')}\n </Button>\n ) : (\n footer\n )}\n </footer>\n )}\n </StyledMenu>\n );\n});\n\nexport default withTestIds(Menu, getMenuTestIds);\n"]}
1
+ {"version":3,"file":"Menu.js","sourceRoot":"","sources":["../../../src/components/Menu/Menu.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,UAAU,EACV,WAAW,EACX,SAAS,EACT,QAAQ,EACR,MAAM,EACN,OAAO,EACP,mBAAmB,EACpB,MAAM,OAAO,CAAC;AAGf,OAAO,EACL,kBAAkB,EAClB,MAAM,EACN,mBAAmB,EACnB,iBAAiB,EACjB,OAAO,EACP,WAAW,EACX,YAAY,EACZ,UAAU,EACX,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,kBAAkB,MAAM,uBAAuB,CAAC;AACvD,OAAO,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,IAAI,MAAM,cAAc,CAAC;AAChC,OAAO,KAAK,MAAM,UAAU,CAAC;AAC7B,OAAO,UAAU,MAAM,eAAe,CAAC;AAEvC,OAAO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AW,KAAK,UAAU,IAAI,WAAW,CAAC,IAAI;4BACpD,CAAC,CAAC,WAAW,CAAC,IAAI;4BAClB,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,IACZ,CACV,CAAC,CAAC,CAAC,CACF,MAAM,CACP,GACM,CACV,IACU,CACd,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC","sourcesContent":["import {\n forwardRef,\n useCallback,\n useEffect,\n useState,\n useRef,\n useMemo,\n useImperativeHandle\n} from 'react';\nimport type { PropsWithoutRef, MouseEvent } from 'react';\n\nimport {\n useConsolidatedRef,\n useUID,\n useActiveDescendant,\n useLazyDescendant,\n useI18n,\n usePrevious,\n useDirection,\n useTestIds\n} from '../../hooks';\nimport type { ForwardRefForwardPropsComponent } from '../../types';\nimport { cap, withTestIds, getActiveElement } from '../../utils';\nimport VisuallyHiddenText from '../VisuallyHiddenText';\nimport Button from '../Button/Button';\nimport Icon from '../Icon/Icon';\nimport Input from '../Input';\nimport HiddenText from '../HiddenText';\n\nimport FlyoutMenuList from './FlyoutMenuList';\nimport MenuContext from './Menu.context';\nimport {\n StyledMenu,\n StyledMenuFilter,\n StyledMenuListWrapper,\n StyledFilterIcon\n} from './Menu.styles';\nimport { getMenuTestIds } from './Menu.test-ids';\nimport type {\n MenuContextProps,\n MenuProps,\n MenuItemProps,\n AcceptedMouseEventElement\n} from './Menu.types';\nimport MenuList from './MenuList';\n\nconst Menu: ForwardRefForwardPropsComponent<MenuProps> = forwardRef(function Menu(\n props: PropsWithoutRef<MenuProps>,\n ref: MenuProps['ref']\n) {\n const uid = useUID();\n const {\n testId,\n id = uid,\n items = [],\n itemLayout = 'stacked',\n onCreateNew,\n mode = 'action',\n accent,\n scrollAt = 7,\n emptyText,\n onItemClick,\n onItemActive,\n onItemExpand,\n loadMore,\n onItemCollapse,\n loading = false,\n currentItemId,\n header,\n footer,\n variant = 'drill-down',\n focusControlEl,\n arrowNavigationUnsupported,\n 'aria-describedby': ariaDescribedBy,\n 'aria-label': label,\n role = 'menu',\n listId,\n pauseDescendantEvaluation,\n cycle = true,\n filterInputProps,\n menuList: customMenuList,\n handleRef,\n ...restProps\n } = props;\n\n const testIds = useTestIds(testId, getMenuTestIds);\n\n const t = useI18n();\n const instructionTextId = useUID();\n\n const { end: endDirection, start: startDirection } = useDirection();\n const radioName = useUID();\n const menuRef = useConsolidatedRef(ref);\n const filterElRef = useConsolidatedRef<HTMLInputElement>(filterInputProps?.ref);\n const previousItemCount = useRef(0);\n const [activeDescendantUpdateId, setActiveDescendantUpdateId] = useState(0);\n const [focusDescendant, setFocusDescendant] = useState<HTMLElement | null>(null);\n const [flyOutActiveIdStack, setFlyoutActiveIdStack] = useState<string[]>([id]);\n const [focusReturnEl, setFocusReturnEl] = useState<HTMLElement | null>();\n const [preventInitialScroll, setPreventInitialScroll] = useState(false);\n const [flyoutFocusReturnStack, setFlyoutFocusReturnStack] = useState<(HTMLElement | null)[]>([]);\n const [expandToParentItem, setExpandToParentItem] = useState<string | undefined>();\n\n const menuAsFocusControl = !focusControlEl;\n\n const activeFlyoutSelector = useMemo(\n () => `fieldset[data-flyout-menu-id=\"${flyOutActiveIdStack[flyOutActiveIdStack.length - 1]}\"]`,\n [flyOutActiveIdStack]\n );\n\n const focusControl = useMemo(() => {\n if (filterElRef.current) {\n return filterElRef.current;\n }\n return focusControlEl || menuRef.current;\n }, [focusControlEl, menuRef.current]);\n\n useEffect(() => {\n filterElRef.current?.focus();\n }, []);\n\n useImperativeHandle(\n handleRef,\n () => {\n return {\n expandTo: itemId => {\n setExpandToParentItem(itemId);\n }\n };\n },\n []\n );\n\n const pushFlyoutId = useCallback(\n (flyoutId: string) => {\n setFlyoutActiveIdStack([...flyOutActiveIdStack, flyoutId]);\n },\n [flyOutActiveIdStack]\n );\n\n useEffect(() => {\n setFlyoutActiveIdStack([...flyOutActiveIdStack, id]);\n }, [id]);\n\n const updateParentDescendantStack = useCallback(\n (item: HTMLElement | null) => {\n setFlyoutFocusReturnStack([...flyoutFocusReturnStack, item]);\n },\n [flyoutFocusReturnStack]\n );\n\n const getScopedItemId = useCallback(\n (itemId: string) => {\n return btoa(encodeURIComponent(itemId));\n },\n [id]\n );\n\n const getUnscopedItemId = useCallback(\n (itemId: string) => {\n return decodeURIComponent(atob(itemId));\n },\n [id]\n );\n\n const updateActiveDescendants: MenuContextProps['updateActiveDescendants'] = useCallback(\n ({ preventScroll = false } = {}) => {\n setPreventInitialScroll(preventScroll);\n setActiveDescendantUpdateId(Math.random());\n },\n []\n );\n\n const uadConfig = useMemo(\n () => ({\n focusEl: focusControl,\n scope: menuRef.current,\n scopeSelector:\n variant === 'drill-down'\n ? ('fieldset[aria-hidden=\"false\"]' as keyof HTMLElementTagNameMap)\n : activeFlyoutSelector,\n selector: `[role=\"${\n role === 'menu' ? 'menuitem' : 'option'\n }\"], legend` as keyof HTMLElementTagNameMap,\n focusDescendantEl: focusDescendant,\n clearFocusDescendant: () => {\n setFocusDescendant(null);\n },\n focusReturnEl,\n clearFocusReturn: () => {\n setFocusReturnEl(null);\n },\n currentDescendantId: currentItemId ? getScopedItemId(currentItemId) : undefined,\n preventInitialScroll,\n clearPreventScroll: () => {\n setPreventInitialScroll(false);\n },\n pauseDescendantEvaluation,\n cycle\n }),\n [\n focusControl,\n menuRef.current,\n activeFlyoutSelector,\n focusReturnEl,\n focusDescendant,\n currentItemId,\n preventInitialScroll,\n pauseDescendantEvaluation,\n cycle\n ]\n );\n\n const { activeDescendant, descendants } = useActiveDescendant(uadConfig, [\n activeDescendantUpdateId\n ]);\n\n const previousActiveDescendant = usePrevious(activeDescendant);\n\n useLazyDescendant({\n loading,\n descendants,\n previousActiveDescendant,\n activeDescendant,\n focusReturnEl,\n setFocusReturnEl,\n scrollEl: uadConfig.scope?.querySelector(uadConfig.scopeSelector)?.querySelector('ul')\n });\n\n // ## Bind Menu-specific navigation keyDown.\n useEffect(() => {\n const expandOrCollapse: (action?: 'collapse' | 'expand' | null) => void = (action = null) => {\n if (activeDescendant) {\n // expand\n if (activeDescendant.dataset.expand === 'true' && action !== 'collapse') {\n const clickEl =\n activeDescendant.querySelector<HTMLSpanElement>('span[aria-hidden=\"true\"]') ??\n activeDescendant;\n clickEl.click();\n return;\n }\n\n // collapse\n if (action !== 'expand') {\n if (\n variant === 'flyout' &&\n flyOutActiveIdStack.length > 1 &&\n flyoutFocusReturnStack.length > 0\n ) {\n setFlyoutActiveIdStack([...flyOutActiveIdStack].slice(0, -1));\n\n const parentDescendant = flyoutFocusReturnStack.pop();\n if (parentDescendant !== undefined) setFocusReturnEl(parentDescendant);\n updateActiveDescendants();\n } else if (activeDescendant.dataset.collapse === 'true') activeDescendant.click();\n }\n }\n };\n\n const additionalKeydown = (e: KeyboardEvent) => {\n switch (e.key) {\n case `Arrow${cap(endDirection)}`: {\n if (arrowNavigationUnsupported) break;\n expandOrCollapse('expand');\n break;\n }\n case `Arrow${cap(startDirection)}`: {\n if (arrowNavigationUnsupported) break;\n expandOrCollapse('collapse');\n break;\n }\n case 'Escape': {\n if (\n variant === 'flyout' &&\n flyOutActiveIdStack.length > 1 &&\n flyoutFocusReturnStack.length > 0\n ) {\n e.preventDefault();\n e.stopPropagation();\n\n setFlyoutActiveIdStack([...flyOutActiveIdStack].slice(0, -1));\n const parentDescendant = flyoutFocusReturnStack.pop();\n if (parentDescendant !== undefined) setFocusReturnEl(parentDescendant);\n updateActiveDescendants();\n }\n break;\n }\n default:\n break;\n }\n\n if (arrowNavigationUnsupported && (e.key === ' ' || e.key === 'Spacebar') && e.shiftKey) {\n e.preventDefault();\n expandOrCollapse();\n }\n };\n\n if (activeDescendant) onItemActive?.(getUnscopedItemId(activeDescendant.id));\n\n focusControl?.addEventListener('keydown', additionalKeydown);\n\n return () => focusControl?.removeEventListener('keydown', additionalKeydown);\n }, [focusControl, activeDescendant, flyOutActiveIdStack]);\n\n // ## Update useActiveDescendant on change of items, not selection of items.\n useEffect(() => {\n // Next tick for DOM updates.\n const timeoutId = setTimeout(() => {\n if (items.length === previousItemCount.current) {\n const previousDescendantIds = descendants?.map(node => node.id);\n const newDescendants = uadConfig.scope\n ?.querySelector(uadConfig.scopeSelector)\n ?.querySelectorAll(uadConfig.selector);\n\n if (!newDescendants) {\n updateActiveDescendants();\n return;\n }\n\n const scopedDescendants = Array.from(newDescendants);\n\n if (scopedDescendants?.length !== previousDescendantIds?.length) {\n updateActiveDescendants();\n return;\n }\n\n const itemsUnchanged = scopedDescendants.every(\n (node, index) => node.id === previousDescendantIds[index]\n );\n\n if (!itemsUnchanged) {\n updateActiveDescendants();\n }\n\n return;\n }\n\n previousItemCount.current = items.length;\n updateActiveDescendants();\n }, 0);\n\n return () => clearTimeout(timeoutId);\n }, [items]);\n\n // Cannot use previousActiveDescendant here because usePrevious uses useLayoutEffect, which runs before useEffect.\n // This means by the time any useEffect fires, previousActiveDescendant has already been updated to the current value.\n // So previousActiveDescendant can't be used to track the previous active element inside an effect.\n // So, we are using a ref to store the last active descendant instead.\n const lastActiveDescendantRef = useRef<HTMLElement | undefined>();\n\n useEffect(() => {\n const scopeIsActive = menuRef.current?.getAttribute('data-active-scope') === 'true';\n const focusControlIsActive = getActiveElement() === focusControl;\n\n if (!scopeIsActive && !focusControlIsActive) {\n lastActiveDescendantRef.current = undefined;\n return;\n }\n\n const prev = lastActiveDescendantRef.current;\n\n if (prev && prev !== activeDescendant) {\n prev.dispatchEvent(new FocusEvent('focusout'));\n }\n\n if (activeDescendant && prev !== activeDescendant) {\n activeDescendant.dispatchEvent(new FocusEvent('focusin'));\n }\n\n lastActiveDescendantRef.current = activeDescendant;\n }, [activeDescendant, focusControl]);\n\n useEffect(() => {\n const handleBlur = () => {\n const last = lastActiveDescendantRef.current;\n if (last) {\n last.dispatchEvent(new FocusEvent('focusout'));\n lastActiveDescendantRef.current = undefined;\n }\n };\n\n focusControl?.addEventListener('blur', handleBlur);\n return () => focusControl?.removeEventListener('blur', handleBlur);\n }, [focusControl]);\n\n const contextValue = useMemo(() => {\n return {\n componentId: id,\n 'aria-label': label,\n mode,\n arrowNavigationUnsupported,\n onItemClick: (\n clickedId: MenuItemProps['id'],\n event: MouseEvent<AcceptedMouseEventElement>\n ) => {\n if (menuAsFocusControl) {\n menuRef.current?.focus();\n }\n\n onItemClick?.(clickedId, event);\n },\n onItemActive,\n onItemExpand,\n onItemCollapse,\n itemLayout,\n accent,\n scrollAt,\n emptyText,\n radioName,\n loadMore,\n loading,\n variant,\n focusControl,\n updateActiveDescendants,\n setFocusReturnEl,\n setFocusDescendant,\n getScopedItemId,\n pushFlyoutId,\n flyOutActiveIdStack,\n updateParentDescendantStack,\n expandTo: {\n parentItemId: expandToParentItem,\n onComplete: () => {\n setExpandToParentItem(undefined);\n }\n }\n };\n }, [\n id,\n label,\n mode,\n arrowNavigationUnsupported,\n onItemClick,\n onItemActive,\n onItemExpand,\n onItemCollapse,\n itemLayout,\n accent,\n scrollAt,\n emptyText,\n radioName,\n loadMore,\n loading,\n variant,\n focusControl,\n updateActiveDescendants,\n setFocusReturnEl,\n setFocusDescendant,\n getScopedItemId,\n pushFlyoutId,\n flyOutActiveIdStack,\n updateParentDescendantStack,\n expandToParentItem\n ]);\n\n const menuList =\n customMenuList ??\n (variant === 'drill-down' ? (\n <MenuList\n items={items}\n id={listId}\n menuRole={role}\n aria-multiselectable={role === 'listbox' ? mode === 'multi-select' : undefined}\n aria-labelledby={label ? `${id}-menuLabel` : undefined}\n />\n ) : (\n <FlyoutMenuList items={items} menuRole={role} />\n ));\n\n return (\n <StyledMenu\n data-testid={testIds.root}\n id={id}\n aria-describedby={menuAsFocusControl ? `${id}-menuDescription` : undefined}\n {...restProps}\n ref={menuRef}\n tabIndex={menuAsFocusControl ? 0 : undefined}\n >\n {menuAsFocusControl && (\n <span id={`${id}-menuDescription`} hidden>\n {(`${t('menu_selection_instructions')} ` && ariaDescribedBy) || ''}\n </span>\n )}\n {label && <VisuallyHiddenText id={`${id}-menuLabel`}>{label}</VisuallyHiddenText>}\n\n {(filterInputProps || header) && (\n <header\n data-popover-scroll-el\n onMouseDownCapture={e => {\n if (filterElRef.current && e.target !== filterElRef.current) {\n e.preventDefault();\n }\n }}\n >\n {filterInputProps ? (\n <StyledMenuFilter>\n <StyledFilterIcon name='search' />\n <Input\n {...filterInputProps}\n type='search'\n role='combobox'\n aria-label={t('menu_filter_instructions')}\n aria-controls={listId}\n aria-expanded='true'\n aria-describedby={instructionTextId}\n ref={filterElRef}\n />\n <HiddenText id={instructionTextId}>{t('search_instructions')}</HiddenText>\n </StyledMenuFilter>\n ) : (\n header\n )}\n </header>\n )}\n\n <StyledMenuListWrapper data-popover-scroll-el>\n <MenuContext.Provider value={contextValue}>{menuList}</MenuContext.Provider>\n </StyledMenuListWrapper>\n {(onCreateNew || footer) && (\n <footer data-popover-scroll-el>\n {onCreateNew ? (\n <Button\n data-testid={testIds.createNew}\n variant='link'\n onClick={() => {\n (typeof onCreateNew !== 'function' ? onCreateNew.handler : onCreateNew)();\n }}\n disabled={typeof onCreateNew !== 'function' ? onCreateNew.disabled : undefined}\n >\n <Icon name='plus' />{' '}\n {typeof onCreateNew !== 'function' && onCreateNew.text\n ? onCreateNew.text\n : t('create_new')}\n </Button>\n ) : (\n footer\n )}\n </footer>\n )}\n </StyledMenu>\n );\n});\n\nexport default withTestIds(Menu, getMenuTestIds);\n"]}