@pega/cosmos-react-core 7.0.0-build.3.4 → 7.0.0-build.30.1

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 (777) hide show
  1. package/lib/components/AIButton/AIButton.d.ts +30 -2
  2. package/lib/components/AIButton/AIButton.d.ts.map +1 -1
  3. package/lib/components/AIButton/AIButton.js +7 -6
  4. package/lib/components/AIButton/AIButton.js.map +1 -1
  5. package/lib/components/Actions/Actions.d.ts +1 -1
  6. package/lib/components/Actions/Actions.d.ts.map +1 -1
  7. package/lib/components/Actions/Actions.js +6 -3
  8. package/lib/components/Actions/Actions.js.map +1 -1
  9. package/lib/components/AppShell/AppHeader.d.ts.map +1 -1
  10. package/lib/components/AppShell/AppHeader.js +9 -7
  11. package/lib/components/AppShell/AppHeader.js.map +1 -1
  12. package/lib/components/AppShell/AppHeader.styles.d.ts.map +1 -1
  13. package/lib/components/AppShell/AppHeader.styles.js +27 -20
  14. package/lib/components/AppShell/AppHeader.styles.js.map +1 -1
  15. package/lib/components/AppShell/AppShell.d.ts.map +1 -1
  16. package/lib/components/AppShell/AppShell.js +16 -4
  17. package/lib/components/AppShell/AppShell.js.map +1 -1
  18. package/lib/components/AppShell/AppShell.styles.d.ts +5 -1
  19. package/lib/components/AppShell/AppShell.styles.d.ts.map +1 -1
  20. package/lib/components/AppShell/AppShell.styles.js +52 -13
  21. package/lib/components/AppShell/AppShell.styles.js.map +1 -1
  22. package/lib/components/AppShell/AppShell.types.d.ts +4 -0
  23. package/lib/components/AppShell/AppShell.types.d.ts.map +1 -1
  24. package/lib/components/AppShell/AppShell.types.js.map +1 -1
  25. package/lib/components/AppShell/AppShellContext.d.ts +3 -1
  26. package/lib/components/AppShell/AppShellContext.d.ts.map +1 -1
  27. package/lib/components/AppShell/AppShellContext.js +3 -1
  28. package/lib/components/AppShell/AppShellContext.js.map +1 -1
  29. package/lib/components/AppShell/AppShellList.styles.d.ts.map +1 -1
  30. package/lib/components/AppShell/AppShellList.styles.js +1 -0
  31. package/lib/components/AppShell/AppShellList.styles.js.map +1 -1
  32. package/lib/components/AppShell/NavigationList.d.ts.map +1 -1
  33. package/lib/components/AppShell/NavigationList.js +3 -3
  34. package/lib/components/AppShell/NavigationList.js.map +1 -1
  35. package/lib/components/AppShell/NavigationListItemWrapper.d.ts.map +1 -1
  36. package/lib/components/AppShell/NavigationListItemWrapper.js +1 -0
  37. package/lib/components/AppShell/NavigationListItemWrapper.js.map +1 -1
  38. package/lib/components/AppShell/Operator.d.ts +1 -1
  39. package/lib/components/AppShell/style-utils.d.ts +3 -0
  40. package/lib/components/AppShell/style-utils.d.ts.map +1 -1
  41. package/lib/components/AppShell/style-utils.js +42 -3
  42. package/lib/components/AppShell/style-utils.js.map +1 -1
  43. package/lib/components/Avatar/Avatar.d.ts +2 -2
  44. package/lib/components/Avatar/Avatar.d.ts.map +1 -1
  45. package/lib/components/Avatar/Avatar.js +21 -20
  46. package/lib/components/Avatar/Avatar.js.map +1 -1
  47. package/lib/components/Avatar/Avatar.test-ids.d.ts +1 -1
  48. package/lib/components/Avatar/Avatar.test-ids.d.ts.map +1 -1
  49. package/lib/components/Backdrop/Backdrop.d.ts +1 -1
  50. package/lib/components/Backdrop/Backdrop.test-ids.d.ts +1 -1
  51. package/lib/components/Backdrop/Backdrop.test-ids.d.ts.map +1 -1
  52. package/lib/components/Badges/Alert.d.ts +1 -1
  53. package/lib/components/Badges/Badges.test-ids.d.ts +6 -6
  54. package/lib/components/Badges/Badges.test-ids.d.ts.map +1 -1
  55. package/lib/components/Badges/Count.d.ts +1 -1
  56. package/lib/components/Badges/Keyboard.d.ts +1 -1
  57. package/lib/components/Badges/Keyboard.d.ts.map +1 -1
  58. package/lib/components/Badges/Keyboard.js +9 -8
  59. package/lib/components/Badges/Keyboard.js.map +1 -1
  60. package/lib/components/Badges/Selection.d.ts +1 -1
  61. package/lib/components/Badges/Selection.d.ts.map +1 -1
  62. package/lib/components/Badges/Selection.js +3 -1
  63. package/lib/components/Badges/Selection.js.map +1 -1
  64. package/lib/components/Badges/Status.d.ts +1 -1
  65. package/lib/components/Badges/Status.d.ts.map +1 -1
  66. package/lib/components/Badges/Status.js +0 -1
  67. package/lib/components/Badges/Status.js.map +1 -1
  68. package/lib/components/Badges/Tag.d.ts +1 -1
  69. package/lib/components/Banner/Banner.d.ts +1 -1
  70. package/lib/components/Banner/Banner.d.ts.map +1 -1
  71. package/lib/components/Banner/Banner.js +5 -2
  72. package/lib/components/Banner/Banner.js.map +1 -1
  73. package/lib/components/Banner/Banner.test-ids.d.ts +1 -1
  74. package/lib/components/Banner/Banner.test-ids.d.ts.map +1 -1
  75. package/lib/components/Button/Button.d.ts +1 -1
  76. package/lib/components/Button/Button.d.ts.map +1 -1
  77. package/lib/components/Button/Button.js +142 -53
  78. package/lib/components/Button/Button.js.map +1 -1
  79. package/lib/components/Card/Card.d.ts.map +1 -1
  80. package/lib/components/Card/Card.js +8 -0
  81. package/lib/components/Card/Card.js.map +1 -1
  82. package/lib/components/Checkbox/Checkbox.d.ts +3 -33
  83. package/lib/components/Checkbox/Checkbox.d.ts.map +1 -1
  84. package/lib/components/Checkbox/Checkbox.js +1 -5
  85. package/lib/components/Checkbox/Checkbox.js.map +1 -1
  86. package/lib/components/ColorPicker/ColorPicker.d.ts +6 -23
  87. package/lib/components/ColorPicker/ColorPicker.d.ts.map +1 -1
  88. package/lib/components/ColorPicker/ColorPicker.js +3 -4
  89. package/lib/components/ColorPicker/ColorPicker.js.map +1 -1
  90. package/lib/components/ColorPicker/ColorPicker.test-ids.d.ts +1 -1
  91. package/lib/components/ColorPicker/ColorPicker.test-ids.d.ts.map +1 -1
  92. package/lib/components/ComboBox/ComboBox.d.ts +2 -4
  93. package/lib/components/ComboBox/ComboBox.d.ts.map +1 -1
  94. package/lib/components/ComboBox/ComboBox.js +8 -5
  95. package/lib/components/ComboBox/ComboBox.js.map +1 -1
  96. package/lib/components/ComboBox/ComboBox.styles.d.ts.map +1 -1
  97. package/lib/components/ComboBox/ComboBox.styles.js +7 -1
  98. package/lib/components/ComboBox/ComboBox.styles.js.map +1 -1
  99. package/lib/components/ComboBox/ComboBox.types.d.ts +8 -26
  100. package/lib/components/ComboBox/ComboBox.types.d.ts.map +1 -1
  101. package/lib/components/ComboBox/ComboBox.types.js.map +1 -1
  102. package/lib/components/ComboBox/ComboxBox.test-ids.d.ts +1 -1
  103. package/lib/components/ComboBox/ComboxBox.test-ids.d.ts.map +1 -1
  104. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.d.ts.map +1 -1
  105. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js +10 -2
  106. package/lib/components/ComboBox/MultiSelectInput/MultiSelectInput.js.map +1 -1
  107. package/lib/components/CompositeInput/CompositeInput.d.ts +2 -3
  108. package/lib/components/CompositeInput/CompositeInput.d.ts.map +1 -1
  109. package/lib/components/CompositeInput/CompositeInput.js +2 -3
  110. package/lib/components/CompositeInput/CompositeInput.js.map +1 -1
  111. package/lib/components/CompositeInput/CompositeInput.test-ids.d.ts +1 -1
  112. package/lib/components/CompositeInput/CompositeInput.test-ids.d.ts.map +1 -1
  113. package/lib/components/CompositeInput/CompositeInput.types.d.ts +4 -13
  114. package/lib/components/CompositeInput/CompositeInput.types.d.ts.map +1 -1
  115. package/lib/components/CompositeInput/CompositeInput.types.js.map +1 -1
  116. package/lib/components/Configuration/Configuration.d.ts +1 -0
  117. package/lib/components/Configuration/Configuration.d.ts.map +1 -1
  118. package/lib/components/Configuration/Configuration.js +58 -30
  119. package/lib/components/Configuration/Configuration.js.map +1 -1
  120. package/lib/components/Configuration/ThemeOverride.d.ts +11 -0
  121. package/lib/components/Configuration/ThemeOverride.d.ts.map +1 -0
  122. package/lib/components/Configuration/ThemeOverride.js +23 -0
  123. package/lib/components/Configuration/ThemeOverride.js.map +1 -0
  124. package/lib/components/Configuration/connected-watcher.d.ts +17 -0
  125. package/lib/components/Configuration/connected-watcher.d.ts.map +1 -0
  126. package/lib/components/Configuration/connected-watcher.js +13 -0
  127. package/lib/components/Configuration/connected-watcher.js.map +1 -0
  128. package/lib/components/Configuration/index.d.ts +1 -0
  129. package/lib/components/Configuration/index.d.ts.map +1 -1
  130. package/lib/components/Configuration/index.js +1 -0
  131. package/lib/components/Configuration/index.js.map +1 -1
  132. package/lib/components/Configuration/withConfiguration.d.ts.map +1 -1
  133. package/lib/components/Configuration/withConfiguration.js.map +1 -1
  134. package/lib/components/CreditCard/CreditCard.types.d.ts +5 -25
  135. package/lib/components/CreditCard/CreditCard.types.d.ts.map +1 -1
  136. package/lib/components/CreditCard/CreditCard.types.js.map +1 -1
  137. package/lib/components/CreditCard/CreditCardDisplay.d.ts +2 -4
  138. package/lib/components/CreditCard/CreditCardDisplay.d.ts.map +1 -1
  139. package/lib/components/CreditCard/CreditCardDisplay.js +1 -2
  140. package/lib/components/CreditCard/CreditCardDisplay.js.map +1 -1
  141. package/lib/components/CreditCard/CreditCardInput.d.ts +15 -5
  142. package/lib/components/CreditCard/CreditCardInput.d.ts.map +1 -1
  143. package/lib/components/CreditCard/CreditCardInput.js +1 -2
  144. package/lib/components/CreditCard/CreditCardInput.js.map +1 -1
  145. package/lib/components/Currency/Currency.test-ids.d.ts +1 -1
  146. package/lib/components/Currency/Currency.test-ids.d.ts.map +1 -1
  147. package/lib/components/Currency/CurrencyInput.d.ts +1 -1
  148. package/lib/components/Currency/CurrencyInput.js +1 -1
  149. package/lib/components/Currency/CurrencyInput.js.map +1 -1
  150. package/lib/components/DangerButton/DangerButton.js +2 -2
  151. package/lib/components/DangerButton/DangerButton.js.map +1 -1
  152. package/lib/components/DateTime/DateTime.test-ids.d.ts +11 -11
  153. package/lib/components/DateTime/DateTime.test-ids.d.ts.map +1 -1
  154. package/lib/components/DateTime/DateTime.test-ids.js +5 -1
  155. package/lib/components/DateTime/DateTime.test-ids.js.map +1 -1
  156. package/lib/components/DateTime/Input/DateInput.d.ts +1 -1
  157. package/lib/components/DateTime/Input/DateInput.d.ts.map +1 -1
  158. package/lib/components/DateTime/Input/DateInput.js +30 -30
  159. package/lib/components/DateTime/Input/DateInput.js.map +1 -1
  160. package/lib/components/DateTime/Input/DateRangeInput.d.ts +1 -1
  161. package/lib/components/DateTime/Input/DateRangeInput.js +2 -2
  162. package/lib/components/DateTime/Input/DateRangeInput.js.map +1 -1
  163. package/lib/components/DateTime/Input/DateTime.styles.d.ts +1 -0
  164. package/lib/components/DateTime/Input/DateTime.styles.d.ts.map +1 -1
  165. package/lib/components/DateTime/Input/DateTime.styles.js +24 -16
  166. package/lib/components/DateTime/Input/DateTime.styles.js.map +1 -1
  167. package/lib/components/DateTime/Input/DateTimeInput.d.ts +1 -1
  168. package/lib/components/DateTime/Input/DateTimeInput.d.ts.map +1 -1
  169. package/lib/components/DateTime/Input/DateTimeInput.js +28 -22
  170. package/lib/components/DateTime/Input/DateTimeInput.js.map +1 -1
  171. package/lib/components/DateTime/Input/DayOfWeekInput.d.ts +1 -1
  172. package/lib/components/DateTime/Input/Duration/DurationInput.d.ts +1 -1
  173. package/lib/components/DateTime/Input/MonthInput.d.ts +1 -1
  174. package/lib/components/DateTime/Input/MonthInput.d.ts.map +1 -1
  175. package/lib/components/DateTime/Input/MonthInput.js +23 -12
  176. package/lib/components/DateTime/Input/MonthInput.js.map +1 -1
  177. package/lib/components/DateTime/Input/PartInput.d.ts +1 -1
  178. package/lib/components/DateTime/Input/PartInput.d.ts.map +1 -1
  179. package/lib/components/DateTime/Input/PartInput.js +13 -7
  180. package/lib/components/DateTime/Input/PartInput.js.map +1 -1
  181. package/lib/components/DateTime/Input/QuarterInput.d.ts +1 -1
  182. package/lib/components/DateTime/Input/TimeInput.d.ts +1 -1
  183. package/lib/components/DateTime/Input/TimeRangeInput.d.ts +1 -1
  184. package/lib/components/DateTime/Input/TimeRangeInput.js +3 -3
  185. package/lib/components/DateTime/Input/TimeRangeInput.js.map +1 -1
  186. package/lib/components/DateTime/Input/WeekInput.d.ts +1 -1
  187. package/lib/components/DateTime/Input/WeekInput.d.ts.map +1 -1
  188. package/lib/components/DateTime/Input/WeekInput.js +17 -6
  189. package/lib/components/DateTime/Input/WeekInput.js.map +1 -1
  190. package/lib/components/DateTime/Input/utils.d.ts +3 -2
  191. package/lib/components/DateTime/Input/utils.d.ts.map +1 -1
  192. package/lib/components/DateTime/Input/utils.js +9 -2
  193. package/lib/components/DateTime/Input/utils.js.map +1 -1
  194. package/lib/components/DateTime/Picker/Calendar.d.ts.map +1 -1
  195. package/lib/components/DateTime/Picker/Calendar.js +5 -4
  196. package/lib/components/DateTime/Picker/Calendar.js.map +1 -1
  197. package/lib/components/DateTime/Picker/Calendar.styles.d.ts.map +1 -1
  198. package/lib/components/DateTime/Picker/Calendar.styles.js +2 -1
  199. package/lib/components/DateTime/Picker/Calendar.styles.js.map +1 -1
  200. package/lib/components/DateTime/Picker/DatePicker.d.ts +1 -1
  201. package/lib/components/DateTime/Picker/DatePicker.d.ts.map +1 -1
  202. package/lib/components/DateTime/Picker/DatePicker.js +31 -19
  203. package/lib/components/DateTime/Picker/DatePicker.js.map +1 -1
  204. package/lib/components/DateTime/Picker/DatePicker.styles.d.ts +1 -0
  205. package/lib/components/DateTime/Picker/DatePicker.styles.d.ts.map +1 -1
  206. package/lib/components/DateTime/Picker/DatePicker.styles.js +13 -5
  207. package/lib/components/DateTime/Picker/DatePicker.styles.js.map +1 -1
  208. package/lib/components/DateTime/Picker/DateRangePicker.d.ts.map +1 -1
  209. package/lib/components/DateTime/Picker/DateRangePicker.js +18 -11
  210. package/lib/components/DateTime/Picker/DateRangePicker.js.map +1 -1
  211. package/lib/components/DateTime/Picker/TimePicker.d.ts.map +1 -1
  212. package/lib/components/DateTime/Picker/TimePicker.js +2 -1
  213. package/lib/components/DateTime/Picker/TimePicker.js.map +1 -1
  214. package/lib/components/DateTime/Picker/utils.d.ts +9 -0
  215. package/lib/components/DateTime/Picker/utils.d.ts.map +1 -1
  216. package/lib/components/DateTime/Picker/utils.js +16 -0
  217. package/lib/components/DateTime/Picker/utils.js.map +1 -1
  218. package/lib/components/DateTime/index.d.ts +1 -1
  219. package/lib/components/DateTime/index.d.ts.map +1 -1
  220. package/lib/components/DateTime/index.js +1 -1
  221. package/lib/components/DateTime/index.js.map +1 -1
  222. package/lib/components/DateTime/utils.d.ts +5 -0
  223. package/lib/components/DateTime/utils.d.ts.map +1 -1
  224. package/lib/components/DateTime/utils.js +21 -11
  225. package/lib/components/DateTime/utils.js.map +1 -1
  226. package/lib/components/Email/EmailDisplay.d.ts.map +1 -1
  227. package/lib/components/Email/EmailDisplay.js +2 -2
  228. package/lib/components/Email/EmailDisplay.js.map +1 -1
  229. package/lib/components/EmptyState/EmptyState.d.ts.map +1 -1
  230. package/lib/components/EmptyState/EmptyState.js +5 -2
  231. package/lib/components/EmptyState/EmptyState.js.map +1 -1
  232. package/lib/components/FieldGroup/FieldGroup.d.ts +6 -0
  233. package/lib/components/FieldGroup/FieldGroup.d.ts.map +1 -1
  234. package/lib/components/FieldGroup/FieldGroup.js +36 -14
  235. package/lib/components/FieldGroup/FieldGroup.js.map +1 -1
  236. package/lib/components/FieldGroup/FieldGroupList.d.ts +1 -0
  237. package/lib/components/FieldGroup/FieldGroupList.d.ts.map +1 -1
  238. package/lib/components/FieldGroup/FieldGroupList.js +18 -18
  239. package/lib/components/FieldGroup/FieldGroupList.js.map +1 -1
  240. package/lib/components/FieldValueList/FieldValueList.d.ts +14 -10
  241. package/lib/components/FieldValueList/FieldValueList.d.ts.map +1 -1
  242. package/lib/components/FieldValueList/FieldValueList.js +13 -5
  243. package/lib/components/FieldValueList/FieldValueList.js.map +1 -1
  244. package/lib/components/FieldValueList/FieldValueList.test-ids.d.ts +2 -2
  245. package/lib/components/FieldValueList/FieldValueList.test-ids.d.ts.map +1 -1
  246. package/lib/components/FieldValueList/index.d.ts +1 -1
  247. package/lib/components/FieldValueList/index.d.ts.map +1 -1
  248. package/lib/components/FieldValueList/index.js.map +1 -1
  249. package/lib/components/File/CompactList.d.ts +15 -0
  250. package/lib/components/File/CompactList.d.ts.map +1 -0
  251. package/lib/components/File/CompactList.js +21 -0
  252. package/lib/components/File/CompactList.js.map +1 -0
  253. package/lib/components/File/File.test-ids.d.ts +1 -1
  254. package/lib/components/File/File.test-ids.d.ts.map +1 -1
  255. package/lib/components/File/FileDisplay.d.ts +5 -0
  256. package/lib/components/File/FileDisplay.d.ts.map +1 -1
  257. package/lib/components/File/FileDisplay.js +2 -2
  258. package/lib/components/File/FileDisplay.js.map +1 -1
  259. package/lib/components/File/FileDisplayList.d.ts +10 -0
  260. package/lib/components/File/FileDisplayList.d.ts.map +1 -0
  261. package/lib/components/File/FileDisplayList.js +14 -0
  262. package/lib/components/File/FileDisplayList.js.map +1 -0
  263. package/lib/components/File/FileInput.d.ts +38 -9
  264. package/lib/components/File/FileInput.d.ts.map +1 -1
  265. package/lib/components/File/FileInput.js +183 -72
  266. package/lib/components/File/FileInput.js.map +1 -1
  267. package/lib/components/File/FileInput.styles.d.ts +26 -0
  268. package/lib/components/File/FileInput.styles.d.ts.map +1 -0
  269. package/lib/components/File/FileInput.styles.js +166 -0
  270. package/lib/components/File/FileInput.styles.js.map +1 -0
  271. package/lib/components/File/FileItem.d.ts +18 -4
  272. package/lib/components/File/FileItem.d.ts.map +1 -1
  273. package/lib/components/File/FileItem.js +84 -30
  274. package/lib/components/File/FileItem.js.map +1 -1
  275. package/lib/components/File/FileList.d.ts +20 -0
  276. package/lib/components/File/FileList.d.ts.map +1 -0
  277. package/lib/components/File/FileList.js +66 -0
  278. package/lib/components/File/FileList.js.map +1 -0
  279. package/lib/components/File/FileUploadItem.d.ts +4 -0
  280. package/lib/components/File/FileUploadItem.d.ts.map +1 -1
  281. package/lib/components/File/FileUploadItem.js +42 -38
  282. package/lib/components/File/FileUploadItem.js.map +1 -1
  283. package/lib/components/File/index.d.ts +4 -0
  284. package/lib/components/File/index.d.ts.map +1 -1
  285. package/lib/components/File/index.js +2 -0
  286. package/lib/components/File/index.js.map +1 -1
  287. package/lib/components/Flex/Flex.js.map +1 -1
  288. package/lib/components/Form/Form.d.ts +1 -1
  289. package/lib/components/Form/Form.test-ids.d.ts +1 -1
  290. package/lib/components/Form/Form.test-ids.d.ts.map +1 -1
  291. package/lib/components/FormField/FormField.d.ts +2 -2
  292. package/lib/components/FormField/FormField.d.ts.map +1 -1
  293. package/lib/components/FormField/FormField.js +45 -60
  294. package/lib/components/FormField/FormField.js.map +1 -1
  295. package/lib/components/FormField/FormField.test-ids.d.ts +1 -1
  296. package/lib/components/FormField/FormField.test-ids.d.ts.map +1 -1
  297. package/lib/components/Fullscreen/Fullscreen.d.ts +18 -0
  298. package/lib/components/Fullscreen/Fullscreen.d.ts.map +1 -0
  299. package/lib/components/Fullscreen/Fullscreen.js +56 -0
  300. package/lib/components/Fullscreen/Fullscreen.js.map +1 -0
  301. package/lib/components/Fullscreen/Fullscreen.test-ids.d.ts +2 -0
  302. package/lib/components/Fullscreen/Fullscreen.test-ids.d.ts.map +1 -0
  303. package/lib/components/Fullscreen/Fullscreen.test-ids.js +3 -0
  304. package/lib/components/Fullscreen/Fullscreen.test-ids.js.map +1 -0
  305. package/lib/components/Fullscreen/FullscreenButton.d.ts +6 -0
  306. package/lib/components/Fullscreen/FullscreenButton.d.ts.map +1 -0
  307. package/lib/components/Fullscreen/FullscreenButton.js +33 -0
  308. package/lib/components/Fullscreen/FullscreenButton.js.map +1 -0
  309. package/lib/components/Fullscreen/index.d.ts +4 -0
  310. package/lib/components/Fullscreen/index.d.ts.map +1 -0
  311. package/lib/components/Fullscreen/index.js +4 -0
  312. package/lib/components/Fullscreen/index.js.map +1 -0
  313. package/lib/components/HTML/HTML.d.ts +1 -1
  314. package/lib/components/HTML/HTML.test-ids.d.ts +1 -1
  315. package/lib/components/HTML/HTML.test-ids.d.ts.map +1 -1
  316. package/lib/components/Icon/Icon.d.ts.map +1 -1
  317. package/lib/components/Icon/Icon.js +1 -1
  318. package/lib/components/Icon/Icon.js.map +1 -1
  319. package/lib/components/Icon/iconNames.d.ts +1 -1
  320. package/lib/components/Icon/iconNames.d.ts.map +1 -1
  321. package/lib/components/Icon/iconNames.js +2 -0
  322. package/lib/components/Icon/iconNames.js.map +1 -1
  323. package/lib/components/Icon/icons/calendar-now.icon.d.ts +5 -0
  324. package/lib/components/Icon/icons/calendar-now.icon.d.ts.map +1 -0
  325. package/lib/components/Icon/icons/calendar-now.icon.js +7 -0
  326. package/lib/components/Icon/icons/calendar-now.icon.js.map +1 -0
  327. package/lib/components/Icon/icons/preview.icon.d.ts +5 -0
  328. package/lib/components/Icon/icons/preview.icon.d.ts.map +1 -0
  329. package/lib/components/Icon/icons/preview.icon.js +7 -0
  330. package/lib/components/Icon/icons/preview.icon.js.map +1 -0
  331. package/lib/components/Icon/streamline-icons/arrow-down.icon.js +1 -1
  332. package/lib/components/Icon/streamline-icons/arrow-down.icon.js.map +1 -1
  333. package/lib/components/Icon/streamline-icons/arrow-left.icon.js +1 -1
  334. package/lib/components/Icon/streamline-icons/arrow-left.icon.js.map +1 -1
  335. package/lib/components/Icon/streamline-icons/arrow-micro-down.icon.js +1 -1
  336. package/lib/components/Icon/streamline-icons/arrow-micro-down.icon.js.map +1 -1
  337. package/lib/components/Icon/streamline-icons/arrow-micro-left.icon.js +1 -1
  338. package/lib/components/Icon/streamline-icons/arrow-micro-left.icon.js.map +1 -1
  339. package/lib/components/Icon/streamline-icons/arrow-micro-right.icon.js +1 -1
  340. package/lib/components/Icon/streamline-icons/arrow-micro-right.icon.js.map +1 -1
  341. package/lib/components/Icon/streamline-icons/arrow-micro-up.icon.js +1 -1
  342. package/lib/components/Icon/streamline-icons/arrow-micro-up.icon.js.map +1 -1
  343. package/lib/components/Icon/streamline-icons/arrow-right.icon.js +1 -1
  344. package/lib/components/Icon/streamline-icons/arrow-right.icon.js.map +1 -1
  345. package/lib/components/Icon/streamline-icons/arrow-up.icon.js +1 -1
  346. package/lib/components/Icon/streamline-icons/arrow-up.icon.js.map +1 -1
  347. package/lib/components/Icon/streamline-icons/calendar-now.icon.d.ts +5 -0
  348. package/lib/components/Icon/streamline-icons/calendar-now.icon.d.ts.map +1 -0
  349. package/lib/components/Icon/streamline-icons/calendar-now.icon.js +7 -0
  350. package/lib/components/Icon/streamline-icons/calendar-now.icon.js.map +1 -0
  351. package/lib/components/Icon/streamline-icons/caret-down.icon.js +1 -1
  352. package/lib/components/Icon/streamline-icons/caret-down.icon.js.map +1 -1
  353. package/lib/components/Icon/streamline-icons/caret-left.icon.js +1 -1
  354. package/lib/components/Icon/streamline-icons/caret-left.icon.js.map +1 -1
  355. package/lib/components/Icon/streamline-icons/caret-right.icon.js +1 -1
  356. package/lib/components/Icon/streamline-icons/caret-right.icon.js.map +1 -1
  357. package/lib/components/Icon/streamline-icons/caret-up.icon.js +1 -1
  358. package/lib/components/Icon/streamline-icons/caret-up.icon.js.map +1 -1
  359. package/lib/components/Icon/streamline-icons/case-solid.icon.d.ts +1 -1
  360. package/lib/components/Icon/streamline-icons/case-solid.icon.d.ts.map +1 -1
  361. package/lib/components/Icon/streamline-icons/case-solid.icon.js +2 -2
  362. package/lib/components/Icon/streamline-icons/case-solid.icon.js.map +1 -1
  363. package/lib/components/Icon/streamline-icons/clipboard-pencil-solid.icon.d.ts.map +1 -1
  364. package/lib/components/Icon/streamline-icons/clipboard-pencil-solid.icon.js +2 -2
  365. package/lib/components/Icon/streamline-icons/clipboard-pencil-solid.icon.js.map +1 -1
  366. package/lib/components/Icon/streamline-icons/clock-solid.icon.d.ts.map +1 -1
  367. package/lib/components/Icon/streamline-icons/clock-solid.icon.js +2 -2
  368. package/lib/components/Icon/streamline-icons/clock-solid.icon.js.map +1 -1
  369. package/lib/components/Icon/streamline-icons/disc-stack-solid.icon.d.ts.map +1 -1
  370. package/lib/components/Icon/streamline-icons/disc-stack-solid.icon.js +2 -2
  371. package/lib/components/Icon/streamline-icons/disc-stack-solid.icon.js.map +1 -1
  372. package/lib/components/Icon/streamline-icons/dock.icon.d.ts +5 -0
  373. package/lib/components/Icon/streamline-icons/dock.icon.d.ts.map +1 -0
  374. package/lib/components/Icon/streamline-icons/dock.icon.js +7 -0
  375. package/lib/components/Icon/streamline-icons/dock.icon.js.map +1 -0
  376. package/lib/components/Icon/streamline-icons/drag.icon.js +1 -1
  377. package/lib/components/Icon/streamline-icons/drag.icon.js.map +1 -1
  378. package/lib/components/Icon/streamline-icons/expression.icon.d.ts +5 -0
  379. package/lib/components/Icon/streamline-icons/expression.icon.d.ts.map +1 -0
  380. package/lib/components/Icon/streamline-icons/expression.icon.js +7 -0
  381. package/lib/components/Icon/streamline-icons/expression.icon.js.map +1 -0
  382. package/lib/components/Icon/streamline-icons/indent.icon.d.ts +5 -0
  383. package/lib/components/Icon/streamline-icons/indent.icon.d.ts.map +1 -0
  384. package/lib/components/Icon/streamline-icons/indent.icon.js +7 -0
  385. package/lib/components/Icon/streamline-icons/indent.icon.js.map +1 -0
  386. package/lib/components/Icon/streamline-icons/information-solid.icon.d.ts +5 -0
  387. package/lib/components/Icon/streamline-icons/information-solid.icon.d.ts.map +1 -0
  388. package/lib/components/Icon/streamline-icons/information-solid.icon.js +7 -0
  389. package/lib/components/Icon/streamline-icons/information-solid.icon.js.map +1 -0
  390. package/lib/components/Icon/streamline-icons/list-number.icon.d.ts +5 -0
  391. package/lib/components/Icon/streamline-icons/list-number.icon.d.ts.map +1 -0
  392. package/lib/components/Icon/streamline-icons/list-number.icon.js +7 -0
  393. package/lib/components/Icon/streamline-icons/list-number.icon.js.map +1 -0
  394. package/lib/components/Icon/streamline-icons/micro-arrow-down.icon.d.ts +5 -0
  395. package/lib/components/Icon/streamline-icons/micro-arrow-down.icon.d.ts.map +1 -0
  396. package/lib/components/Icon/streamline-icons/micro-arrow-down.icon.js +7 -0
  397. package/lib/components/Icon/streamline-icons/micro-arrow-down.icon.js.map +1 -0
  398. package/lib/components/Icon/streamline-icons/micro-arrow-left.icon.d.ts +5 -0
  399. package/lib/components/Icon/streamline-icons/micro-arrow-left.icon.d.ts.map +1 -0
  400. package/lib/components/Icon/streamline-icons/micro-arrow-left.icon.js +7 -0
  401. package/lib/components/Icon/streamline-icons/micro-arrow-left.icon.js.map +1 -0
  402. package/lib/components/Icon/streamline-icons/micro-arrow-right.icon.d.ts +5 -0
  403. package/lib/components/Icon/streamline-icons/micro-arrow-right.icon.d.ts.map +1 -0
  404. package/lib/components/Icon/streamline-icons/micro-arrow-right.icon.js +7 -0
  405. package/lib/components/Icon/streamline-icons/micro-arrow-right.icon.js.map +1 -0
  406. package/lib/components/Icon/streamline-icons/micro-arrow-up.icon.d.ts +5 -0
  407. package/lib/components/Icon/streamline-icons/micro-arrow-up.icon.d.ts.map +1 -0
  408. package/lib/components/Icon/streamline-icons/micro-arrow-up.icon.js +7 -0
  409. package/lib/components/Icon/streamline-icons/micro-arrow-up.icon.js.map +1 -0
  410. package/lib/components/Icon/streamline-icons/minus.icon.d.ts.map +1 -1
  411. package/lib/components/Icon/streamline-icons/minus.icon.js +1 -1
  412. package/lib/components/Icon/streamline-icons/minus.icon.js.map +1 -1
  413. package/lib/components/Icon/streamline-icons/open.icon.js +1 -1
  414. package/lib/components/Icon/streamline-icons/open.icon.js.map +1 -1
  415. package/lib/components/Icon/streamline-icons/plus.icon.d.ts.map +1 -1
  416. package/lib/components/Icon/streamline-icons/plus.icon.js +1 -1
  417. package/lib/components/Icon/streamline-icons/plus.icon.js.map +1 -1
  418. package/lib/components/Icon/streamline-icons/rule-library-solid.icon.d.ts.map +1 -1
  419. package/lib/components/Icon/streamline-icons/rule-library-solid.icon.js +2 -2
  420. package/lib/components/Icon/streamline-icons/rule-library-solid.icon.js.map +1 -1
  421. package/lib/components/Icon/streamline-icons/search-analytics-solid.icon.d.ts.map +1 -1
  422. package/lib/components/Icon/streamline-icons/search-analytics-solid.icon.js +2 -2
  423. package/lib/components/Icon/streamline-icons/search-analytics-solid.icon.js.map +1 -1
  424. package/lib/components/Icon/streamline-icons/times.icon.d.ts.map +1 -1
  425. package/lib/components/Icon/streamline-icons/times.icon.js +1 -1
  426. package/lib/components/Icon/streamline-icons/times.icon.js.map +1 -1
  427. package/lib/components/Icon/streamline-icons/undock.icon.d.ts +5 -0
  428. package/lib/components/Icon/streamline-icons/undock.icon.d.ts.map +1 -0
  429. package/lib/components/Icon/streamline-icons/undock.icon.js +7 -0
  430. package/lib/components/Icon/streamline-icons/undock.icon.js.map +1 -0
  431. package/lib/components/Icon/streamline-icons/unindent.icon.d.ts +5 -0
  432. package/lib/components/Icon/streamline-icons/unindent.icon.d.ts.map +1 -0
  433. package/lib/components/Icon/streamline-icons/unindent.icon.js +7 -0
  434. package/lib/components/Icon/streamline-icons/unindent.icon.js.map +1 -0
  435. package/lib/components/Icon/streamline-icons/warn-solid.icon.d.ts.map +1 -1
  436. package/lib/components/Icon/streamline-icons/warn-solid.icon.js +2 -2
  437. package/lib/components/Icon/streamline-icons/warn-solid.icon.js.map +1 -1
  438. package/lib/components/Icon/streamlineIconNames.d.ts +1 -1
  439. package/lib/components/Icon/streamlineIconNames.d.ts.map +1 -1
  440. package/lib/components/Icon/streamlineIconNames.js +12 -0
  441. package/lib/components/Icon/streamlineIconNames.js.map +1 -1
  442. package/lib/components/IconPicker/IconPicker.d.ts +7 -1
  443. package/lib/components/IconPicker/IconPicker.d.ts.map +1 -1
  444. package/lib/components/IconPicker/IconPicker.js +20 -14
  445. package/lib/components/IconPicker/IconPicker.js.map +1 -1
  446. package/lib/components/Input/Input.d.ts +5 -8
  447. package/lib/components/Input/Input.d.ts.map +1 -1
  448. package/lib/components/Input/Input.js +2 -3
  449. package/lib/components/Input/Input.js.map +1 -1
  450. package/lib/components/Input/Input.test-ids.d.ts +1 -1
  451. package/lib/components/Input/Input.test-ids.d.ts.map +1 -1
  452. package/lib/components/Label/Label.js +2 -2
  453. package/lib/components/Label/Label.js.map +1 -1
  454. package/lib/components/Lightbox/Lightbox.d.ts +1 -1
  455. package/lib/components/Lightbox/Lightbox.d.ts.map +1 -1
  456. package/lib/components/Lightbox/Lightbox.js +21 -12
  457. package/lib/components/Lightbox/Lightbox.js.map +1 -1
  458. package/lib/components/Lightbox/Lightbox.styles.d.ts +1 -1
  459. package/lib/components/Lightbox/Lightbox.test-ids.d.ts +1 -1
  460. package/lib/components/Lightbox/Lightbox.test-ids.d.ts.map +1 -1
  461. package/lib/components/Lightbox/Lightbox.types.d.ts +1 -1
  462. package/lib/components/Lightbox/Lightbox.types.d.ts.map +1 -1
  463. package/lib/components/Lightbox/Lightbox.types.js.map +1 -1
  464. package/lib/components/Link/Link.d.ts +5 -2
  465. package/lib/components/Link/Link.d.ts.map +1 -1
  466. package/lib/components/Link/Link.js +28 -16
  467. package/lib/components/Link/Link.js.map +1 -1
  468. package/lib/components/Link/Link.test-ids.d.ts +1 -1
  469. package/lib/components/Link/Link.test-ids.d.ts.map +1 -1
  470. package/lib/components/ListToolbar/ListToolbar.d.ts +1 -1
  471. package/lib/components/ListToolbar/ListToolbar.d.ts.map +1 -1
  472. package/lib/components/ListToolbar/ListToolbar.js +9 -8
  473. package/lib/components/ListToolbar/ListToolbar.js.map +1 -1
  474. package/lib/components/ListToolbar/ListToolbar.styles.d.ts.map +1 -1
  475. package/lib/components/ListToolbar/ListToolbar.styles.js +6 -9
  476. package/lib/components/ListToolbar/ListToolbar.styles.js.map +1 -1
  477. package/lib/components/ListToolbar/ListToolbar.test-ids.d.ts +1 -1
  478. package/lib/components/ListToolbar/ListToolbar.test-ids.d.ts.map +1 -1
  479. package/lib/components/ListToolbar/ListToolbar.test-ids.js +4 -1
  480. package/lib/components/ListToolbar/ListToolbar.test-ids.js.map +1 -1
  481. package/lib/components/ListToolbar/ListToolbar.types.d.ts +7 -3
  482. package/lib/components/ListToolbar/ListToolbar.types.d.ts.map +1 -1
  483. package/lib/components/ListToolbar/ListToolbar.types.js.map +1 -1
  484. package/lib/components/ListToolbar/PresetMenuPopover.d.ts.map +1 -1
  485. package/lib/components/ListToolbar/PresetMenuPopover.js +2 -2
  486. package/lib/components/ListToolbar/PresetMenuPopover.js.map +1 -1
  487. package/lib/components/ListToolbar/helpers.d.ts.map +1 -1
  488. package/lib/components/ListToolbar/helpers.js.map +1 -1
  489. package/lib/components/Location/CurrentLocationButton.d.ts +1 -6
  490. package/lib/components/Location/CurrentLocationButton.d.ts.map +1 -1
  491. package/lib/components/Location/CurrentLocationButton.js +10 -20
  492. package/lib/components/Location/CurrentLocationButton.js.map +1 -1
  493. package/lib/components/Location/Location.test-ids.d.ts +1 -1
  494. package/lib/components/Location/Location.test-ids.d.ts.map +1 -1
  495. package/lib/components/Location/Location.types.d.ts +49 -17
  496. package/lib/components/Location/Location.types.d.ts.map +1 -1
  497. package/lib/components/Location/Location.types.js +9 -1
  498. package/lib/components/Location/Location.types.js.map +1 -1
  499. package/lib/components/Location/LocationDisplay.d.ts +5 -4
  500. package/lib/components/Location/LocationDisplay.d.ts.map +1 -1
  501. package/lib/components/Location/LocationDisplay.js +17 -4
  502. package/lib/components/Location/LocationDisplay.js.map +1 -1
  503. package/lib/components/Location/LocationInput.d.ts +23 -18
  504. package/lib/components/Location/LocationInput.d.ts.map +1 -1
  505. package/lib/components/Location/LocationInput.js +37 -15
  506. package/lib/components/Location/LocationInput.js.map +1 -1
  507. package/lib/components/Location/LocationView.d.ts +26 -12
  508. package/lib/components/Location/LocationView.d.ts.map +1 -1
  509. package/lib/components/Location/LocationView.js +103 -50
  510. package/lib/components/Location/LocationView.js.map +1 -1
  511. package/lib/components/Location/index.d.ts +2 -2
  512. package/lib/components/Location/index.d.ts.map +1 -1
  513. package/lib/components/Location/index.js +1 -1
  514. package/lib/components/Location/index.js.map +1 -1
  515. package/lib/components/Location/utils.d.ts +20 -2
  516. package/lib/components/Location/utils.d.ts.map +1 -1
  517. package/lib/components/Location/utils.js +184 -41
  518. package/lib/components/Location/utils.js.map +1 -1
  519. package/lib/components/Menu/Menu.context.d.ts.map +1 -1
  520. package/lib/components/Menu/Menu.context.js +1 -0
  521. package/lib/components/Menu/Menu.context.js.map +1 -1
  522. package/lib/components/Menu/Menu.d.ts +1 -1
  523. package/lib/components/Menu/Menu.d.ts.map +1 -1
  524. package/lib/components/Menu/Menu.js +6 -2
  525. package/lib/components/Menu/Menu.js.map +1 -1
  526. package/lib/components/Menu/Menu.styles.d.ts +0 -1
  527. package/lib/components/Menu/Menu.styles.d.ts.map +1 -1
  528. package/lib/components/Menu/Menu.styles.js +5 -12
  529. package/lib/components/Menu/Menu.styles.js.map +1 -1
  530. package/lib/components/Menu/Menu.test-ids.d.ts +2 -2
  531. package/lib/components/Menu/Menu.test-ids.d.ts.map +1 -1
  532. package/lib/components/Menu/Menu.types.d.ts +14 -2
  533. package/lib/components/Menu/Menu.types.d.ts.map +1 -1
  534. package/lib/components/Menu/Menu.types.js.map +1 -1
  535. package/lib/components/Menu/Menu.utils.d.ts +4 -0
  536. package/lib/components/Menu/Menu.utils.d.ts.map +1 -0
  537. package/lib/components/Menu/Menu.utils.js +6 -0
  538. package/lib/components/Menu/Menu.utils.js.map +1 -0
  539. package/lib/components/Menu/MenuGroup.js +2 -2
  540. package/lib/components/Menu/MenuGroup.js.map +1 -1
  541. package/lib/components/Menu/MenuItem.d.ts +1 -1
  542. package/lib/components/Menu/MenuItem.d.ts.map +1 -1
  543. package/lib/components/Menu/MenuItem.js +3 -3
  544. package/lib/components/Menu/MenuItem.js.map +1 -1
  545. package/lib/components/Menu/MenuList.d.ts.map +1 -1
  546. package/lib/components/Menu/MenuList.js +3 -3
  547. package/lib/components/Menu/MenuList.js.map +1 -1
  548. package/lib/components/Menu/NavItemsList.d.ts.map +1 -1
  549. package/lib/components/Menu/NavItemsList.js +1 -3
  550. package/lib/components/Menu/NavItemsList.js.map +1 -1
  551. package/lib/components/Menu/index.d.ts +1 -0
  552. package/lib/components/Menu/index.d.ts.map +1 -1
  553. package/lib/components/Menu/index.js +1 -0
  554. package/lib/components/Menu/index.js.map +1 -1
  555. package/lib/components/MenuButton/MenuButton.d.ts +8 -1
  556. package/lib/components/MenuButton/MenuButton.d.ts.map +1 -1
  557. package/lib/components/MenuButton/MenuButton.js +15 -5
  558. package/lib/components/MenuButton/MenuButton.js.map +1 -1
  559. package/lib/components/MenuButton/MenuButton.test-ids.d.ts +1 -1
  560. package/lib/components/MenuButton/MenuButton.test-ids.d.ts.map +1 -1
  561. package/lib/components/MetaList/MetaList.d.ts +1 -1
  562. package/lib/components/MetaList/MetaList.test-ids.d.ts +1 -1
  563. package/lib/components/MetaList/MetaList.test-ids.d.ts.map +1 -1
  564. package/lib/components/Modal/Modal.d.ts.map +1 -1
  565. package/lib/components/Modal/Modal.js +10 -3
  566. package/lib/components/Modal/Modal.js.map +1 -1
  567. package/lib/components/Modal/Modal.styles.d.ts.map +1 -1
  568. package/lib/components/Modal/Modal.styles.js +24 -3
  569. package/lib/components/Modal/Modal.styles.js.map +1 -1
  570. package/lib/components/Modal/ModalManager.d.ts.map +1 -1
  571. package/lib/components/Modal/ModalManager.js +5 -1
  572. package/lib/components/Modal/ModalManager.js.map +1 -1
  573. package/lib/components/Number/Number.test-ids.d.ts +2 -2
  574. package/lib/components/Number/Number.test-ids.d.ts.map +1 -1
  575. package/lib/components/Number/NumberInput.d.ts +1 -1
  576. package/lib/components/Number/NumberInput.d.ts.map +1 -1
  577. package/lib/components/Number/NumberInput.js +11 -3
  578. package/lib/components/Number/NumberInput.js.map +1 -1
  579. package/lib/components/Number/NumberRangeInput.d.ts +1 -1
  580. package/lib/components/Number/NumberRangeInput.d.ts.map +1 -1
  581. package/lib/components/Number/NumberRangeInput.js +5 -69
  582. package/lib/components/Number/NumberRangeInput.js.map +1 -1
  583. package/lib/components/PageTemplates/CategorySubPage.styles.d.ts +3 -1
  584. package/lib/components/PageTemplates/CategorySubPage.styles.d.ts.map +1 -1
  585. package/lib/components/PageTemplates/CategorySubPage.styles.js +3 -2
  586. package/lib/components/PageTemplates/CategorySubPage.styles.js.map +1 -1
  587. package/lib/components/PageTemplates/DashboardPage.d.ts.map +1 -1
  588. package/lib/components/PageTemplates/DashboardPage.js +41 -6
  589. package/lib/components/PageTemplates/DashboardPage.js.map +1 -1
  590. package/lib/components/PageTemplates/PageTemplates.d.ts +1 -0
  591. package/lib/components/PageTemplates/PageTemplates.d.ts.map +1 -1
  592. package/lib/components/PageTemplates/PageTemplates.js +84 -31
  593. package/lib/components/PageTemplates/PageTemplates.js.map +1 -1
  594. package/lib/components/Phone/Phone.test-ids.d.ts +1 -1
  595. package/lib/components/Phone/Phone.test-ids.d.ts.map +1 -1
  596. package/lib/components/Phone/PhoneDisplay.d.ts.map +1 -1
  597. package/lib/components/Phone/PhoneDisplay.js +2 -2
  598. package/lib/components/Phone/PhoneDisplay.js.map +1 -1
  599. package/lib/components/Phone/PhoneInput.d.ts +1 -1
  600. package/lib/components/Phone/PhoneInput.d.ts.map +1 -1
  601. package/lib/components/Phone/PhoneInput.js +8 -3
  602. package/lib/components/Phone/PhoneInput.js.map +1 -1
  603. package/lib/components/Popover/Popover.d.ts +2 -0
  604. package/lib/components/Popover/Popover.d.ts.map +1 -1
  605. package/lib/components/Popover/Popover.js +20 -3
  606. package/lib/components/Popover/Popover.js.map +1 -1
  607. package/lib/components/Popover/Popover.styles.d.ts.map +1 -1
  608. package/lib/components/Popover/Popover.styles.js +2 -2
  609. package/lib/components/Popover/Popover.styles.js.map +1 -1
  610. package/lib/components/Popover/modifiers.d.ts.map +1 -1
  611. package/lib/components/Popover/modifiers.js +11 -5
  612. package/lib/components/Popover/modifiers.js.map +1 -1
  613. package/lib/components/Progress/Progress.d.ts.map +1 -1
  614. package/lib/components/Progress/Progress.js +2 -2
  615. package/lib/components/Progress/Progress.js.map +1 -1
  616. package/lib/components/Progress/Progress.styles.d.ts +1 -1
  617. package/lib/components/Progress/Progress.styles.d.ts.map +1 -1
  618. package/lib/components/Progress/Progress.styles.js +9 -9
  619. package/lib/components/Progress/Progress.styles.js.map +1 -1
  620. package/lib/components/Progress/Progress.types.d.ts +4 -0
  621. package/lib/components/Progress/Progress.types.d.ts.map +1 -1
  622. package/lib/components/Progress/Progress.types.js.map +1 -1
  623. package/lib/components/RadioCheck/RadioCheck.d.ts +6 -30
  624. package/lib/components/RadioCheck/RadioCheck.d.ts.map +1 -1
  625. package/lib/components/RadioCheck/RadioCheck.js +3 -4
  626. package/lib/components/RadioCheck/RadioCheck.js.map +1 -1
  627. package/lib/components/SearchInput/SearchInput.d.ts +19 -6
  628. package/lib/components/SearchInput/SearchInput.d.ts.map +1 -1
  629. package/lib/components/SearchInput/SearchInput.js +5 -1
  630. package/lib/components/SearchInput/SearchInput.js.map +1 -1
  631. package/lib/components/SearchInput/SearchInput.styles.d.ts +3 -3
  632. package/lib/components/SearchInput/SearchInput.styles.d.ts.map +1 -1
  633. package/lib/components/SearchInput/SearchInput.styles.js +15 -15
  634. package/lib/components/SearchInput/SearchInput.styles.js.map +1 -1
  635. package/lib/components/Select/Select.d.ts +1 -1
  636. package/lib/components/Select/Select.test-ids.d.ts +1 -1
  637. package/lib/components/Select/Select.test-ids.d.ts.map +1 -1
  638. package/lib/components/Slider/Slider.d.ts +1 -1
  639. package/lib/components/Slider/Slider.test-ids.d.ts +1 -1
  640. package/lib/components/Slider/Slider.test-ids.d.ts.map +1 -1
  641. package/lib/components/SummaryItem/SummaryItem.d.ts +6 -1
  642. package/lib/components/SummaryItem/SummaryItem.d.ts.map +1 -1
  643. package/lib/components/SummaryItem/SummaryItem.js +13 -5
  644. package/lib/components/SummaryItem/SummaryItem.js.map +1 -1
  645. package/lib/components/SummaryItem/SummaryItem.test-ids.d.ts +1 -1
  646. package/lib/components/SummaryItem/SummaryItem.test-ids.d.ts.map +1 -1
  647. package/lib/components/SummaryList/SummaryList.d.ts.map +1 -1
  648. package/lib/components/SummaryList/SummaryList.js +9 -9
  649. package/lib/components/SummaryList/SummaryList.js.map +1 -1
  650. package/lib/components/Switch/Switch.js +2 -2
  651. package/lib/components/Switch/Switch.js.map +1 -1
  652. package/lib/components/Tabs/Tab.d.ts +7 -3
  653. package/lib/components/Tabs/Tab.d.ts.map +1 -1
  654. package/lib/components/Tabs/Tab.js +83 -23
  655. package/lib/components/Tabs/Tab.js.map +1 -1
  656. package/lib/components/Tabs/TabPanel.d.ts +13 -2
  657. package/lib/components/Tabs/TabPanel.d.ts.map +1 -1
  658. package/lib/components/Tabs/TabPanel.js +60 -5
  659. package/lib/components/Tabs/TabPanel.js.map +1 -1
  660. package/lib/components/Tabs/Tabs.d.ts +0 -1
  661. package/lib/components/Tabs/Tabs.d.ts.map +1 -1
  662. package/lib/components/Tabs/Tabs.js +97 -35
  663. package/lib/components/Tabs/Tabs.js.map +1 -1
  664. package/lib/components/Tabs/Tabs.styles.d.ts +17 -0
  665. package/lib/components/Tabs/Tabs.styles.d.ts.map +1 -0
  666. package/lib/components/Tabs/Tabs.styles.js +110 -0
  667. package/lib/components/Tabs/Tabs.styles.js.map +1 -0
  668. package/lib/components/Tabs/TabsContext.d.ts +6 -0
  669. package/lib/components/Tabs/TabsContext.d.ts.map +1 -0
  670. package/lib/components/Tabs/TabsContext.js +6 -0
  671. package/lib/components/Tabs/TabsContext.js.map +1 -0
  672. package/lib/components/Tabs/index.d.ts +1 -0
  673. package/lib/components/Tabs/index.d.ts.map +1 -1
  674. package/lib/components/Tabs/index.js +1 -0
  675. package/lib/components/Tabs/index.js.map +1 -1
  676. package/lib/components/Text/Text.js +1 -1
  677. package/lib/components/Text/Text.js.map +1 -1
  678. package/lib/components/TextArea/TextArea.d.ts +1 -1
  679. package/lib/components/TextArea/TextArea.test-ids.d.ts +1 -1
  680. package/lib/components/TextArea/TextArea.test-ids.d.ts.map +1 -1
  681. package/lib/components/Toaster/Toaster.d.ts +1 -1
  682. package/lib/components/Toaster/Toaster.d.ts.map +1 -1
  683. package/lib/components/Toaster/Toaster.js +88 -19
  684. package/lib/components/Toaster/Toaster.js.map +1 -1
  685. package/lib/components/Toaster/Toaster.test-ids.d.ts +1 -1
  686. package/lib/components/Toaster/Toaster.test-ids.d.ts.map +1 -1
  687. package/lib/components/Toaster/Toaster.types.d.ts +17 -4
  688. package/lib/components/Toaster/Toaster.types.d.ts.map +1 -1
  689. package/lib/components/Toaster/Toaster.types.js.map +1 -1
  690. package/lib/components/Tooltip/Tooltip.d.ts +3 -3
  691. package/lib/components/Tooltip/Tooltip.d.ts.map +1 -1
  692. package/lib/components/Tooltip/Tooltip.js +19 -4
  693. package/lib/components/Tooltip/Tooltip.js.map +1 -1
  694. package/lib/components/Tooltip/Tooltip.test-ids.d.ts +1 -1
  695. package/lib/components/Tooltip/Tooltip.test-ids.d.ts.map +1 -1
  696. package/lib/components/Tree/StandardTree.styles.d.ts +1 -1
  697. package/lib/components/Tree/Tree.d.ts +1 -1
  698. package/lib/components/Tree/Tree.test-ids.d.ts +2 -2
  699. package/lib/components/Tree/Tree.test-ids.d.ts.map +1 -1
  700. package/lib/hooks/index.d.ts +1 -0
  701. package/lib/hooks/index.d.ts.map +1 -1
  702. package/lib/hooks/index.js +1 -0
  703. package/lib/hooks/index.js.map +1 -1
  704. package/lib/hooks/useArrows.d.ts.map +1 -1
  705. package/lib/hooks/useArrows.js +3 -1
  706. package/lib/hooks/useArrows.js.map +1 -1
  707. package/lib/hooks/useEvent.d.ts +5 -0
  708. package/lib/hooks/useEvent.d.ts.map +1 -1
  709. package/lib/hooks/useEvent.js.map +1 -1
  710. package/lib/hooks/useFocusWithin.d.ts.map +1 -1
  711. package/lib/hooks/useFocusWithin.js +14 -8
  712. package/lib/hooks/useFocusWithin.js.map +1 -1
  713. package/lib/hooks/useI18n.d.ts +146 -3
  714. package/lib/hooks/useI18n.d.ts.map +1 -1
  715. package/lib/hooks/useScrollStick.d.ts +3 -3
  716. package/lib/hooks/useScrollStick.d.ts.map +1 -1
  717. package/lib/hooks/useScrollStick.js +6 -5
  718. package/lib/hooks/useScrollStick.js.map +1 -1
  719. package/lib/hooks/useScrollToggle.d.ts.map +1 -1
  720. package/lib/hooks/useScrollToggle.js +1 -0
  721. package/lib/hooks/useScrollToggle.js.map +1 -1
  722. package/lib/hooks/useSimpleStoreInstance.d.ts +9 -0
  723. package/lib/hooks/useSimpleStoreInstance.d.ts.map +1 -0
  724. package/lib/hooks/useSimpleStoreInstance.js +13 -0
  725. package/lib/hooks/useSimpleStoreInstance.js.map +1 -0
  726. package/lib/hooks/useTestIds.d.ts +1 -1
  727. package/lib/hooks/useTestIds.d.ts.map +1 -1
  728. package/lib/hooks/useTestIds.js +1 -1
  729. package/lib/hooks/useTestIds.js.map +1 -1
  730. package/lib/i18n/default.d.ts +146 -3
  731. package/lib/i18n/default.d.ts.map +1 -1
  732. package/lib/i18n/default.js +169 -11
  733. package/lib/i18n/default.js.map +1 -1
  734. package/lib/i18n/i18n.d.ts +146 -3
  735. package/lib/i18n/i18n.d.ts.map +1 -1
  736. package/lib/index.d.ts +2 -0
  737. package/lib/index.d.ts.map +1 -1
  738. package/lib/index.js +2 -0
  739. package/lib/index.js.map +1 -1
  740. package/lib/styles/GlobalStyle.d.ts +1 -1
  741. package/lib/styles/GlobalStyle.d.ts.map +1 -1
  742. package/lib/styles/GlobalStyle.js +6 -1
  743. package/lib/styles/GlobalStyle.js.map +1 -1
  744. package/lib/styles/mixins.d.ts +3 -0
  745. package/lib/styles/mixins.d.ts.map +1 -0
  746. package/lib/styles/mixins.js +14 -0
  747. package/lib/styles/mixins.js.map +1 -0
  748. package/lib/styles/utils.d.ts +11 -5
  749. package/lib/styles/utils.d.ts.map +1 -1
  750. package/lib/styles/utils.js +28 -12
  751. package/lib/styles/utils.js.map +1 -1
  752. package/lib/theme/ThemeMachine.d.ts.map +1 -1
  753. package/lib/theme/ThemeMachine.js.map +1 -1
  754. package/lib/theme/theme.d.ts +18 -0
  755. package/lib/theme/theme.d.ts.map +1 -1
  756. package/lib/theme/themeDefinition.json +9 -2
  757. package/lib/theme/themeOverrides.schema.json +13 -0
  758. package/lib/types/types.d.ts +4 -2
  759. package/lib/types/types.d.ts.map +1 -1
  760. package/lib/types/types.js.map +1 -1
  761. package/lib/utils/formatListToLocaleString.d.ts.map +1 -1
  762. package/lib/utils/formatListToLocaleString.js +5 -2
  763. package/lib/utils/formatListToLocaleString.js.map +1 -1
  764. package/lib/utils/index.d.ts +1 -0
  765. package/lib/utils/index.d.ts.map +1 -1
  766. package/lib/utils/index.js +1 -0
  767. package/lib/utils/index.js.map +1 -1
  768. package/lib/utils/isPositionWithinRect.d.ts +12 -0
  769. package/lib/utils/isPositionWithinRect.d.ts.map +1 -0
  770. package/lib/utils/isPositionWithinRect.js +11 -0
  771. package/lib/utils/isPositionWithinRect.js.map +1 -0
  772. package/lib/utils/withTestIds.d.ts +1 -1
  773. package/package.json +9 -6
  774. package/lib/components/Location/types.d.ts +0 -45
  775. package/lib/components/Location/types.d.ts.map +0 -1
  776. package/lib/components/Location/types.js +0 -10
  777. package/lib/components/Location/types.js.map +0 -1
@@ -1,24 +1,31 @@
1
1
  import { createElement as _createElement } from "react";
2
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { jsxs as _jsxs, Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
3
3
  import { useContext, useReducer, useMemo, useLayoutEffect, useRef, useState, forwardRef, useEffect } from 'react';
4
4
  import { createPortal } from 'react-dom';
5
5
  import styled, { css } from 'styled-components';
6
6
  import Button from '../Button';
7
7
  import Icon, { registerIcon } from '../Icon';
8
+ import Link, { StyledLink } from '../Link';
8
9
  import * as timesIcon from '../Icon/icons/times.icon';
9
- import { createUID, windowIsAvailable, withTestIds } from '../../utils';
10
- import { useConfiguration, useI18n, useLiveLog, useTestIds } from '../../hooks';
10
+ import { createUID, windowIsAvailable, withTestIds, hasProp, getActiveElement, getFocusables } from '../../utils';
11
+ import { useConfiguration, useI18n, useLiveLog, useShortcut, useTestIds, useConsolidatedRef, useEscape } from '../../hooks';
11
12
  import { defaultThemeProp } from '../../theme';
12
13
  import Flex from '../Flex';
13
14
  import '../../init';
15
+ import { registerAction } from '../ShortcutManager';
16
+ import { Keyboard } from '../Badges';
17
+ import { StyledKeyboard } from '../Badges/Keyboard';
14
18
  import { ToasterContext } from './Context';
15
19
  import { getToasterTestIds } from './Toaster.test-ids';
16
20
  registerIcon(timesIcon);
21
+ registerAction({ id: 'JumpToToast', defaultKeyBinding: 'Alt+Enter' }, { id: 'DismissToast', defaultKeyBinding: 'Alt+Q' });
17
22
  const StyledToastButton = styled.button(({ theme }) => css `
18
23
  border: none;
19
24
  color: inherit;
20
25
  padding: 0;
21
26
  font-size: 1rem;
27
+ margin-block: calc(${theme.base.spacing} / 2);
28
+ margin-inline-end: calc(${theme.base.spacing} / 2);
22
29
 
23
30
  &:enabled:hover {
24
31
  background: #ffffff19;
@@ -34,10 +41,15 @@ const StyledToastContent = styled.div(({ theme }) => {
34
41
  display: -webkit-box;
35
42
  -webkit-line-clamp: 2;
36
43
  -webkit-box-orient: vertical;
37
- overflow: hidden;
44
+ overflow: clip;
38
45
  text-overflow: ellipsis;
39
46
  font-size: ${theme.base['font-size']};
40
47
  margin-inline-start: calc(${theme.base['border-radius']} / 2);
48
+ padding-inline-start: calc(${theme.base.spacing} / 2);
49
+
50
+ ${StyledLink} {
51
+ color: ${theme.base.colors.blue.light};
52
+ }
41
53
  `;
42
54
  });
43
55
  StyledToastContent.defaultProps = defaultThemeProp;
@@ -47,7 +59,6 @@ const StyledToast = styled.div(({ theme }) => {
47
59
  inset-block-start: 0;
48
60
  inset-inline-start: 0;
49
61
  width: 100%;
50
- padding: calc(${theme.base.spacing} / 2);
51
62
  background: ${theme.base.colors.slate['extra-dark']};
52
63
  color: ${theme.base.colors.white};
53
64
  border-radius: calc(${theme.base['border-radius']} / 2);
@@ -56,17 +67,31 @@ const StyledToast = styled.div(({ theme }) => {
56
67
  transition-property: transform, opacity;
57
68
  transition-duration: ${theme.base.animation.speed};
58
69
  transition-timing-function: ${theme.base.animation.timing.ease};
70
+ font-weight: ${theme.base['font-weight']['semi-bold']};
71
+
72
+ :focus {
73
+ box-shadow: ${theme.base.shadow.focus};
74
+ }
75
+
76
+ ${StyledKeyboard} {
77
+ color: ${theme.base.palette.light};
78
+ background-color: ${theme.base.colors.gray.dark};
79
+ border-color: ${theme.base.colors.gray.medium};
80
+ inset-block-start: unset;
81
+ }
59
82
  `;
60
83
  });
61
84
  StyledToast.defaultProps = defaultThemeProp;
62
- const StyledToaster = styled.div `
63
- position: fixed;
64
- z-index: ${({ theme }) => theme.base['z-index'].toast};
65
- width: min(40ch, calc(100% - 1rem));
66
- inset-inline-start: 50%;
67
- transform: translateX(-50%);
68
- top: 100%;
69
- `;
85
+ const StyledToaster = styled.div(({ theme }) => {
86
+ return css `
87
+ position: fixed;
88
+ z-index: ${theme.base['z-index'].toast};
89
+ width: min(40ch, calc(100% - 1rem));
90
+ inset-inline-start: 50%;
91
+ transform: translateX(-50%);
92
+ top: 100%;
93
+ `;
94
+ });
70
95
  StyledToaster.defaultProps = defaultThemeProp;
71
96
  function reducer(current, action) {
72
97
  switch (action.type) {
@@ -83,11 +108,15 @@ function reducer(current, action) {
83
108
  return current;
84
109
  }
85
110
  }
86
- const Toast = forwardRef(function Toast({ id, dispatch, topLevelDismiss, dismissAfter, content, translateY, onDismiss, ...restProps }, ref) {
111
+ const Toast = forwardRef(function Toast({ id, firstToast, dispatch, topLevelDismiss, translateY, onDismiss, dismissAfter, ...restProps }, ref) {
87
112
  const [dismissed, setDismissed] = useState(false);
88
113
  const timeoutRef = useRef(NaN);
89
114
  const t = useI18n();
90
115
  const { announcePolite } = useLiveLog();
116
+ const content = hasProp(restProps, 'href') ? t('created') : restProps.content;
117
+ const activeElement = getActiveElement();
118
+ const initiatorRef = activeElement ? new WeakRef(activeElement) : null;
119
+ const containerRef = useConsolidatedRef(ref);
91
120
  useEffect(() => {
92
121
  announcePolite({ message: content, type: 'acknowledgement' });
93
122
  }, []);
@@ -112,11 +141,36 @@ const Toast = forwardRef(function Toast({ id, dispatch, topLevelDismiss, dismiss
112
141
  window.clearTimeout(timeoutRef.current);
113
142
  };
114
143
  }, []);
115
- return (_jsxs(Flex, { ...restProps, container: { alignItems: 'center', gap: 0.25 }, as: StyledToast, ref: ref, style: {
144
+ // Alt+Enter focuses on the first focusable element in the first toast.
145
+ // Tab to the next toast if there are multiple.
146
+ useShortcut('JumpToToast', () => {
147
+ if (firstToast && containerRef.current) {
148
+ getFocusables(containerRef.current)[0]?.focus();
149
+ }
150
+ });
151
+ // Alt+Q dismisses the first toast.
152
+ useShortcut('DismissToast', () => {
153
+ if (firstToast)
154
+ dismiss(false)();
155
+ });
156
+ // Escape dismisses the toast and focuses the initiator.
157
+ useEscape(() => {
158
+ const currentFocus = getActiveElement();
159
+ if (containerRef.current?.contains(currentFocus)) {
160
+ dismiss(false)();
161
+ if (initiatorRef) {
162
+ const initiator = initiatorRef.deref();
163
+ if (initiator instanceof HTMLElement) {
164
+ initiator.focus();
165
+ }
166
+ }
167
+ }
168
+ });
169
+ return (_jsxs(Flex, { ...restProps, "data-app-region": true, container: { alignItems: 'center', gap: 0.25 }, as: StyledToast, ref: containerRef, style: {
116
170
  '--translateY': `${-translateY}px`,
117
171
  '--opacity': dismissed ? '0' : '1',
118
172
  '--scale': dismissed ? '0' : '1'
119
- }, onTransitionEnd: onTransitionEnd, children: [_jsx(Flex, { item: { grow: 1 }, as: StyledToastContent, children: content }), _jsx(Button, { as: StyledToastButton, variant: 'simple', onClick: dismiss(false), icon: true, "aria-label": t('dismiss_label'), children: _jsx(Icon, { name: 'times' }) })] }));
173
+ }, onTransitionEnd: onTransitionEnd, children: [_jsxs(Flex, { item: { grow: 1 }, as: StyledToastContent, children: [content, hasProp(restProps, 'href') ? (_jsxs(_Fragment, { children: [' ', _jsxs(Link, { href: restProps.href, children: ["(", id, "): ", restProps.label] })] })) : undefined] }), _jsxs(Flex, { container: { inline: true, justify: 'end', gap: 0.5 }, children: [_jsx(Keyboard, { keyName: 'Alt' }), _jsx(Keyboard, { keyName: 'Enter' })] }), _jsx(Button, { as: StyledToastButton, variant: 'simple', onClick: dismiss(false), icon: true, "aria-label": t('dismiss_label'), children: _jsx(Icon, { name: 'times' }) })] }));
120
174
  });
121
175
  const Toaster = ({ testId, children, dismissAfter = Infinity, onDismiss }) => {
122
176
  const { portalTarget } = useConfiguration();
@@ -135,7 +189,8 @@ const Toaster = ({ testId, children, dismissAfter = Infinity, onDismiss }) => {
135
189
  push(incoming) {
136
190
  const message = {
137
191
  ...incoming,
138
- id: incoming.id ?? createUID()
192
+ id: incoming.id ?? createUID(),
193
+ dismissAfter: hasProp(incoming, 'href') ? 10000 : incoming.dismissAfter
139
194
  };
140
195
  dispatch({
141
196
  type: 'push',
@@ -155,14 +210,28 @@ const Toaster = ({ testId, children, dismissAfter = Infinity, onDismiss }) => {
155
210
  return (_jsxs(_Fragment, { children: [_jsx(context.Provider, { value: providerValue, children: children }), !!messages.length &&
156
211
  portalTarget &&
157
212
  createPortal(_jsx(StyledToaster, { "data-testid": testIds.root, children: messages.map((message, i) => {
158
- return (_createElement(Toast, { "data-testid": testIds.toast, ...message, translateY: yOffsets[i] ?? 0, topLevelDismiss: onDismiss, dismissAfter: message.dismissAfter ?? dismissAfter, key: message.id, dispatch: dispatch, ref: el => {
213
+ const sharedProps = {
214
+ translateY: yOffsets[i] ?? 0,
215
+ firstToast: i === 0,
216
+ topLevelDismiss: onDismiss,
217
+ dispatch,
218
+ ref: el => {
159
219
  if (el) {
160
220
  heightHashRef.current[message.id] = el.offsetHeight;
161
221
  }
162
222
  else {
163
223
  delete heightHashRef.current[message.id];
164
224
  }
165
- } }));
225
+ }
226
+ };
227
+ if (hasProp(message, 'href')) {
228
+ return (
229
+ // Toast with Link
230
+ _createElement(Toast, { "data-testid": testIds.toast, ...message, ...sharedProps, key: message.id }));
231
+ }
232
+ return (
233
+ // Base Toast
234
+ _createElement(Toast, { "data-testid": testIds.toast, ...message, ...sharedProps, dismissAfter: message.dismissAfter ?? dismissAfter, key: message.id }));
166
235
  }) }), portalTarget)] }));
167
236
  };
168
237
  export default withTestIds(Toaster, getToasterTestIds);
@@ -1 +1 @@
1
- {"version":3,"file":"Toaster.js","sourceRoot":"","sources":["../../../src/components/Toaster/Toaster.tsx"],"names":[],"mappings":";;AAAA,OAAO,EACL,UAAU,EACV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UAAU,CAAC,OAAO,CAAC,CAAC;IACrC,IAAI,QAAQ,CAAC,WAAW,EAAE;QACxB,OAAO,KAAC,OAAO,CAAC,QAAQ,IAAC,KAAK,EAAE,QAAQ,YAAG,QAAQ,GAAoB,CAAC;KACzE;IAED,OAAO,CACL,8BACE,KAAC,OAAO,CAAC,QAAQ,IAAC,KAAK,EAAE,aAAa,YAAG,QAAQ,GAAoB,EACpE,CAAC,CAAC,QAAQ,CAAC,MAAM;gBAChB,YAAY;gBACZ,YAAY,CACV,KAAC,aAAa,mBAAc,OAAO,CAAC,IAAI,YACrC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE,EAAE;wBAC3B,OAAO,CACL,eAAC,KAAK,mBACS,OAAO,CAAC,KAAK,KACtB,OAAO,EACX,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,EAC5B,eAAe,EAAE,SAAS,EAC1B,YAAY,EAAE,OAAO,CAAC,YAAY,IAAI,YAAY,EAClD,GAAG,EAAE,OAAO,CAAC,EAAE,EACf,QAAQ,EAAE,QAAQ,EAClB,GAAG,EAAE,EAAE,CAAC,EAAE;gCACR,IAAI,EAAE,EAAE;oCACN,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC;iCACrD;qCAAM;oCACL,OAAO,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;iCAC1C;4BACH,CAAC,GACD,CACH,CAAC;oBACJ,CAAC,CAAC,GACY,EAChB,YAAY,CACb,IACF,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC","sourcesContent":["import {\n useContext,\n useReducer,\n useMemo,\n useLayoutEffect,\n useRef,\n useState,\n forwardRef,\n useEffect\n} from 'react';\nimport type {\n FunctionComponent,\n CSSProperties,\n TransitionEvent,\n Context,\n PropsWithoutRef,\n Ref,\n Dispatch\n} from 'react';\nimport { createPortal } from 'react-dom';\nimport styled, { css } from 'styled-components';\n\nimport Button from '../Button';\nimport Icon, { registerIcon } from '../Icon';\nimport * as timesIcon from '../Icon/icons/times.icon';\nimport { createUID, windowIsAvailable, withTestIds } from '../../utils';\nimport { useConfiguration, useI18n, useLiveLog, useTestIds } from '../../hooks';\nimport { defaultThemeProp } from '../../theme';\nimport Flex from '../Flex';\nimport '../../init';\n\nimport type { ToastMessage, ToasterProps } from './Toaster.types';\nimport { ToasterContext } from './Context';\nimport type { ToasterContextValue } from './Context';\nimport { getToasterTestIds } from './Toaster.test-ids';\n\nregisterIcon(timesIcon);\n\ninterface ToastState extends ToastMessage {\n id: NonNullable<ToastMessage['id']>;\n}\n\ntype ToastReducerAction =\n | { type: 'push'; payload: ToastState }\n | { type: 'unmount'; payload: ToastState['id'] };\n\ninterface ToastProps extends ToastState {\n topLevelDismiss: ToasterProps['onDismiss'];\n translateY: number;\n dispatch: Dispatch<ToastReducerAction>;\n ref: Ref<HTMLDivElement>;\n}\n\ndeclare module '../../init' {\n export interface CosmosGlobals {\n toasterContext?: Context<ToasterContextValue>;\n }\n}\n\nconst StyledToastButton = styled.button(\n ({ theme }) => css`\n border: none;\n color: inherit;\n padding: 0;\n font-size: 1rem;\n\n &:enabled:hover {\n background: #ffffff19;\n }\n\n &:enabled:focus {\n box-shadow: ${theme.base.shadow.focus};\n }\n `\n);\n\nStyledToastButton.defaultProps = defaultThemeProp;\n\nconst StyledToastContent = styled.div(({ theme }) => {\n return css`\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: hidden;\n text-overflow: ellipsis;\n font-size: ${theme.base['font-size']};\n margin-inline-start: calc(${theme.base['border-radius']} / 2);\n `;\n});\n\nStyledToastContent.defaultProps = defaultThemeProp;\n\nconst StyledToast = styled.div(({ theme }) => {\n return css`\n position: absolute;\n inset-block-start: 0;\n inset-inline-start: 0;\n width: 100%;\n padding: calc(${theme.base.spacing} / 2);\n background: ${theme.base.colors.slate['extra-dark']};\n color: ${theme.base.colors.white};\n border-radius: calc(${theme.base['border-radius']} / 2);\n opacity: var(--opacity);\n transform: translateY(var(--translateY)) scale(var(--scale));\n transition-property: transform, opacity;\n transition-duration: ${theme.base.animation.speed};\n transition-timing-function: ${theme.base.animation.timing.ease};\n `;\n});\n\nStyledToast.defaultProps = defaultThemeProp;\n\nconst StyledToaster = styled.div`\n position: fixed;\n z-index: ${({ theme }) => theme.base['z-index'].toast};\n width: min(40ch, calc(100% - 1rem));\n inset-inline-start: 50%;\n transform: translateX(-50%);\n top: 100%;\n`;\n\nStyledToaster.defaultProps = defaultThemeProp;\n\nfunction reducer(current: ToastState[], action: ToastReducerAction) {\n switch (action.type) {\n case 'push':\n return [\n ...current,\n {\n ...action.payload\n }\n ];\n\n case 'unmount':\n return current.filter(m => m.id !== action.payload);\n\n default:\n return current;\n }\n}\n\nconst Toast: FunctionComponent<ToastProps> = forwardRef(function Toast(\n {\n id,\n dispatch,\n topLevelDismiss,\n dismissAfter,\n content,\n translateY,\n onDismiss,\n ...restProps\n }: PropsWithoutRef<ToastProps>,\n ref: ToastProps['ref']\n) {\n const [dismissed, setDismissed] = useState(false);\n const timeoutRef = useRef(NaN);\n const t = useI18n();\n const { announcePolite } = useLiveLog();\n\n useEffect(() => {\n announcePolite({ message: content, type: 'acknowledgement' });\n }, []);\n\n const onTransitionEnd = (e: TransitionEvent<HTMLDivElement>) => {\n if (dismissed && e.propertyName === 'opacity' && e.target === e.currentTarget) {\n dispatch({ type: 'unmount', payload: id });\n }\n };\n\n const dismiss = (timeout: boolean) => () => {\n clearTimeout(timeoutRef.current);\n if (dismissed) return;\n setDismissed(true);\n onDismiss?.({ id, timeout });\n topLevelDismiss?.({ id, timeout });\n };\n\n useEffect(() => {\n if (Number.isFinite(dismissAfter)) {\n timeoutRef.current = window.setTimeout(dismiss(true), dismissAfter);\n }\n\n return () => {\n window.clearTimeout(timeoutRef.current);\n };\n }, []);\n\n return (\n <Flex\n {...restProps}\n container={{ alignItems: 'center', gap: 0.25 }}\n as={StyledToast}\n ref={ref}\n style={\n {\n '--translateY': `${-translateY}px`,\n '--opacity': dismissed ? '0' : '1',\n '--scale': dismissed ? '0' : '1'\n } as CSSProperties\n }\n onTransitionEnd={onTransitionEnd}\n >\n <Flex item={{ grow: 1 }} as={StyledToastContent}>\n {content}\n </Flex>\n <Button\n as={StyledToastButton}\n variant='simple'\n onClick={dismiss(false)}\n icon\n aria-label={t('dismiss_label')}\n >\n <Icon name='times' />\n </Button>\n </Flex>\n );\n});\n\nconst Toaster: FunctionComponent<ToasterProps> = ({\n testId,\n children,\n dismissAfter = Infinity,\n onDismiss\n}: ToasterProps) => {\n const { portalTarget } = useConfiguration();\n const [messages, dispatch] = useReducer(reducer, []);\n const [yOffsets, setYOffsets] = useState<number[]>([]);\n const heightHashRef = useRef<{\n [id: string]: number;\n }>({});\n const testIds = useTestIds(testId, getToasterTestIds);\n\n // This effect will cause a re-render with a translateY value set for each toast.\n useLayoutEffect(() => {\n const heights = [...messages].reverse().map(({ id }) => heightHashRef.current[id]);\n\n setYOffsets(\n heights\n .map((_, i) => heights.slice(0, i + 1).reduce((sum, cur) => sum + cur + 4, 0))\n .reverse()\n );\n }, [messages.length]);\n\n const providerValue = useMemo(\n () => ({\n push(incoming: ToastMessage) {\n const message: ToastState = {\n ...incoming,\n id: incoming.id ?? createUID()\n };\n\n dispatch({\n type: 'push',\n payload: message\n });\n },\n initialized: true\n }),\n []\n );\n\n // Don't create additional ToasterContext.Providers.\n const context = windowIsAvailable\n ? window.cosmos.toasterContext ?? ToasterContext\n : ToasterContext;\n const priorCtx = useContext(context);\n if (priorCtx.initialized) {\n return <context.Provider value={priorCtx}>{children}</context.Provider>;\n }\n\n return (\n <>\n <context.Provider value={providerValue}>{children}</context.Provider>\n {!!messages.length &&\n portalTarget &&\n createPortal(\n <StyledToaster data-testid={testIds.root}>\n {messages.map((message, i) => {\n return (\n <Toast\n data-testid={testIds.toast}\n {...message}\n translateY={yOffsets[i] ?? 0}\n topLevelDismiss={onDismiss}\n dismissAfter={message.dismissAfter ?? dismissAfter}\n key={message.id}\n dispatch={dispatch}\n ref={el => {\n if (el) {\n heightHashRef.current[message.id] = el.offsetHeight;\n } else {\n delete heightHashRef.current[message.id];\n }\n }}\n />\n );\n })}\n </StyledToaster>,\n portalTarget\n )}\n </>\n );\n};\n\nexport default withTestIds(Toaster, getToasterTestIds);\n"]}
1
+ {"version":3,"file":"Toaster.js","sourceRoot":"","sources":["../../../src/components/Toaster/Toaster.tsx"],"names":[],"mappings":";;AAAA,OAAO,EACL,UAAU,EACV,UAAU,EACV,OAAO,EACP,eAAe,EACf,MAAM,EACN,QAAQ,EACR,UAAU,EACV,SAAS,EACV,MAAM,OAAO,CAAC;AAUf,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AACzC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,IAAI,EAAE,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,IAAI,EAAE,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,KAAK,SAAS,MAAM,0BAA0B,CAAC;AACtD,OAAO,EACL,SAAS,EACT,iBAAiB,EACjB,WAAW,EACX,OAAO,EACP,gBAAgB,EAChB,aAAa,EACd,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,gBAAgB,EAChB,OAAO,EACP,UAAU,EACV,WAAW,EACX,UAAU,EACV,kBAAkB,EAClB,SAAS,EACV,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,IAAI,MAAM,SAAS,CAAC;AAC3B,OAAO,YAAY,CAAC;AACpB,OAAO,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAEpD,OAAO,EAAE,QAAQ,EAAE,MA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AG,EAAE,CAAC,YAAY,CAAC;iCACrD;qCAAM;oCACL,OAAO,aAAa,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;iCAC1C;4BACH,CAAC;yBAC4B,CAAC;wBAEhC,IAAI,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE;4BAC5B,OAAO;4BACL,kBAAkB;4BAClB,eAAC,KAAK,mBACS,OAAO,CAAC,KAAK,KACtB,OAAO,KACP,WAAW,EACf,GAAG,EAAE,OAAO,CAAC,EAAE,GACf,CACH,CAAC;yBACH;wBAED,OAAO;wBACL,aAAa;wBACb,eAAC,KAAK,mBACS,OAAO,CAAC,KAAK,KACtB,OAAO,KACP,WAAW,EACf,YAAY,EAAE,OAAO,CAAC,YAAY,IAAI,YAAY,EAClD,GAAG,EAAE,OAAO,CAAC,EAAE,GACf,CACH,CAAC;oBACJ,CAAC,CAAC,GACY,EAChB,YAAY,CACb,IACF,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC","sourcesContent":["import {\n useContext,\n useReducer,\n useMemo,\n useLayoutEffect,\n useRef,\n useState,\n forwardRef,\n useEffect\n} from 'react';\nimport type {\n FunctionComponent,\n CSSProperties,\n TransitionEvent,\n Context,\n PropsWithoutRef,\n Ref,\n Dispatch\n} from 'react';\nimport { createPortal } from 'react-dom';\nimport styled, { css } from 'styled-components';\n\nimport Button from '../Button';\nimport Icon, { registerIcon } from '../Icon';\nimport Link, { StyledLink } from '../Link';\nimport * as timesIcon from '../Icon/icons/times.icon';\nimport {\n createUID,\n windowIsAvailable,\n withTestIds,\n hasProp,\n getActiveElement,\n getFocusables\n} from '../../utils';\nimport {\n useConfiguration,\n useI18n,\n useLiveLog,\n useShortcut,\n useTestIds,\n useConsolidatedRef,\n useEscape\n} from '../../hooks';\nimport { defaultThemeProp } from '../../theme';\nimport Flex from '../Flex';\nimport '../../init';\nimport { registerAction } from '../ShortcutManager';\nimport type { OmitStrict } from '../../types';\nimport { Keyboard } from '../Badges';\nimport { StyledKeyboard } from '../Badges/Keyboard';\n\nimport type { ToastMessage, ToasterProps, BaseToastMessage, CreatedMessage } from './Toaster.types';\nimport { ToasterContext } from './Context';\nimport type { ToasterContextValue } from './Context';\nimport { getToasterTestIds } from './Toaster.test-ids';\n\nregisterIcon(timesIcon);\nregisterAction(\n { id: 'JumpToToast', defaultKeyBinding: 'Alt+Enter' },\n { id: 'DismissToast', defaultKeyBinding: 'Alt+Q' }\n);\n\ntype ToastState = (\n | OmitStrict<BaseToastMessage, 'dismissAfter'>\n | OmitStrict<CreatedMessage, 'dismissAfter'>\n) & {\n id: NonNullable<ToastMessage['id']>;\n dismissAfter?: number;\n};\n\ntype ToastReducerAction =\n | { type: 'push'; payload: ToastState }\n | { type: 'unmount'; payload: ToastState['id'] };\n\ntype ToastProps = ToastState & {\n // determines if this is the first toast in the list, used to dismiss the first toast with a shortcut, not exposed outside\n firstToast: boolean;\n topLevelDismiss: ToasterProps['onDismiss'];\n translateY: number;\n dispatch: Dispatch<ToastReducerAction>;\n ref: Ref<HTMLDivElement>;\n};\n\ndeclare module '../../init' {\n export interface CosmosGlobals {\n toasterContext?: Context<ToasterContextValue>;\n }\n}\n\nconst StyledToastButton = styled.button(\n ({ theme }) => css`\n border: none;\n color: inherit;\n padding: 0;\n font-size: 1rem;\n margin-block: calc(${theme.base.spacing} / 2);\n margin-inline-end: calc(${theme.base.spacing} / 2);\n\n &:enabled:hover {\n background: #ffffff19;\n }\n\n &:enabled:focus {\n box-shadow: ${theme.base.shadow.focus};\n }\n `\n);\n\nStyledToastButton.defaultProps = defaultThemeProp;\n\nconst StyledToastContent = styled.div(({ theme }) => {\n return css`\n display: -webkit-box;\n -webkit-line-clamp: 2;\n -webkit-box-orient: vertical;\n overflow: clip;\n text-overflow: ellipsis;\n font-size: ${theme.base['font-size']};\n margin-inline-start: calc(${theme.base['border-radius']} / 2);\n padding-inline-start: calc(${theme.base.spacing} / 2);\n\n ${StyledLink} {\n color: ${theme.base.colors.blue.light};\n }\n `;\n});\n\nStyledToastContent.defaultProps = defaultThemeProp;\n\nconst StyledToast = styled.div(({ theme }) => {\n return css`\n position: absolute;\n inset-block-start: 0;\n inset-inline-start: 0;\n width: 100%;\n background: ${theme.base.colors.slate['extra-dark']};\n color: ${theme.base.colors.white};\n border-radius: calc(${theme.base['border-radius']} / 2);\n opacity: var(--opacity);\n transform: translateY(var(--translateY)) scale(var(--scale));\n transition-property: transform, opacity;\n transition-duration: ${theme.base.animation.speed};\n transition-timing-function: ${theme.base.animation.timing.ease};\n font-weight: ${theme.base['font-weight']['semi-bold']};\n\n :focus {\n box-shadow: ${theme.base.shadow.focus};\n }\n\n ${StyledKeyboard} {\n color: ${theme.base.palette.light};\n background-color: ${theme.base.colors.gray.dark};\n border-color: ${theme.base.colors.gray.medium};\n inset-block-start: unset;\n }\n `;\n});\n\nStyledToast.defaultProps = defaultThemeProp;\n\nconst StyledToaster = styled.div(({ theme }) => {\n return css`\n position: fixed;\n z-index: ${theme.base['z-index'].toast};\n width: min(40ch, calc(100% - 1rem));\n inset-inline-start: 50%;\n transform: translateX(-50%);\n top: 100%;\n `;\n});\n\nStyledToaster.defaultProps = defaultThemeProp;\n\nfunction reducer(current: ToastState[], action: ToastReducerAction) {\n switch (action.type) {\n case 'push':\n return [\n ...current,\n {\n ...action.payload\n }\n ];\n\n case 'unmount':\n return current.filter(m => m.id !== action.payload);\n\n default:\n return current;\n }\n}\n\nconst Toast: FunctionComponent<ToastProps> = forwardRef(function Toast(\n {\n id,\n firstToast,\n dispatch,\n topLevelDismiss,\n translateY,\n onDismiss,\n dismissAfter,\n ...restProps\n }: PropsWithoutRef<ToastProps>,\n ref: ToastProps['ref']\n) {\n const [dismissed, setDismissed] = useState(false);\n const timeoutRef = useRef(NaN);\n const t = useI18n();\n const { announcePolite } = useLiveLog();\n const content = hasProp(restProps, 'href') ? t('created') : restProps.content;\n const activeElement = getActiveElement();\n const initiatorRef = activeElement ? new WeakRef(activeElement) : null;\n const containerRef = useConsolidatedRef(ref);\n\n useEffect(() => {\n announcePolite({ message: content, type: 'acknowledgement' });\n }, []);\n\n const onTransitionEnd = (e: TransitionEvent<HTMLDivElement>) => {\n if (dismissed && e.propertyName === 'opacity' && e.target === e.currentTarget) {\n dispatch({ type: 'unmount', payload: id });\n }\n };\n\n const dismiss = (timeout: boolean) => () => {\n clearTimeout(timeoutRef.current);\n if (dismissed) return;\n setDismissed(true);\n onDismiss?.({ id, timeout });\n topLevelDismiss?.({ id, timeout });\n };\n\n useEffect(() => {\n if (Number.isFinite(dismissAfter)) {\n timeoutRef.current = window.setTimeout(dismiss(true), dismissAfter);\n }\n\n return () => {\n window.clearTimeout(timeoutRef.current);\n };\n }, []);\n\n // Alt+Enter focuses on the first focusable element in the first toast.\n // Tab to the next toast if there are multiple.\n useShortcut('JumpToToast', () => {\n if (firstToast && containerRef.current) {\n getFocusables(containerRef.current)[0]?.focus();\n }\n });\n\n // Alt+Q dismisses the first toast.\n useShortcut('DismissToast', () => {\n if (firstToast) dismiss(false)();\n });\n\n // Escape dismisses the toast and focuses the initiator.\n useEscape(() => {\n const currentFocus = getActiveElement();\n if (containerRef.current?.contains(currentFocus)) {\n dismiss(false)();\n if (initiatorRef) {\n const initiator = initiatorRef.deref();\n if (initiator instanceof HTMLElement) {\n initiator.focus();\n }\n }\n }\n });\n\n return (\n <Flex\n {...restProps}\n data-app-region\n container={{ alignItems: 'center', gap: 0.25 }}\n as={StyledToast}\n ref={containerRef}\n style={\n {\n '--translateY': `${-translateY}px`,\n '--opacity': dismissed ? '0' : '1',\n '--scale': dismissed ? '0' : '1'\n } as CSSProperties\n }\n onTransitionEnd={onTransitionEnd}\n >\n <Flex item={{ grow: 1 }} as={StyledToastContent}>\n {content}\n {hasProp(restProps, 'href') ? (\n <>\n {' '}\n <Link href={restProps.href}>\n ({id}): {restProps.label}\n </Link>\n </>\n ) : undefined}\n </Flex>\n <Flex container={{ inline: true, justify: 'end', gap: 0.5 }}>\n <Keyboard keyName='Alt' />\n <Keyboard keyName='Enter' />\n </Flex>\n <Button\n as={StyledToastButton}\n variant='simple'\n onClick={dismiss(false)}\n icon\n aria-label={t('dismiss_label')}\n >\n <Icon name='times' />\n </Button>\n </Flex>\n );\n});\n\nconst Toaster: FunctionComponent<ToasterProps> = ({\n testId,\n children,\n dismissAfter = Infinity,\n onDismiss\n}: ToasterProps) => {\n const { portalTarget } = useConfiguration();\n const [messages, dispatch] = useReducer(reducer, []);\n const [yOffsets, setYOffsets] = useState<number[]>([]);\n const heightHashRef = useRef<{\n [id: string]: number;\n }>({});\n const testIds = useTestIds(testId, getToasterTestIds);\n\n // This effect will cause a re-render with a translateY value set for each toast.\n useLayoutEffect(() => {\n const heights = [...messages].reverse().map(({ id }) => heightHashRef.current[id]);\n\n setYOffsets(\n heights\n .map((_, i) => heights.slice(0, i + 1).reduce((sum, cur) => sum + cur + 4, 0))\n .reverse()\n );\n }, [messages.length]);\n\n const providerValue = useMemo(\n () => ({\n push(incoming: ToastMessage) {\n const message: ToastState = {\n ...incoming,\n id: incoming.id ?? createUID(),\n dismissAfter: hasProp(incoming, 'href') ? 10_000 : incoming.dismissAfter\n };\n\n dispatch({\n type: 'push',\n payload: message\n });\n },\n initialized: true\n }),\n []\n );\n\n // Don't create additional ToasterContext.Providers.\n const context = windowIsAvailable\n ? window.cosmos.toasterContext ?? ToasterContext\n : ToasterContext;\n const priorCtx = useContext(context);\n if (priorCtx.initialized) {\n return <context.Provider value={priorCtx}>{children}</context.Provider>;\n }\n\n return (\n <>\n <context.Provider value={providerValue}>{children}</context.Provider>\n {!!messages.length &&\n portalTarget &&\n createPortal(\n <StyledToaster data-testid={testIds.root}>\n {messages.map((message, i) => {\n const sharedProps = {\n translateY: yOffsets[i] ?? 0,\n firstToast: i === 0,\n topLevelDismiss: onDismiss,\n dispatch,\n ref: el => {\n if (el) {\n heightHashRef.current[message.id] = el.offsetHeight;\n } else {\n delete heightHashRef.current[message.id];\n }\n }\n } satisfies Partial<ToastProps>;\n\n if (hasProp(message, 'href')) {\n return (\n // Toast with Link\n <Toast\n data-testid={testIds.toast}\n {...message}\n {...sharedProps}\n key={message.id}\n />\n );\n }\n\n return (\n // Base Toast\n <Toast\n data-testid={testIds.toast}\n {...message}\n {...sharedProps}\n dismissAfter={message.dismissAfter ?? dismissAfter}\n key={message.id}\n />\n );\n })}\n </StyledToaster>,\n portalTarget\n )}\n </>\n );\n};\n\nexport default withTestIds(Toaster, getToasterTestIds);\n"]}
@@ -1,2 +1,2 @@
1
- export declare const getToasterTestIds: (testIdProp?: string | undefined) => import("../..").TestIdsRecord<readonly ["toast"]>;
1
+ export declare const getToasterTestIds: (testIdProp?: string | null | undefined) => import("../..").TestIdsRecord<readonly ["toast"]>;
2
2
  //# sourceMappingURL=Toaster.test-ids.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Toaster.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/Toaster/Toaster.test-ids.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,wFAA+C,CAAC"}
1
+ {"version":3,"file":"Toaster.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/Toaster/Toaster.test-ids.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,+FAA+C,CAAC"}
@@ -1,6 +1,6 @@
1
- import type { ReactNode } from 'react';
1
+ import type { MouseEventHandler, ReactNode } from 'react';
2
2
  import type { TestIdProp } from '../../types';
3
- export interface ToastMessage {
3
+ export type BaseToastMessage = {
4
4
  /** String to identify the specific message. Used as onDismiss callback arg. */
5
5
  id?: string;
6
6
  /** A short message to provide feedback based upon a user action. */
@@ -16,12 +16,25 @@ export interface ToastMessage {
16
16
  id: NonNullable<ToastMessage['id']>;
17
17
  timeout: boolean;
18
18
  }) => void;
19
- }
19
+ };
20
+ export type CreatedMessage = Pick<BaseToastMessage, 'onDismiss'> & {
21
+ /** String to identify the newly created record. Used as onDismiss callback arg. */
22
+ id: string;
23
+ /** Text of the link. */
24
+ label: string;
25
+ /** Link to newly created record. */
26
+ href: string;
27
+ /** Called when link is clicked. */
28
+ onClick?: MouseEventHandler<HTMLAnchorElement>;
29
+ dismissAfter?: never;
30
+ content?: never;
31
+ };
32
+ export type ToastMessage = BaseToastMessage | CreatedMessage;
20
33
  export interface ToasterProps extends TestIdProp {
21
34
  /** The element(s) responsible for handling the Toaster state. */
22
35
  children: ReactNode;
23
36
  /**
24
- * Time in milliseconds to automatically dismiss Toast.
37
+ * Time in milliseconds to automatically dismiss toast.
25
38
  * Can be set globally on Toaster and overridden individually at a message level.
26
39
  * @default Infinity
27
40
  */
@@ -1 +1 @@
1
- {"version":3,"file":"Toaster.types.d.ts","sourceRoot":"","sources":["../../../src/components/Toaster/Toaster.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,WAAW,YAAY;IAC3B,+EAA+E;IAC/E,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,oEAAoE;IACpE,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,uIAAuI;IACvI,SAAS,CAAC,EAAE,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE;QAAE,EAAE,EAAE,WAAW,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,KAAK,IAAI,CAAC;CAClG;AAED,MAAM,WAAW,YAAa,SAAQ,UAAU;IAC9C,iEAAiE;IACjE,QAAQ,EAAE,SAAS,CAAC;IACpB;;;;OAIG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC,cAAc,CAAC,CAAC;IAC5C,uIAAuI;IACvI,SAAS,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;CACvC"}
1
+ {"version":3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,CAAC;CACvC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Toaster.types.js","sourceRoot":"","sources":["../../../src/components/Toaster/Toaster.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { ReactNode } from 'react';\n\nimport type { TestIdProp } from '../../types';\n\nexport interface ToastMessage {\n /** String to identify the specific message. Used as onDismiss callback arg. */\n id?: string;\n /** A short message to provide feedback based upon a user action. */\n content: string;\n /**\n * Time in milliseconds to automatically dismiss toast.\n * Can be set globally on Toaster and overridden individually at a message level.\n * @default Infinity\n */\n dismissAfter?: number;\n /** Called when user or timer dismisses toasts. Callback is passed the message id and boolean indicating if the dismissal was timed. */\n onDismiss?: ({ id, timeout }: { id: NonNullable<ToastMessage['id']>; timeout: boolean }) => void;\n}\n\nexport interface ToasterProps extends TestIdProp {\n /** The element(s) responsible for handling the Toaster state. */\n children: ReactNode;\n /**\n * Time in milliseconds to automatically dismiss Toast.\n * Can be set globally on Toaster and overridden individually at a message level.\n * @default Infinity\n */\n dismissAfter?: ToastMessage['dismissAfter'];\n /** Called when user or timer dismisses Toasts. Callback is passed the message id and boolean indicating if the dismissal was timed. */\n onDismiss?: ToastMessage['onDismiss'];\n}\n"]}
1
+ {"version":3,"file":"Toaster.types.js","sourceRoot":"","sources":["../../../src/components/Toaster/Toaster.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { MouseEventHandler, ReactNode } from 'react';\n\nimport type { TestIdProp } from '../../types';\n\nexport type BaseToastMessage = {\n /** String to identify the specific message. Used as onDismiss callback arg. */\n id?: string;\n /** A short message to provide feedback based upon a user action. */\n content: string;\n /**\n * Time in milliseconds to automatically dismiss toast.\n * Can be set globally on Toaster and overridden individually at a message level.\n * @default Infinity\n */\n dismissAfter?: number;\n /** Called when user or timer dismisses toasts. Callback is passed the message id and boolean indicating if the dismissal was timed. */\n onDismiss?: ({ id, timeout }: { id: NonNullable<ToastMessage['id']>; timeout: boolean }) => void;\n};\n\nexport type CreatedMessage = Pick<BaseToastMessage, 'onDismiss'> & {\n /** String to identify the newly created record. Used as onDismiss callback arg. */\n id: string;\n /** Text of the link. */\n label: string;\n /** Link to newly created record. */\n href: string;\n /** Called when link is clicked. */\n onClick?: MouseEventHandler<HTMLAnchorElement>;\n dismissAfter?: never;\n content?: never;\n};\n\nexport type ToastMessage = BaseToastMessage | CreatedMessage;\n\nexport interface ToasterProps extends TestIdProp {\n /** The element(s) responsible for handling the Toaster state. */\n children: ReactNode;\n /**\n * Time in milliseconds to automatically dismiss toast.\n * Can be set globally on Toaster and overridden individually at a message level.\n * @default Infinity\n */\n dismissAfter?: ToastMessage['dismissAfter'];\n /** Called when user or timer dismisses Toasts. Callback is passed the message id and boolean indicating if the dismissal was timed. */\n onDismiss?: ToastMessage['onDismiss'];\n}\n"]}
@@ -1,9 +1,9 @@
1
- import type { FunctionComponent, Ref } from 'react';
1
+ import type { FunctionComponent, ReactNode, Ref } from 'react';
2
2
  import type { BaseProps, ForwardProps, TestIdProp } from '../../types';
3
3
  import type { Delay, PopoverProps } from '../Popover';
4
4
  export interface TooltipProps extends BaseProps, TestIdProp {
5
5
  /** Text content for the tooltip. */
6
- children: string | string[];
6
+ children: ReactNode;
7
7
  /** Element to serve as the tooltip's target. */
8
8
  target: Element | null;
9
9
  /**
@@ -41,7 +41,7 @@ export interface TooltipProps extends BaseProps, TestIdProp {
41
41
  }
42
42
  export declare const StyledTooltip: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
43
43
  declare const _default: FunctionComponent<TooltipProps & ForwardProps> & {
44
- getTestIds: (testIdProp?: string | undefined) => import("../../types").TestIdsRecord<readonly []>;
44
+ getTestIds: (testIdProp?: string | null | undefined) => import("../../types").TestIdsRecord<readonly []>;
45
45
  };
46
46
  export default _default;
47
47
  //# sourceMappingURL=Tooltip.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.d.ts","sourceRoot":"","sources":["../../../src/components/Tooltip/Tooltip.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EA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C;IACpB,gDAAgD;IAChD,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IACvB;;;OAGG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC;IAClB;;;OAGG;IACH,SAAS,CAAC,EAAE,KAAK,CAAC;IAClB;;;OAGG;IACH,MAAM,CAAC,EAAE,YAAY,CAAC,QAAQ,CAAC,CAAC;IAChC;;;OAGG;IACH,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB;;;OAGG;IACH,SAAS,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;IACtC;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,GAAG,CAAC,EAAE,GAAG,CAAC,cAAc,CAAC,CAAC;CAC3B;AAED,eAAO,MAAM,aAAa,yGAaxB,CAAC;;;;AA+JH,wBAAuD"}
@@ -3,9 +3,10 @@ import { forwardRef, useCallback, useEffect, useRef, useState } from 'react';
3
3
  import styled, { css } from 'styled-components';
4
4
  import { defaultThemeProp } from '../../theme';
5
5
  import Popover from '../Popover';
6
- import { useConsolidatedRef, useTestIds, useUID } from '../../hooks';
7
- import { calculateFontSize } from '../../styles';
6
+ import { useConsolidatedRef, useTestIds, useTheme, useUID } from '../../hooks';
7
+ import { calculateFontSize, readableHue } from '../../styles';
8
8
  import { getActiveElement, withTestIds } from '../../utils';
9
+ import { ThemeOverride } from '../Configuration';
9
10
  import { getTooltipTestIds } from './Tooltip.test-ids';
10
11
  export const StyledTooltip = styled.div(({ theme }) => {
11
12
  const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);
@@ -27,6 +28,8 @@ const Tooltip = forwardRef(function Tooltip({ testId, children, target, showDela
27
28
  const tooltipRef = useConsolidatedRef(ref);
28
29
  const lastClickedRef = useRef(null);
29
30
  const testIds = useTestIds(testId, getTooltipTestIds);
31
+ const stringContentOnly = typeof children === 'string' ||
32
+ (Array.isArray(children) && children.every(child => typeof child === 'string'));
30
33
  const onMouseDown = useCallback(({ target: eTarget }) => {
31
34
  lastClickedRef.current = eTarget;
32
35
  if (eTarget === tooltipRef.current || eTarget === target)
@@ -40,7 +43,9 @@ const Tooltip = forwardRef(function Tooltip({ testId, children, target, showDela
40
43
  setShow(
41
44
  // This approach may result in a tooltip NOT appearing 1px before it should due to browser specifics. Enhance as needed.
42
45
  // https://stackoverflow.com/a/64747288
43
- smart ? target.scrollWidth > target.clientWidth : true);
46
+ smart
47
+ ? target.scrollWidth > target.clientWidth || target.scrollHeight > target.clientHeight
48
+ : true);
44
49
  };
45
50
  const onFocusIn = () => {
46
51
  showTooltip();
@@ -101,7 +106,17 @@ const Tooltip = forwardRef(function Tooltip({ testId, children, target, showDela
101
106
  }
102
107
  }
103
108
  }, [describeTarget, target, show]);
104
- return (_jsx(Popover, { "data-testid": testIds.root, id: id, ...restProps, show: show, showDelay: showDelay, hideDelay: hideDelay, groupId: 'tooltip', strategy: 'fixed', as: StyledTooltip, role: 'tooltip', target: target, arrow: true, placement: placement, onMouseDown: onMouseDown, hideOnTargetHidden: true, ref: tooltipRef, children: children }));
109
+ const theme = useTheme();
110
+ const tooltipTheme = {
111
+ base: {
112
+ palette: {
113
+ 'primary-background': theme.components.tooltip['background-color'],
114
+ 'foreground-color': theme.components.tooltip['foreground-color'],
115
+ interactive: readableHue(theme.base.palette.interactive, theme.components.tooltip['background-color'])
116
+ }
117
+ }
118
+ };
119
+ return (_jsx(ThemeOverride, { theme: tooltipTheme, children: _jsx(Popover, { "data-testid": testIds.root, id: id, ...restProps, show: show, showDelay: showDelay, hideDelay: hideDelay, groupId: 'tooltip', strategy: 'fixed', as: StyledTooltip, role: stringContentOnly ? 'tooltip' : 'dialog', target: target, arrow: true, placement: placement, onMouseDown: onMouseDown, hideOnTargetHidden: true, ref: tooltipRef, children: children }) }));
105
120
  });
106
121
  export default withTestIds(Tooltip, getTooltipTestIds);
107
122
  //# sourceMappingURL=Tooltip.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../../../src/components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ClB,GAAG,EAAE,UAAU,YAEd,QAAQ,GACD,CACX,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC","sourcesContent":["import { forwardRef, useCallback, useEffect, useRef, useState } from 'react';\nimport type { FunctionComponent, MutableRefObject, PropsWithoutRef, Ref } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport type { BaseProps, ForwardProps, TestIdProp } from '../../types';\nimport { defaultThemeProp } from '../../theme';\nimport Popover from '../Popover';\nimport type { Delay, PopoverProps } from '../Popover';\nimport { useConsolidatedRef, useTestIds, useUID } from '../../hooks';\nimport { calculateFontSize } from '../../styles';\nimport { getActiveElement, withTestIds } from '../../utils';\n\nimport { getTooltipTestIds } from './Tooltip.test-ids';\n\nexport interface TooltipProps extends BaseProps, TestIdProp {\n /** Text content for the tooltip. */\n children: string | string[];\n /** Element to serve as the tooltip's target. */\n target: Element | null;\n /**\n * Delay showing the tooltip on mouseenter.\n * @default 'short'\n */\n showDelay?: Delay;\n /**\n * Delay hiding the tooltip on mouseleave.\n * @default 'long'\n */\n hideDelay?: Delay;\n /**\n * If true, the Tooltip will render outside of the current DOM hierarchy in a [portal](https://reactjs.org/docs/portals.html).\n * @default true\n */\n portal?: PopoverProps['portal'];\n /**\n * If true, the Tooltip will automatically apply an aria-describedby attribute to its target.\n * @default true\n */\n describeTarget?: boolean;\n /**\n * Sets the placement of the tooltip relative to the target.\n * @default 'bottom'\n */\n placement?: PopoverProps['placement'];\n /**\n * Conditionally renders a tooltip only if the associated element's text content is truncated.\n * To work, the associated element must be be displayed as a CSS \"block box\" i.e. block, inline-block, etc...\n * @default false\n */\n smart?: boolean;\n ref?: Ref<HTMLDivElement>;\n}\n\nexport const StyledTooltip = styled.div(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n background-color: ${theme.components.tooltip['background-color']};\n color: ${theme.components.tooltip['foreground-color']};\n font-size: ${fontSize.xxs};\n max-width: 40ch;\n padding: ${theme.base.spacing};\n white-space: pre-line;\n word-break: break-word;\n pointer-events: none;\n `;\n});\n\nStyledTooltip.defaultProps = defaultThemeProp;\n\nconst Tooltip: FunctionComponent<TooltipProps & ForwardProps> = forwardRef(function Tooltip(\n {\n testId,\n children,\n target,\n showDelay = 'short',\n hideDelay = 'long',\n placement = 'bottom',\n describeTarget = true,\n smart,\n ...restProps\n }: PropsWithoutRef<TooltipProps>,\n ref: Ref<HTMLDivElement>\n) {\n const id = useUID();\n const [show, setShow] = useState(false);\n const tooltipRef = useConsolidatedRef(ref);\n const lastClickedRef: MutableRefObject<EventTarget | null> = useRef(null);\n const testIds = useTestIds(testId, getTooltipTestIds);\n\n const onMouseDown = useCallback(\n ({ target: eTarget }: MouseEvent) => {\n lastClickedRef.current = eTarget;\n if (eTarget === tooltipRef.current || eTarget === target) return;\n setShow(false);\n },\n [target]\n );\n\n useEffect(() => {\n if (!target) return;\n\n const showTooltip = () => {\n setShow(\n // This approach may result in a tooltip NOT appearing 1px before it should due to browser specifics. Enhance as needed.\n // https://stackoverflow.com/a/64747288\n smart ? target.scrollWidth > target.clientWidth : true\n );\n };\n\n const onFocusIn = () => {\n showTooltip();\n };\n\n const onFocusOut = () => {\n if (!lastClickedRef.current || lastClickedRef.current !== tooltipRef.current) {\n setShow(false);\n }\n lastClickedRef.current = null;\n };\n\n const onMouseEnter = () => {\n showTooltip();\n };\n\n const onMouseLeave = () => {\n if (getActiveElement() !== target) {\n setShow(false);\n }\n };\n\n const onKeyDown = ({ key }: KeyboardEvent) => {\n if (key === 'Escape' && getActiveElement() === target) {\n setShow(false);\n }\n };\n\n document.addEventListener('keydown', onKeyDown);\n document.addEventListener('mousedown', onMouseDown);\n\n target.addEventListener('focusin', onFocusIn);\n target.addEventListener('focusout', onFocusOut);\n\n target.addEventListener('mouseenter', onMouseEnter);\n target.addEventListener('mouseleave', onMouseLeave);\n\n return () => {\n document.removeEventListener('keydown', onKeyDown);\n document.removeEventListener('mousedown', onMouseDown);\n\n target.removeEventListener('focusin', onFocusIn);\n target.removeEventListener('focusout', onFocusOut);\n\n target.removeEventListener('mouseenter', onMouseEnter);\n target.removeEventListener('mouseleave', onMouseLeave);\n };\n }, [target, onMouseDown, smart]);\n\n useEffect(() => {\n if (target && describeTarget && show) {\n const describedBy = target.getAttribute('aria-describedby');\n // Set the attribute to the old attribute plus the id\n target.setAttribute('aria-describedby', describedBy ? `${describedBy} ${id}` : id);\n } else if (target) {\n // Get the old attribute\n const describedBy = target.getAttribute('aria-describedby');\n if (describedBy) {\n // If the old attribute matches the id just remove it entirely\n if (describedBy === id) {\n target.removeAttribute('aria-describedby');\n } else {\n // Otherwise we want to just remove the id that was added and reset the attribute to what it was before\n const oldDescribedBy = describedBy.replace(new RegExp(`(?:^|\\\\s+)${id}`), '');\n target.setAttribute('aria-describedby', oldDescribedBy);\n }\n }\n }\n }, [describeTarget, target, show]);\n\n return (\n <Popover\n data-testid={testIds.root}\n id={id}\n {...restProps}\n show={show}\n showDelay={showDelay}\n hideDelay={hideDelay}\n groupId='tooltip'\n strategy='fixed'\n as={StyledTooltip}\n role='tooltip'\n target={target}\n arrow\n placement={placement}\n onMouseDown={onMouseDown}\n hideOnTargetHidden\n ref={tooltipRef}\n >\n {children}\n </Popover>\n );\n});\n\nexport default withTestIds(Tooltip, getTooltipTestIds);\n"]}
1
+ {"version":3,"file":"Tooltip.js","sourceRoot":"","sources":["../../../src/components/Tooltip/Tooltip.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE7E,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC/C,OAAO,OAAO,MAAM,YAAY,CAAC;AAEjC,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,Q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O,CAAC,kBAAkB,CAAC,CAC7C;aACF;SACF;KACF,CAAC;IAEF,OAAO,CACL,KAAC,aAAa,IAAC,KAAK,EAAE,YAAY,YAChC,KAAC,OAAO,mBACO,OAAO,CAAC,IAAI,EACzB,EAAE,EAAE,EAAE,KACF,SAAS,EACb,IAAI,EAAE,IAAI,EACV,SAAS,EAAE,SAAS,EACpB,SAAS,EAAE,SAAS,EACpB,OAAO,EAAC,SAAS,EACjB,QAAQ,EAAC,OAAO,EAChB,EAAE,EAAE,aAAa,EACjB,IAAI,EAAE,iBAAiB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,EAC9C,MAAM,EAAE,MAAM,EACd,KAAK,QACL,SAAS,EAAE,SAAS,EACpB,WAAW,EAAE,WAAW,EACxB,kBAAkB,QAClB,GAAG,EAAE,UAAU,YAEd,QAAQ,GACD,GACI,CACjB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,eAAe,WAAW,CAAC,OAAO,EAAE,iBAAiB,CAAC,CAAC","sourcesContent":["import { forwardRef, useCallback, useEffect, useRef, useState } from 'react';\nimport type { FunctionComponent, MutableRefObject, PropsWithoutRef, ReactNode, Ref } from 'react';\nimport styled, { css } from 'styled-components';\n\nimport type { BaseProps, ForwardProps, TestIdProp } from '../../types';\nimport { defaultThemeProp } from '../../theme';\nimport Popover from '../Popover';\nimport type { Delay, PopoverProps } from '../Popover';\nimport { useConsolidatedRef, useTestIds, useTheme, useUID } from '../../hooks';\nimport { calculateFontSize, readableHue } from '../../styles';\nimport { getActiveElement, withTestIds } from '../../utils';\nimport { ThemeOverride } from '../Configuration';\n\nimport { getTooltipTestIds } from './Tooltip.test-ids';\n\nexport interface TooltipProps extends BaseProps, TestIdProp {\n /** Text content for the tooltip. */\n children: ReactNode;\n /** Element to serve as the tooltip's target. */\n target: Element | null;\n /**\n * Delay showing the tooltip on mouseenter.\n * @default 'short'\n */\n showDelay?: Delay;\n /**\n * Delay hiding the tooltip on mouseleave.\n * @default 'long'\n */\n hideDelay?: Delay;\n /**\n * If true, the Tooltip will render outside of the current DOM hierarchy in a [portal](https://reactjs.org/docs/portals.html).\n * @default true\n */\n portal?: PopoverProps['portal'];\n /**\n * If true, the Tooltip will automatically apply an aria-describedby attribute to its target.\n * @default true\n */\n describeTarget?: boolean;\n /**\n * Sets the placement of the tooltip relative to the target.\n * @default 'bottom'\n */\n placement?: PopoverProps['placement'];\n /**\n * Conditionally renders a tooltip only if the associated element's text content is truncated.\n * To work, the associated element must be be displayed as a CSS \"block box\" i.e. block, inline-block, etc...\n * @default false\n */\n smart?: boolean;\n ref?: Ref<HTMLDivElement>;\n}\n\nexport const StyledTooltip = styled.div(({ theme }) => {\n const fontSize = calculateFontSize(theme.base['font-size'], theme.base['font-scale']);\n\n return css`\n background-color: ${theme.components.tooltip['background-color']};\n color: ${theme.components.tooltip['foreground-color']};\n font-size: ${fontSize.xxs};\n max-width: 40ch;\n padding: ${theme.base.spacing};\n white-space: pre-line;\n word-break: break-word;\n pointer-events: none;\n `;\n});\n\nStyledTooltip.defaultProps = defaultThemeProp;\n\nconst Tooltip: FunctionComponent<TooltipProps & ForwardProps> = forwardRef(function Tooltip(\n {\n testId,\n children,\n target,\n showDelay = 'short',\n hideDelay = 'long',\n placement = 'bottom',\n describeTarget = true,\n smart,\n ...restProps\n }: PropsWithoutRef<TooltipProps>,\n ref: Ref<HTMLDivElement>\n) {\n const id = useUID();\n const [show, setShow] = useState(false);\n const tooltipRef = useConsolidatedRef(ref);\n const lastClickedRef: MutableRefObject<EventTarget | null> = useRef(null);\n const testIds = useTestIds(testId, getTooltipTestIds);\n\n const stringContentOnly =\n typeof children === 'string' ||\n (Array.isArray(children) && children.every(child => typeof child === 'string'));\n\n const onMouseDown = useCallback(\n ({ target: eTarget }: MouseEvent) => {\n lastClickedRef.current = eTarget;\n if (eTarget === tooltipRef.current || eTarget === target) return;\n setShow(false);\n },\n [target]\n );\n\n useEffect(() => {\n if (!target) return;\n\n const showTooltip = () => {\n setShow(\n // This approach may result in a tooltip NOT appearing 1px before it should due to browser specifics. Enhance as needed.\n // https://stackoverflow.com/a/64747288\n smart\n ? target.scrollWidth > target.clientWidth || target.scrollHeight > target.clientHeight\n : true\n );\n };\n\n const onFocusIn = () => {\n showTooltip();\n };\n\n const onFocusOut = () => {\n if (!lastClickedRef.current || lastClickedRef.current !== tooltipRef.current) {\n setShow(false);\n }\n lastClickedRef.current = null;\n };\n\n const onMouseEnter = () => {\n showTooltip();\n };\n\n const onMouseLeave = () => {\n if (getActiveElement() !== target) {\n setShow(false);\n }\n };\n\n const onKeyDown = ({ key }: KeyboardEvent) => {\n if (key === 'Escape' && getActiveElement() === target) {\n setShow(false);\n }\n };\n\n document.addEventListener('keydown', onKeyDown);\n document.addEventListener('mousedown', onMouseDown);\n\n target.addEventListener('focusin', onFocusIn);\n target.addEventListener('focusout', onFocusOut);\n\n target.addEventListener('mouseenter', onMouseEnter);\n target.addEventListener('mouseleave', onMouseLeave);\n\n return () => {\n document.removeEventListener('keydown', onKeyDown);\n document.removeEventListener('mousedown', onMouseDown);\n\n target.removeEventListener('focusin', onFocusIn);\n target.removeEventListener('focusout', onFocusOut);\n\n target.removeEventListener('mouseenter', onMouseEnter);\n target.removeEventListener('mouseleave', onMouseLeave);\n };\n }, [target, onMouseDown, smart]);\n\n useEffect(() => {\n if (target && describeTarget && show) {\n const describedBy = target.getAttribute('aria-describedby');\n // Set the attribute to the old attribute plus the id\n target.setAttribute('aria-describedby', describedBy ? `${describedBy} ${id}` : id);\n } else if (target) {\n // Get the old attribute\n const describedBy = target.getAttribute('aria-describedby');\n if (describedBy) {\n // If the old attribute matches the id just remove it entirely\n if (describedBy === id) {\n target.removeAttribute('aria-describedby');\n } else {\n // Otherwise we want to just remove the id that was added and reset the attribute to what it was before\n const oldDescribedBy = describedBy.replace(new RegExp(`(?:^|\\\\s+)${id}`), '');\n target.setAttribute('aria-describedby', oldDescribedBy);\n }\n }\n }\n }, [describeTarget, target, show]);\n\n const theme = useTheme();\n const tooltipTheme = {\n base: {\n palette: {\n 'primary-background': theme.components.tooltip['background-color'],\n 'foreground-color': theme.components.tooltip['foreground-color'],\n interactive: readableHue(\n theme.base.palette.interactive,\n theme.components.tooltip['background-color']\n )\n }\n }\n };\n\n return (\n <ThemeOverride theme={tooltipTheme}>\n <Popover\n data-testid={testIds.root}\n id={id}\n {...restProps}\n show={show}\n showDelay={showDelay}\n hideDelay={hideDelay}\n groupId='tooltip'\n strategy='fixed'\n as={StyledTooltip}\n role={stringContentOnly ? 'tooltip' : 'dialog'}\n target={target}\n arrow\n placement={placement}\n onMouseDown={onMouseDown}\n hideOnTargetHidden\n ref={tooltipRef}\n >\n {children}\n </Popover>\n </ThemeOverride>\n );\n});\n\nexport default withTestIds(Tooltip, getTooltipTestIds);\n"]}
@@ -1,2 +1,2 @@
1
- export declare const getTooltipTestIds: (testIdProp?: string | undefined) => import("../..").TestIdsRecord<readonly []>;
1
+ export declare const getTooltipTestIds: (testIdProp?: string | null | undefined) => import("../..").TestIdsRecord<readonly []>;
2
2
  //# sourceMappingURL=Tooltip.test-ids.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tooltip.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/Tooltip/Tooltip.test-ids.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,iFAAwC,CAAC"}
1
+ {"version":3,"file":"Tooltip.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/Tooltip/Tooltip.test-ids.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,wFAAwC,CAAC"}
@@ -11,6 +11,6 @@ export declare const StyledStandardTreeLeaf: import("styled-components").StyledC
11
11
  export declare const StyledStandardTreeParent: any;
12
12
  export declare const StyledStandardTreeNode: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
13
13
  export declare const StyledStandardTree: import("styled-components").StyledComponent<(<T extends import("./Tree").TreeNode = import("./Tree").TreeNode>(props: import("./Tree").TreeProps<T> & import("../..").ForwardProps) => JSX.Element | null) & {
14
- getTestIds: (testIdProp?: string | undefined) => import("../..").TestIdsRecord<readonly []>;
14
+ getTestIds: (testIdProp?: string | null | undefined) => import("../..").TestIdsRecord<readonly []>;
15
15
  }, import("styled-components").DefaultTheme, {}, never>;
16
16
  //# sourceMappingURL=StandardTree.styles.d.ts.map
@@ -29,7 +29,7 @@ interface TreeItemProps extends TreeNode {
29
29
  hasParentSibling: boolean;
30
30
  }
31
31
  declare const _default: (<T extends TreeNode = TreeNode>(props: TreeProps<T> & ForwardProps) => JSX.Element | null) & {
32
- getTestIds: (testIdProp?: string | undefined) => import("../../types").TestIdsRecord<readonly []>;
32
+ getTestIds: (testIdProp?: string | null | undefined) => import("../../types").TestIdsRecord<readonly []>;
33
33
  };
34
34
  export default _default;
35
35
  //# sourceMappingURL=Tree.d.ts.map
@@ -1,3 +1,3 @@
1
- export declare const getTreeTestIds: (testIdProp?: string | undefined) => import("../..").TestIdsRecord<readonly []>;
2
- export declare const getStandardTreeTestIds: (testIdProp?: string | undefined) => import("../..").TestIdsRecord<readonly []>;
1
+ export declare const getTreeTestIds: (testIdProp?: string | null | undefined) => import("../..").TestIdsRecord<readonly []>;
2
+ export declare const getStandardTreeTestIds: (testIdProp?: string | null | undefined) => import("../..").TestIdsRecord<readonly []>;
3
3
  //# sourceMappingURL=Tree.test-ids.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tree.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/Tree/Tree.test-ids.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,iFAAqC,CAAC;AAEjE,eAAO,MAAM,sBAAsB,iFAA8C,CAAC"}
1
+ {"version":3,"file":"Tree.test-ids.d.ts","sourceRoot":"","sources":["../../../src/components/Tree/Tree.test-ids.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,wFAAqC,CAAC;AAEjE,eAAO,MAAM,sBAAsB,wFAA8C,CAAC"}
@@ -26,6 +26,7 @@ export { default as useOuterEvent } from './useOuterEvent';
26
26
  export { default as usePrevious } from './usePrevious';
27
27
  export { default as useSimpleStore, createSimpleStore } from './useSimpleStore';
28
28
  export type { SimpleStore } from './useSimpleStore';
29
+ export { default as useSimpleStoreInstance } from './useSimpleStoreInstance';
29
30
  export { default as useScrollStick } from './useScrollStick';
30
31
  export { default as useScrollToggle } from './useScrollToggle';
31
32
  export { default as useShortcut } from './useShortcut';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC1F,YAAY,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AACvE,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACnF,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,Y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OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AACrF,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC"}
@@ -24,6 +24,7 @@ export { default as useOS } from './useOS';
24
24
  export { default as useOuterEvent } from './useOuterEvent';
25
25
  export { default as usePrevious } from './usePrevious';
26
26
  export { default as useSimpleStore, createSimpleStore } from './useSimpleStore';
27
+ export { default as useSimpleStoreInstance } from './useSimpleStoreInstance';
27
28
  export { default as useScrollStick } from './useScrollStick';
28
29
  export { default as useScrollToggle } from './useScrollToggle';
29
30
  export { default as useShortcut } from './useShortcut';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1F,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,6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,cAAc,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAEhF,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AACrF,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC","sourcesContent":["export { default as useActiveDescendant, useLazyDescendant } from './useActiveDescendant';\nexport type { UseActiveDescendantConfig } from './useActiveDescendant';\nexport { default as useAfterInitialEffect } from './useAfterInitialEffect';\nexport { default as useArrows } from './useArrows';\nexport { default as useAutoResize } from './useAutoResize';\nexport { default as useBreakpoint } from './useBreakpoint';\nexport { default as useChToPxConversionFactor } from './useChToPxConversionFactor';\nexport { default as useConfiguration } from './useConfiguration';\nexport { default as useConsolidatedRef } from './useConsolidatedRef';\nexport { default as useDirection } from './useDirection';\nexport { default as useDraggable } from './useDraggable';\nexport { default as useElement } from './useElement';\nexport { default as useEscape } from './useEscape';\nexport { default as useEvent } from './useEvent';\nexport { default as useFocusTrap } from './useFocusTrap';\nexport { default as useFocusWithin } from './useFocusWithin';\nexport { default as useI18n } from './useI18n';\nexport { default as useInputFormatter } from './useInputFormatter';\nexport { default as useItemIntersection } from './useItemIntersection';\nexport { default as useLiveLog } from './useLiveLog';\nexport { default as useLongPress } from './useLongPress';\nexport { default as useModalContext } from './useModalContext';\nexport { default as useModalManager } from './useModalManager';\nexport { default as useOS } from './useOS';\nexport { default as useOuterEvent } from './useOuterEvent';\nexport { default as usePrevious } from './usePrevious';\nexport { default as useSimpleStore, createSimpleStore } from './useSimpleStore';\nexport type { SimpleStore } from './useSimpleStore';\nexport { default as useScrollStick } from './useScrollStick';\nexport { default as useScrollToggle } from './useScrollToggle';\nexport { default as useShortcut } from './useShortcut';\nexport { default as useShortcutManager } from './useShortcutManager';\nexport { default as useTestIds } from './useTestIds';\nexport { default as useTheme } from './useTheme';\nexport { default as useToaster } from './useToaster';\nexport { default as useTransitionState } from './useTransitionState';\nexport { default as useTriggerableEffect } from './useTriggerableEffect';\nexport { default as useTriggerableLayoutEffect } from './useTriggerableLayoutEffect';\nexport { default as useUID } from './useUID';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE1F,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACnF,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;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I,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAC7D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AACrF,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,UAAU,CAAC","sourcesContent":["export { default as useActiveDescendant, useLazyDescendant } from './useActiveDescendant';\nexport type { UseActiveDescendantConfig } from './useActiveDescendant';\nexport { default as useAfterInitialEffect } from './useAfterInitialEffect';\nexport { default as useArrows } from './useArrows';\nexport { default as useAutoResize } from './useAutoResize';\nexport { default as useBreakpoint } from './useBreakpoint';\nexport { default as useChToPxConversionFactor } from './useChToPxConversionFactor';\nexport { default as useConfiguration } from './useConfiguration';\nexport { default as useConsolidatedRef } from './useConsolidatedRef';\nexport { default as useDirection } from './useDirection';\nexport { default as useDraggable } from './useDraggable';\nexport { default as useElement } from './useElement';\nexport { default as useEscape } from './useEscape';\nexport { default as useEvent } from './useEvent';\nexport { default as useFocusTrap } from './useFocusTrap';\nexport { default as useFocusWithin } from './useFocusWithin';\nexport { default as useI18n } from './useI18n';\nexport { default as useInputFormatter } from './useInputFormatter';\nexport { default as useItemIntersection } from './useItemIntersection';\nexport { default as useLiveLog } from './useLiveLog';\nexport { default as useLongPress } from './useLongPress';\nexport { default as useModalContext } from './useModalContext';\nexport { default as useModalManager } from './useModalManager';\nexport { default as useOS } from './useOS';\nexport { default as useOuterEvent } from './useOuterEvent';\nexport { default as usePrevious } from './usePrevious';\nexport { default as useSimpleStore, createSimpleStore } from './useSimpleStore';\nexport type { SimpleStore } from './useSimpleStore';\nexport { default as useSimpleStoreInstance } from './useSimpleStoreInstance';\nexport { default as useScrollStick } from './useScrollStick';\nexport { default as useScrollToggle } from './useScrollToggle';\nexport { default as useShortcut } from './useShortcut';\nexport { default as useShortcutManager } from './useShortcutManager';\nexport { default as useTestIds } from './useTestIds';\nexport { default as useTheme } from './useTheme';\nexport { default as useToaster } from './useToaster';\nexport { default as useTransitionState } from './useTransitionState';\nexport { default as useTriggerableEffect } from './useTriggerableEffect';\nexport { default as useTriggerableLayoutEffect } from './useTriggerableLayoutEffect';\nexport { default as useUID } from './useUID';\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"useArrows.d.ts","sourceRoot":"","sources":["../../src/hooks/useArrows.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAWvD;;;GAGG;AACH,QAAA,MAAM,SAAS,QACR,UAAU,WAAW,CAAC;;;;;;;yCAgI5B,CAAC;AAEF,eAAe,SAAS,CAAC"}
1
+ {"version":3,"file":"useArrows.d.ts","sourceRoot":"","sources":["../../src/hooks/useArrows.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAWvD;;;GAGG;AACH,QAAA,MAAM,SAAS,QACR,UAAU,WAAW,CAAC;;;;;;;yCAkI5B,CAAC;AAEF,eAAe,SAAS,CAAC"}