@muraldevkit/ui-toolkit 4.72.0 → 4.73.0-dev-t0WE.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 (273) hide show
  1. package/dist/cjs/components/avatar/MrlAvatarButton/MrlAvatarButton.js +8 -1
  2. package/dist/cjs/components/avatar/MrlAvatarButton/MrlAvatarButton.js.map +1 -1
  3. package/dist/cjs/components/breadcrumb/MrlBreadcrumbItem/MrlBreadcrumbItem.js +14 -4
  4. package/dist/cjs/components/breadcrumb/MrlBreadcrumbItem/MrlBreadcrumbItem.js.map +1 -1
  5. package/dist/cjs/components/button/MrlAnimatedIconButton/MrlAnimatedIconButton.js +8 -1
  6. package/dist/cjs/components/button/MrlAnimatedIconButton/MrlAnimatedIconButton.js.map +1 -1
  7. package/dist/cjs/components/button/MrlButton/MrlButton.js +3 -3
  8. package/dist/cjs/components/button/MrlButton/MrlButton.js.map +1 -1
  9. package/dist/cjs/components/button/MrlIconButton/MrlIconButton.js +8 -1
  10. package/dist/cjs/components/button/MrlIconButton/MrlIconButton.js.map +1 -1
  11. package/dist/cjs/components/button/MrlProcessingButton/MrlProcessingButton.js +21 -2
  12. package/dist/cjs/components/button/MrlProcessingButton/MrlProcessingButton.js.map +1 -1
  13. package/dist/cjs/components/callout/MrlCallout/MrlCallout.js +36 -3
  14. package/dist/cjs/components/callout/MrlCallout/MrlCallout.js.map +1 -1
  15. package/dist/cjs/components/filter/MrlFilter/MrlFilter.js +18 -2
  16. package/dist/cjs/components/filter/MrlFilter/MrlFilter.js.map +1 -1
  17. package/dist/cjs/components/filter/MrlFilterItem/MrlFilterItem.js +11 -1
  18. package/dist/cjs/components/filter/MrlFilterItem/MrlFilterItem.js.map +1 -1
  19. package/dist/cjs/components/form/checkbox/MrlCheckbox/MrlCheckbox.js +17 -1
  20. package/dist/cjs/components/form/checkbox/MrlCheckbox/MrlCheckbox.js.map +1 -1
  21. package/dist/cjs/components/form/checkbox/MrlCheckboxStandalone/MrlCheckboxStandalone.js +24 -1
  22. package/dist/cjs/components/form/checkbox/MrlCheckboxStandalone/MrlCheckboxStandalone.js.map +1 -1
  23. package/dist/cjs/components/form/date-picker/MrlDatePicker.js +17 -2
  24. package/dist/cjs/components/form/date-picker/MrlDatePicker.js.map +1 -1
  25. package/dist/cjs/components/form/legacy-select/MrlLegacySelect/MrlLegacySelect.js +11 -2
  26. package/dist/cjs/components/form/legacy-select/MrlLegacySelect/MrlLegacySelect.js.map +1 -1
  27. package/dist/cjs/components/form/legacy-select/MrlLegacySelectItem/MrlLegacySelectItem.js +8 -1
  28. package/dist/cjs/components/form/legacy-select/MrlLegacySelectItem/MrlLegacySelectItem.js.map +1 -1
  29. package/dist/cjs/components/form/radio/MrlRadioButton/MrlRadioButton.js +19 -1
  30. package/dist/cjs/components/form/radio/MrlRadioButton/MrlRadioButton.js.map +1 -1
  31. package/dist/cjs/components/form/radio/MrlRadioButtonStandalone/MrlRadioButtonStandalone.js +19 -1
  32. package/dist/cjs/components/form/radio/MrlRadioButtonStandalone/MrlRadioButtonStandalone.js.map +1 -1
  33. package/dist/cjs/components/form/select/MrlCreatableSelect/MrlCreatableSelect.js +42 -2
  34. package/dist/cjs/components/form/select/MrlCreatableSelect/MrlCreatableSelect.js.map +1 -1
  35. package/dist/cjs/components/form/select/MrlMultiCreatableSelect/MrlMultiCreatableSelect.js +42 -2
  36. package/dist/cjs/components/form/select/MrlMultiCreatableSelect/MrlMultiCreatableSelect.js.map +1 -1
  37. package/dist/cjs/components/form/select/MrlMultiSelect/MrlMultiSelect.js +34 -2
  38. package/dist/cjs/components/form/select/MrlMultiSelect/MrlMultiSelect.js.map +1 -1
  39. package/dist/cjs/components/form/select/MrlSelect/MrlSelect.js +34 -2
  40. package/dist/cjs/components/form/select/MrlSelect/MrlSelect.js.map +1 -1
  41. package/dist/cjs/components/form/switch/MrlSwitch/MrlSwitch.js +14 -2
  42. package/dist/cjs/components/form/switch/MrlSwitch/MrlSwitch.js.map +1 -1
  43. package/dist/cjs/components/form/switch/MrlSwitchStandalone/MrlSwitchStandalone.js +10 -1
  44. package/dist/cjs/components/form/switch/MrlSwitchStandalone/MrlSwitchStandalone.js.map +1 -1
  45. package/dist/cjs/components/form/text-input/MrlEditableTextInput/MrlEditableTextInput.js +20 -3
  46. package/dist/cjs/components/form/text-input/MrlEditableTextInput/MrlEditableTextInput.js.map +1 -1
  47. package/dist/cjs/components/form/text-input/MrlTextInput/MrlTextInput.js +20 -3
  48. package/dist/cjs/components/form/text-input/MrlTextInput/MrlTextInput.js.map +1 -1
  49. package/dist/cjs/components/form/textarea/MrlEditableTextarea/MrlEditableTextarea.js +20 -3
  50. package/dist/cjs/components/form/textarea/MrlEditableTextarea/MrlEditableTextarea.js.map +1 -1
  51. package/dist/cjs/components/form/textarea/MrlTextarea/MrlTextarea.js +38 -1
  52. package/dist/cjs/components/form/textarea/MrlTextarea/MrlTextarea.js.map +1 -1
  53. package/dist/cjs/components/layout/MrlSidebar/MrlSidebar.js +12 -2
  54. package/dist/cjs/components/layout/MrlSidebar/MrlSidebar.js.map +1 -1
  55. package/dist/cjs/components/link/MrlLink/MrlLink.js +21 -2
  56. package/dist/cjs/components/link/MrlLink/MrlLink.js.map +1 -1
  57. package/dist/cjs/components/link/MrlLinkButton/MrlLinkButton.js +12 -1
  58. package/dist/cjs/components/link/MrlLinkButton/MrlLinkButton.js.map +1 -1
  59. package/dist/cjs/components/menu/MrlMenu/MrlMenu.js +20 -1
  60. package/dist/cjs/components/menu/MrlMenu/MrlMenu.js.map +1 -1
  61. package/dist/cjs/components/menu/MrlMenuItem/MrlMenuItem.js +18 -1
  62. package/dist/cjs/components/menu/MrlMenuItem/MrlMenuItem.js.map +1 -1
  63. package/dist/cjs/components/menu/MrlMenuItemLink/MrlMenuItemLink.js +10 -1
  64. package/dist/cjs/components/menu/MrlMenuItemLink/MrlMenuItemLink.js.map +1 -1
  65. package/dist/cjs/components/modal/MrlModal/MrlModal.js +22 -1
  66. package/dist/cjs/components/modal/MrlModal/MrlModal.js.map +1 -1
  67. package/dist/cjs/components/notification/MrlBlockNotification/MrlBlockNotification.js +27 -1
  68. package/dist/cjs/components/notification/MrlBlockNotification/MrlBlockNotification.js.map +1 -1
  69. package/dist/cjs/components/notification/MrlToast/MrlToast.js +28 -3
  70. package/dist/cjs/components/notification/MrlToast/MrlToast.js.map +1 -1
  71. package/dist/cjs/components/pagination/MrlPaginationButton/MrlPaginationButton.js +18 -2
  72. package/dist/cjs/components/pagination/MrlPaginationButton/MrlPaginationButton.js.map +1 -1
  73. package/dist/cjs/components/panel/MrlPanel/MrlPanel.js +24 -4
  74. package/dist/cjs/components/panel/MrlPanel/MrlPanel.js.map +1 -1
  75. package/dist/cjs/components/popover/MrlPopover/MrlPopover.js +18 -1
  76. package/dist/cjs/components/popover/MrlPopover/MrlPopover.js.map +1 -1
  77. package/dist/cjs/components/table/MrlSmartTable/MrlSmartTable.js +31 -2
  78. package/dist/cjs/components/table/MrlSmartTable/MrlSmartTable.js.map +1 -1
  79. package/dist/cjs/components/table/MrlTableRow/MrlTableRow.js +13 -3
  80. package/dist/cjs/components/table/MrlTableRow/MrlTableRow.js.map +1 -1
  81. package/dist/cjs/components/tabs/MrlTab/MrlTab.js +10 -1
  82. package/dist/cjs/components/tabs/MrlTab/MrlTab.js.map +1 -1
  83. package/dist/cjs/components/tabs/MrlTabLink/MrlTabLink.js +10 -1
  84. package/dist/cjs/components/tabs/MrlTabLink/MrlTabLink.js.map +1 -1
  85. package/dist/cjs/components/toolbar/MrlToolbarButton/MrlToolbarButton.js +19 -3
  86. package/dist/cjs/components/toolbar/MrlToolbarButton/MrlToolbarButton.js.map +1 -1
  87. package/dist/cjs/components/tooltip/MrlTooltip/MrlTooltip.js +23 -1
  88. package/dist/cjs/components/tooltip/MrlTooltip/MrlTooltip.js.map +1 -1
  89. package/dist/cjs/hooks/useMrlAnalytics/useMrlAnalytics.js +7 -7
  90. package/dist/cjs/hooks/useMrlAnalytics/useMrlAnalytics.js.map +1 -1
  91. package/dist/cjs/version.js +1 -1
  92. package/dist/cjs/version.js.map +1 -1
  93. package/dist/components/avatar/MrlAvatarButton/MrlAvatarButton.d.ts +6 -1
  94. package/dist/components/breadcrumb/MrlBreadcrumbItem/MrlBreadcrumbItem.d.ts +5 -0
  95. package/dist/components/button/MrlButton/MrlButton.d.ts +1 -1
  96. package/dist/components/button/MrlIconButton/MrlIconButton.d.ts +5 -0
  97. package/dist/components/callout/MrlCallout/MrlCallout.d.ts +7 -0
  98. package/dist/components/filter/MrlFilter/MrlFilter.d.ts +7 -0
  99. package/dist/components/filter/MrlFilterItem/MrlFilterItem.d.ts +7 -0
  100. package/dist/components/form/checkbox/MrlCheckbox/MrlCheckbox.d.ts +6 -1
  101. package/dist/components/form/checkbox/MrlCheckboxStandalone/MrlCheckboxStandalone.d.ts +6 -1
  102. package/dist/components/form/date-picker/MrlDatePicker.d.ts +7 -0
  103. package/dist/components/form/legacy-select/MrlLegacySelect/MrlLegacySelect.d.ts +6 -1
  104. package/dist/components/form/legacy-select/MrlLegacySelectItem/MrlLegacySelectItem.d.ts +8 -1
  105. package/dist/components/form/radio/MrlRadioButton/MrlRadioButton.d.ts +6 -1
  106. package/dist/components/form/radio/MrlRadioButtonStandalone/MrlRadioButtonStandalone.d.ts +6 -1
  107. package/dist/components/form/select/MrlCreatableSelect/MrlCreatableSelect.d.ts +7 -0
  108. package/dist/components/form/select/MrlMultiCreatableSelect/MrlMultiCreatableSelect.d.ts +7 -0
  109. package/dist/components/form/select/MrlMultiSelect/MrlMultiSelect.d.ts +7 -0
  110. package/dist/components/form/select/MrlSelect/MrlSelect.d.ts +7 -0
  111. package/dist/components/form/switch/MrlSwitch/MrlSwitch.d.ts +6 -1
  112. package/dist/components/form/switch/MrlSwitchStandalone/MrlSwitchStandalone.d.ts +6 -1
  113. package/dist/components/form/text-input/MrlEditableTextInput/MrlEditableTextInput.d.ts +8 -0
  114. package/dist/components/form/text-input/MrlTextInput/MrlTextInput.d.ts +8 -0
  115. package/dist/components/form/textarea/MrlEditableTextarea/MrlEditableTextarea.d.ts +8 -0
  116. package/dist/components/form/textarea/MrlTextarea/MrlTextarea.d.ts +9 -1
  117. package/dist/components/layout/MrlSidebar/MrlSidebar.d.ts +8 -1
  118. package/dist/components/link/MrlLink/MrlLink.d.ts +6 -1
  119. package/dist/components/link/MrlLinkButton/MrlLinkButton.d.ts +5 -0
  120. package/dist/components/menu/MrlMenu/MrlMenu.d.ts +6 -1
  121. package/dist/components/menu/MrlMenuItem/MrlMenuItem.d.ts +6 -1
  122. package/dist/components/menu/MrlMenuItemLink/MrlMenuItemLink.d.ts +6 -1
  123. package/dist/components/modal/MrlModal/MrlModal.d.ts +5 -0
  124. package/dist/components/notification/MrlBlockNotification/MrlBlockNotification.d.ts +7 -0
  125. package/dist/components/notification/MrlToast/MrlToast.d.ts +8 -1
  126. package/dist/components/pagination/MrlPaginationButton/MrlPaginationButton.d.ts +6 -1
  127. package/dist/components/panel/MrlPanel/MrlPanel.d.ts +8 -0
  128. package/dist/components/popover/MrlPopover/MrlPopover.d.ts +6 -1
  129. package/dist/components/table/MrlSmartTable/MrlSmartTable.d.ts +7 -0
  130. package/dist/components/table/MrlTableRow/MrlTableRow.d.ts +7 -0
  131. package/dist/components/tabs/MrlTab/MrlTab.d.ts +6 -1
  132. package/dist/components/tabs/MrlTabLink/MrlTabLink.d.ts +6 -1
  133. package/dist/components/toolbar/MrlToolbarButton/MrlToolbarButton.d.ts +5 -0
  134. package/dist/components/tooltip/MrlTooltip/MrlTooltip.d.ts +8 -0
  135. package/dist/contexts/MrlAnalyticsContext/types.d.ts +1 -1
  136. package/dist/esm/components/avatar/MrlAvatarButton/MrlAvatarButton.js +8 -1
  137. package/dist/esm/components/avatar/MrlAvatarButton/MrlAvatarButton.js.map +1 -1
  138. package/dist/esm/components/breadcrumb/MrlBreadcrumbItem/MrlBreadcrumbItem.js +14 -4
  139. package/dist/esm/components/breadcrumb/MrlBreadcrumbItem/MrlBreadcrumbItem.js.map +1 -1
  140. package/dist/esm/components/button/MrlAnimatedIconButton/MrlAnimatedIconButton.js +8 -1
  141. package/dist/esm/components/button/MrlAnimatedIconButton/MrlAnimatedIconButton.js.map +1 -1
  142. package/dist/esm/components/button/MrlButton/MrlButton.js +3 -3
  143. package/dist/esm/components/button/MrlButton/MrlButton.js.map +1 -1
  144. package/dist/esm/components/button/MrlIconButton/MrlIconButton.js +8 -1
  145. package/dist/esm/components/button/MrlIconButton/MrlIconButton.js.map +1 -1
  146. package/dist/esm/components/button/MrlProcessingButton/MrlProcessingButton.js +21 -2
  147. package/dist/esm/components/button/MrlProcessingButton/MrlProcessingButton.js.map +1 -1
  148. package/dist/esm/components/callout/MrlCallout/MrlCallout.js +36 -3
  149. package/dist/esm/components/callout/MrlCallout/MrlCallout.js.map +1 -1
  150. package/dist/esm/components/filter/MrlFilter/MrlFilter.js +18 -2
  151. package/dist/esm/components/filter/MrlFilter/MrlFilter.js.map +1 -1
  152. package/dist/esm/components/filter/MrlFilterItem/MrlFilterItem.js +11 -1
  153. package/dist/esm/components/filter/MrlFilterItem/MrlFilterItem.js.map +1 -1
  154. package/dist/esm/components/form/checkbox/MrlCheckbox/MrlCheckbox.js +17 -1
  155. package/dist/esm/components/form/checkbox/MrlCheckbox/MrlCheckbox.js.map +1 -1
  156. package/dist/esm/components/form/checkbox/MrlCheckboxStandalone/MrlCheckboxStandalone.js +24 -1
  157. package/dist/esm/components/form/checkbox/MrlCheckboxStandalone/MrlCheckboxStandalone.js.map +1 -1
  158. package/dist/esm/components/form/date-picker/MrlDatePicker.js +17 -2
  159. package/dist/esm/components/form/date-picker/MrlDatePicker.js.map +1 -1
  160. package/dist/esm/components/form/legacy-select/MrlLegacySelect/MrlLegacySelect.js +11 -2
  161. package/dist/esm/components/form/legacy-select/MrlLegacySelect/MrlLegacySelect.js.map +1 -1
  162. package/dist/esm/components/form/legacy-select/MrlLegacySelectItem/MrlLegacySelectItem.js +8 -1
  163. package/dist/esm/components/form/legacy-select/MrlLegacySelectItem/MrlLegacySelectItem.js.map +1 -1
  164. package/dist/esm/components/form/radio/MrlRadioButton/MrlRadioButton.js +19 -1
  165. package/dist/esm/components/form/radio/MrlRadioButton/MrlRadioButton.js.map +1 -1
  166. package/dist/esm/components/form/radio/MrlRadioButtonStandalone/MrlRadioButtonStandalone.js +19 -1
  167. package/dist/esm/components/form/radio/MrlRadioButtonStandalone/MrlRadioButtonStandalone.js.map +1 -1
  168. package/dist/esm/components/form/select/MrlCreatableSelect/MrlCreatableSelect.js +42 -2
  169. package/dist/esm/components/form/select/MrlCreatableSelect/MrlCreatableSelect.js.map +1 -1
  170. package/dist/esm/components/form/select/MrlMultiCreatableSelect/MrlMultiCreatableSelect.js +42 -2
  171. package/dist/esm/components/form/select/MrlMultiCreatableSelect/MrlMultiCreatableSelect.js.map +1 -1
  172. package/dist/esm/components/form/select/MrlMultiSelect/MrlMultiSelect.js +34 -2
  173. package/dist/esm/components/form/select/MrlMultiSelect/MrlMultiSelect.js.map +1 -1
  174. package/dist/esm/components/form/select/MrlSelect/MrlSelect.js +34 -2
  175. package/dist/esm/components/form/select/MrlSelect/MrlSelect.js.map +1 -1
  176. package/dist/esm/components/form/switch/MrlSwitch/MrlSwitch.js +14 -2
  177. package/dist/esm/components/form/switch/MrlSwitch/MrlSwitch.js.map +1 -1
  178. package/dist/esm/components/form/switch/MrlSwitchStandalone/MrlSwitchStandalone.js +10 -1
  179. package/dist/esm/components/form/switch/MrlSwitchStandalone/MrlSwitchStandalone.js.map +1 -1
  180. package/dist/esm/components/form/text-input/MrlEditableTextInput/MrlEditableTextInput.js +20 -3
  181. package/dist/esm/components/form/text-input/MrlEditableTextInput/MrlEditableTextInput.js.map +1 -1
  182. package/dist/esm/components/form/text-input/MrlTextInput/MrlTextInput.js +20 -3
  183. package/dist/esm/components/form/text-input/MrlTextInput/MrlTextInput.js.map +1 -1
  184. package/dist/esm/components/form/textarea/MrlEditableTextarea/MrlEditableTextarea.js +20 -3
  185. package/dist/esm/components/form/textarea/MrlEditableTextarea/MrlEditableTextarea.js.map +1 -1
  186. package/dist/esm/components/form/textarea/MrlTextarea/MrlTextarea.js +38 -1
  187. package/dist/esm/components/form/textarea/MrlTextarea/MrlTextarea.js.map +1 -1
  188. package/dist/esm/components/layout/MrlSidebar/MrlSidebar.js +12 -2
  189. package/dist/esm/components/layout/MrlSidebar/MrlSidebar.js.map +1 -1
  190. package/dist/esm/components/link/MrlLink/MrlLink.js +21 -2
  191. package/dist/esm/components/link/MrlLink/MrlLink.js.map +1 -1
  192. package/dist/esm/components/link/MrlLinkButton/MrlLinkButton.js +12 -1
  193. package/dist/esm/components/link/MrlLinkButton/MrlLinkButton.js.map +1 -1
  194. package/dist/esm/components/menu/MrlMenu/MrlMenu.js +20 -1
  195. package/dist/esm/components/menu/MrlMenu/MrlMenu.js.map +1 -1
  196. package/dist/esm/components/menu/MrlMenuItem/MrlMenuItem.js +18 -1
  197. package/dist/esm/components/menu/MrlMenuItem/MrlMenuItem.js.map +1 -1
  198. package/dist/esm/components/menu/MrlMenuItemLink/MrlMenuItemLink.js +10 -1
  199. package/dist/esm/components/menu/MrlMenuItemLink/MrlMenuItemLink.js.map +1 -1
  200. package/dist/esm/components/modal/MrlModal/MrlModal.js +22 -1
  201. package/dist/esm/components/modal/MrlModal/MrlModal.js.map +1 -1
  202. package/dist/esm/components/notification/MrlBlockNotification/MrlBlockNotification.js +27 -1
  203. package/dist/esm/components/notification/MrlBlockNotification/MrlBlockNotification.js.map +1 -1
  204. package/dist/esm/components/notification/MrlToast/MrlToast.js +28 -3
  205. package/dist/esm/components/notification/MrlToast/MrlToast.js.map +1 -1
  206. package/dist/esm/components/pagination/MrlPaginationButton/MrlPaginationButton.js +18 -2
  207. package/dist/esm/components/pagination/MrlPaginationButton/MrlPaginationButton.js.map +1 -1
  208. package/dist/esm/components/panel/MrlPanel/MrlPanel.js +24 -4
  209. package/dist/esm/components/panel/MrlPanel/MrlPanel.js.map +1 -1
  210. package/dist/esm/components/popover/MrlPopover/MrlPopover.js +18 -1
  211. package/dist/esm/components/popover/MrlPopover/MrlPopover.js.map +1 -1
  212. package/dist/esm/components/table/MrlSmartTable/MrlSmartTable.js +31 -2
  213. package/dist/esm/components/table/MrlSmartTable/MrlSmartTable.js.map +1 -1
  214. package/dist/esm/components/table/MrlTableRow/MrlTableRow.js +13 -3
  215. package/dist/esm/components/table/MrlTableRow/MrlTableRow.js.map +1 -1
  216. package/dist/esm/components/tabs/MrlTab/MrlTab.js +10 -1
  217. package/dist/esm/components/tabs/MrlTab/MrlTab.js.map +1 -1
  218. package/dist/esm/components/tabs/MrlTabLink/MrlTabLink.js +10 -1
  219. package/dist/esm/components/tabs/MrlTabLink/MrlTabLink.js.map +1 -1
  220. package/dist/esm/components/toolbar/MrlToolbarButton/MrlToolbarButton.js +19 -3
  221. package/dist/esm/components/toolbar/MrlToolbarButton/MrlToolbarButton.js.map +1 -1
  222. package/dist/esm/components/tooltip/MrlTooltip/MrlTooltip.js +23 -1
  223. package/dist/esm/components/tooltip/MrlTooltip/MrlTooltip.js.map +1 -1
  224. package/dist/esm/hooks/useMrlAnalytics/useMrlAnalytics.js +7 -7
  225. package/dist/esm/hooks/useMrlAnalytics/useMrlAnalytics.js.map +1 -1
  226. package/dist/esm/version.js +1 -1
  227. package/dist/esm/version.js.map +1 -1
  228. package/dist/hooks/useMrlAnalytics/useMrlAnalytics.d.ts +4 -4
  229. package/dist/types/components/avatar/MrlAvatarButton/MrlAvatarButton.d.ts +6 -1
  230. package/dist/types/components/breadcrumb/MrlBreadcrumbItem/MrlBreadcrumbItem.d.ts +5 -0
  231. package/dist/types/components/button/MrlButton/MrlButton.d.ts +1 -1
  232. package/dist/types/components/button/MrlIconButton/MrlIconButton.d.ts +5 -0
  233. package/dist/types/components/callout/MrlCallout/MrlCallout.d.ts +7 -0
  234. package/dist/types/components/filter/MrlFilter/MrlFilter.d.ts +7 -0
  235. package/dist/types/components/filter/MrlFilterItem/MrlFilterItem.d.ts +7 -0
  236. package/dist/types/components/form/checkbox/MrlCheckbox/MrlCheckbox.d.ts +6 -1
  237. package/dist/types/components/form/checkbox/MrlCheckboxStandalone/MrlCheckboxStandalone.d.ts +6 -1
  238. package/dist/types/components/form/date-picker/MrlDatePicker.d.ts +7 -0
  239. package/dist/types/components/form/legacy-select/MrlLegacySelect/MrlLegacySelect.d.ts +6 -1
  240. package/dist/types/components/form/legacy-select/MrlLegacySelectItem/MrlLegacySelectItem.d.ts +8 -1
  241. package/dist/types/components/form/radio/MrlRadioButton/MrlRadioButton.d.ts +6 -1
  242. package/dist/types/components/form/radio/MrlRadioButtonStandalone/MrlRadioButtonStandalone.d.ts +6 -1
  243. package/dist/types/components/form/select/MrlCreatableSelect/MrlCreatableSelect.d.ts +7 -0
  244. package/dist/types/components/form/select/MrlMultiCreatableSelect/MrlMultiCreatableSelect.d.ts +7 -0
  245. package/dist/types/components/form/select/MrlMultiSelect/MrlMultiSelect.d.ts +7 -0
  246. package/dist/types/components/form/select/MrlSelect/MrlSelect.d.ts +7 -0
  247. package/dist/types/components/form/switch/MrlSwitch/MrlSwitch.d.ts +6 -1
  248. package/dist/types/components/form/switch/MrlSwitchStandalone/MrlSwitchStandalone.d.ts +6 -1
  249. package/dist/types/components/form/text-input/MrlEditableTextInput/MrlEditableTextInput.d.ts +8 -0
  250. package/dist/types/components/form/text-input/MrlTextInput/MrlTextInput.d.ts +8 -0
  251. package/dist/types/components/form/textarea/MrlEditableTextarea/MrlEditableTextarea.d.ts +8 -0
  252. package/dist/types/components/form/textarea/MrlTextarea/MrlTextarea.d.ts +9 -1
  253. package/dist/types/components/layout/MrlSidebar/MrlSidebar.d.ts +8 -1
  254. package/dist/types/components/link/MrlLink/MrlLink.d.ts +6 -1
  255. package/dist/types/components/link/MrlLinkButton/MrlLinkButton.d.ts +5 -0
  256. package/dist/types/components/menu/MrlMenu/MrlMenu.d.ts +6 -1
  257. package/dist/types/components/menu/MrlMenuItem/MrlMenuItem.d.ts +6 -1
  258. package/dist/types/components/menu/MrlMenuItemLink/MrlMenuItemLink.d.ts +6 -1
  259. package/dist/types/components/modal/MrlModal/MrlModal.d.ts +5 -0
  260. package/dist/types/components/notification/MrlBlockNotification/MrlBlockNotification.d.ts +7 -0
  261. package/dist/types/components/notification/MrlToast/MrlToast.d.ts +8 -1
  262. package/dist/types/components/pagination/MrlPaginationButton/MrlPaginationButton.d.ts +6 -1
  263. package/dist/types/components/panel/MrlPanel/MrlPanel.d.ts +8 -0
  264. package/dist/types/components/popover/MrlPopover/MrlPopover.d.ts +6 -1
  265. package/dist/types/components/table/MrlSmartTable/MrlSmartTable.d.ts +7 -0
  266. package/dist/types/components/table/MrlTableRow/MrlTableRow.d.ts +7 -0
  267. package/dist/types/components/tabs/MrlTab/MrlTab.d.ts +6 -1
  268. package/dist/types/components/tabs/MrlTabLink/MrlTabLink.d.ts +6 -1
  269. package/dist/types/components/toolbar/MrlToolbarButton/MrlToolbarButton.d.ts +5 -0
  270. package/dist/types/components/tooltip/MrlTooltip/MrlTooltip.d.ts +8 -0
  271. package/dist/types/contexts/MrlAnalyticsContext/types.d.ts +1 -1
  272. package/dist/types/hooks/useMrlAnalytics/useMrlAnalytics.d.ts +4 -4
  273. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"MrlToolbarButton.js","sources":["../../../../../src/components/toolbar/MrlToolbarButton/MrlToolbarButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport { MrlIconButton, MrlIconButtonProps, MrlMenuItem, MrlMenuItemProps } from '../../../';\n\nimport styles from './MrlToolbarButton.module.scss';\nimport classnames from 'classnames';\n\n/**\n * Props for the MrlToolbarButton component.\n */\nexport interface MrlToolbarButtonProps {\n\t/** Additional class to add to the Toolbar button */\n\tclassName?: string;\n\t/**\n\t * The icon that will be rendered.\n\t */\n\ticon: React.ReactElement;\n\tincludeInRoving?: boolean;\n\t/**\n\t * A prop used to set a toolbar button to never move into the menu.\n\t */\n\tlockedInToolbar?: boolean;\n\t/**\n\t * onClick event for the button.\n\t */\n\tonClick?: (e?: React.MouseEvent<HTMLButtonElement>) => void;\n\t/**\n\t * Props used to control the display of the button in the menu.\n\t */\n\tmenuItemProps?: Omit<MrlMenuItemProps, 'onClick'>;\n\tqa?: string;\n\t/**\n\t * A prop used to render the item in the menu instead of the toolbar.\n\t */\n\trenderInMenu?: boolean;\n\ttext: string;\n\t/**\n\t * Props used to control the display of the button in the toolbar.\n\t */\n\ttoolbarButtonProps?: {\n\t\tbadge?: MrlIconButtonProps['badge'];\n\t\tdisableEvents?: MrlIconButtonProps['disableEvents'];\n\t\tkind?: MrlIconButtonProps['kind'];\n\t\tloading?: MrlIconButtonProps['loading'];\n\t\tloadingText?: MrlIconButtonProps['loadingText'];\n\t\tonKeyUp?: MrlIconButtonProps['onKeyUp'];\n\t\tonMouseUp?: MrlIconButtonProps['onMouseUp'];\n\t\tposition?: MrlIconButtonProps['position'];\n\t\tsize?: MrlIconButtonProps['size'];\n\t\tstate?: MrlIconButtonProps['state'];\n\t\ttipAnchor?: MrlIconButtonProps['tipAnchor'];\n\t\ttoggleAria?: MrlIconButtonProps['toggleAria'];\n\t\ttoggleStyle?: MrlIconButtonProps['toggleStyle'];\n\t};\n}\n\n/**\n * MrlToolbarButton component.\n * @param props The MrlToolbarButton component properties.\n * @returns The MrlToolbarButton component.\n */\nexport const MrlToolbarButton = React.forwardRef<HTMLButtonElement, MrlToolbarButtonProps>(\n\tfunction MrlToolbarButton(props, ref): JSX.Element {\n\t\tconst {\n\t\t\tclassName,\n\t\t\ticon,\n\t\t\tincludeInRoving = false,\n\t\t\tmenuItemProps,\n\t\t\tonClick,\n\t\t\tqa,\n\t\t\trenderInMenu,\n\t\t\ttext,\n\t\t\ttoolbarButtonProps = {\n\t\t\t\tposition: 'bottom',\n\t\t\t\tsize: 'small',\n\t\t\t\tstate: 'default'\n\t\t\t},\n\t\t\t...rest\n\t\t} = props;\n\t\tconst classes = classnames('MrlToolbarButton', className);\n\n\t\tif (renderInMenu) {\n\t\t\treturn (\n\t\t\t\t<MrlMenuItem {...menuItemProps} className={classes} data-qa={qa} onClick={onClick}>\n\t\t\t\t\t<span className={styles.MrlToolbarButtonIcon}>{icon}</span>\n\t\t\t\t\t{text}\n\t\t\t\t</MrlMenuItem>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<MrlIconButton\n\t\t\t\t{...rest}\n\t\t\t\t{...toolbarButtonProps}\n\t\t\t\tclassName={classes}\n\t\t\t\tdata-qa={qa}\n\t\t\t\tdata-roving={includeInRoving ? 'true' : undefined}\n\t\t\t\ticon={icon}\n\t\t\t\tonClick={onClick}\n\t\t\t\tref={ref}\n\t\t\t\ttext={text}\n\t\t\t/>\n\t\t);\n\t}\n);\n"],"names":["MrlToolbarButton","React","forwardRef","props","ref","className","icon","_props$includeInRovin","includeInRoving","menuItemProps","onClick","qa","renderInMenu","text","_props$toolbarButtonP","toolbarButtonProps","position","size","state","rest","_objectWithoutProperties","_excluded","classes","classnames","createElement","MrlMenuItem","_extends","styles","MrlToolbarButtonIcon","MrlIconButton","undefined"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA;AACA;AACA;;AA+CA;AACA;AACA;AACA;AACA;AACO,IAAMA,gBAAgB,gBAAGC,gBAAK,CAACC,UAAU,CAC/C,SAASF,gBAAgBA,CAACG,KAAK,EAAEC,GAAG,EAAe;AAClD,EAAA,IACCC,SAAS,GAcNF,KAAK,CAdRE,SAAS;IACTC,IAAI,GAaDH,KAAK,CAbRG,IAAI;IAAAC,qBAAA,GAaDJ,KAAK,CAZRK,eAAe;AAAfA,IAAAA,eAAe,GAAAD,qBAAA,KAAA,MAAA,GAAG,KAAK,GAAAA,qBAAA;IACvBE,aAAa,GAWVN,KAAK,CAXRM,aAAa;IACbC,OAAO,GAUJP,KAAK,CAVRO,OAAO;IACPC,EAAE,GASCR,KAAK,CATRQ,EAAE;IACFC,YAAY,GAQTT,KAAK,CARRS,YAAY;IACZC,IAAI,GAODV,KAAK,CAPRU,IAAI;IAAAC,qBAAA,GAODX,KAAK,CANRY,kBAAkB;IAAlBA,kBAAkB,GAAAD,qBAAA,KAAA,MAAA,GAAG;AACpBE,MAAAA,QAAQ,EAAE,QAAQ;AAClBC,MAAAA,IAAI,EAAE,OAAO;AACbC,MAAAA,KAAK,EAAE;AACR,KAAC,GAAAJ,qBAAA;AACEK,IAAAA,IAAI,GAAAC,iDAAA,CACJjB,KAAK,EAAAkB,SAAA,CAAA;AACT,EAAA,IAAMC,OAAO,GAAGC,2BAAU,CAAC,kBAAkB,EAAElB,SAAS,CAAC;AAEzD,EAAA,IAAIO,YAAY,EAAE;IACjB,oBACCX,gBAAA,CAAAuB,aAAA,CAACC,uBAAW,EAAAC,iCAAA,KAAKjB,aAAa,EAAA;AAAEJ,MAAAA,SAAS,EAAEiB,OAAQ;AAAC,MAAA,SAAA,EAASX,EAAG;AAACD,MAAAA,OAAO,EAAEA;KAAQ,CAAA,eACjFT,gBAAA,CAAAuB,aAAA,CAAA,MAAA,EAAA;MAAMnB,SAAS,EAAEsB,+BAAM,CAACC;AAAqB,KAAA,EAAEtB,IAAW,CAAC,EAC1DO,IACW,CAAC;AAEhB,EAAA;EAEA,oBACCZ,gBAAA,CAAAuB,aAAA,CAACK,2BAAa,EAAAH,iCAAA,CAAA,EAAA,EACTP,IAAI,EACJJ,kBAAkB,EAAA;AACtBV,IAAAA,SAAS,EAAEiB,OAAQ;AACnB,IAAA,SAAA,EAASX,EAAG;AACZ,IAAA,aAAA,EAAaH,eAAe,GAAG,MAAM,GAAGsB,SAAU;AAClDxB,IAAAA,IAAI,EAAEA,IAAK;AACXI,IAAAA,OAAO,EAAEA,OAAQ;AACjBN,IAAAA,GAAG,EAAEA,GAAI;AACTS,IAAAA,IAAI,EAAEA;AAAK,GAAA,CACX,CAAC;AAEJ,CACD;;;;"}
1
+ {"version":3,"file":"MrlToolbarButton.js","sources":["../../../../../src/components/toolbar/MrlToolbarButton/MrlToolbarButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport { MrlIconButton, MrlIconButtonProps, MrlMenuItem, MrlMenuItemProps } from '../../../';\n\nimport styles from './MrlToolbarButton.module.scss';\nimport classnames from 'classnames';\nimport { useMrlTrackInteraction } from '../../../hooks/useMrlAnalytics';\n\n/**\n * Props for the MrlToolbarButton component.\n */\nexport interface MrlToolbarButtonProps {\n\t/** Additional class to add to the Toolbar button */\n\tclassName?: string;\n\t/**\n\t * The icon that will be rendered.\n\t */\n\ticon: React.ReactElement;\n\tincludeInRoving?: boolean;\n\t/**\n\t * A prop used to set a toolbar button to never move into the menu.\n\t */\n\tlockedInToolbar?: boolean;\n\t/**\n\t * onClick event for the button.\n\t */\n\tonClick?: (e?: React.MouseEvent<HTMLButtonElement>) => void;\n\t/**\n\t * Props used to control the display of the button in the menu.\n\t */\n\tmenuItemProps?: Omit<MrlMenuItemProps, 'onClick'>;\n\tqa?: string;\n\t/**\n\t * A prop used to render the item in the menu instead of the toolbar.\n\t */\n\trenderInMenu?: boolean;\n\ttext: string;\n\t/**\n\t * Enables interaction tracking for this button. Provide a stable, non-PII id\n\t * (e.g. 'canvas-toolbar-shapes'). When omitted, the button emits no analytics.\n\t */\n\teventId?: string;\n\t/**\n\t * Props used to control the display of the button in the toolbar.\n\t */\n\ttoolbarButtonProps?: {\n\t\tbadge?: MrlIconButtonProps['badge'];\n\t\tdisableEvents?: MrlIconButtonProps['disableEvents'];\n\t\tkind?: MrlIconButtonProps['kind'];\n\t\tloading?: MrlIconButtonProps['loading'];\n\t\tloadingText?: MrlIconButtonProps['loadingText'];\n\t\tonKeyUp?: MrlIconButtonProps['onKeyUp'];\n\t\tonMouseUp?: MrlIconButtonProps['onMouseUp'];\n\t\tposition?: MrlIconButtonProps['position'];\n\t\tsize?: MrlIconButtonProps['size'];\n\t\tstate?: MrlIconButtonProps['state'];\n\t\ttipAnchor?: MrlIconButtonProps['tipAnchor'];\n\t\ttoggleAria?: MrlIconButtonProps['toggleAria'];\n\t\ttoggleStyle?: MrlIconButtonProps['toggleStyle'];\n\t};\n}\n\n/**\n * MrlToolbarButton component.\n * @param props The MrlToolbarButton component properties.\n * @returns The MrlToolbarButton component.\n */\nexport const MrlToolbarButton = React.forwardRef<HTMLButtonElement, MrlToolbarButtonProps>(\n\tfunction MrlToolbarButton(props, ref): JSX.Element {\n\t\tconst {\n\t\t\tclassName,\n\t\t\ticon,\n\t\t\tincludeInRoving = false,\n\t\t\tmenuItemProps,\n\t\t\tonClick,\n\t\t\tqa,\n\t\t\trenderInMenu,\n\t\t\ttext,\n\t\t\ttoolbarButtonProps = {\n\t\t\t\tposition: 'bottom',\n\t\t\t\tsize: 'small',\n\t\t\t\tstate: 'default'\n\t\t\t},\n\t\t\t// pulled out of `rest` so the nested MrlIconButton/MrlMenuItem doesn't emit a\n\t\t\t// second, less specific event for the same interaction.\n\t\t\teventId,\n\t\t\t...rest\n\t\t} = props;\n\t\tconst classes = classnames('MrlToolbarButton', className);\n\n\t\tconst trackInteraction = useMrlTrackInteraction('MrlToolbarButton', eventId);\n\n\t\t/**\n\t\t * Handle onClick events\n\t\t *\n\t\t * @param {React.MouseEvent<HTMLButtonElement>} e - mouse event\n\t\t */\n\t\tconst handleOnClick = (e?: React.MouseEvent<HTMLButtonElement>) => {\n\t\t\ttrackInteraction({\n\t\t\t\taction: 'click',\n\t\t\t\tvariant: renderInMenu ? 'menu' : 'toolbar'\n\t\t\t});\n\n\t\t\tonClick?.(e);\n\t\t};\n\n\t\tif (renderInMenu) {\n\t\t\treturn (\n\t\t\t\t<MrlMenuItem {...menuItemProps} className={classes} data-qa={qa} onClick={handleOnClick}>\n\t\t\t\t\t<span className={styles.MrlToolbarButtonIcon}>{icon}</span>\n\t\t\t\t\t{text}\n\t\t\t\t</MrlMenuItem>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<MrlIconButton\n\t\t\t\t{...rest}\n\t\t\t\t{...toolbarButtonProps}\n\t\t\t\tclassName={classes}\n\t\t\t\tdata-qa={qa}\n\t\t\t\tdata-roving={includeInRoving ? 'true' : undefined}\n\t\t\t\ticon={icon}\n\t\t\t\tonClick={handleOnClick}\n\t\t\t\tref={ref}\n\t\t\t\ttext={text}\n\t\t\t/>\n\t\t);\n\t}\n);\n"],"names":["MrlToolbarButton","React","forwardRef","props","ref","className","icon","_props$includeInRovin","includeInRoving","menuItemProps","onClick","qa","renderInMenu","text","_props$toolbarButtonP","toolbarButtonProps","position","size","state","eventId","rest","_objectWithoutProperties","_excluded","classes","classnames","trackInteraction","useMrlTrackInteraction","handleOnClick","e","action","variant","createElement","MrlMenuItem","_extends","styles","MrlToolbarButtonIcon","MrlIconButton","undefined"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA;AACA;AACA;;AAoDA;AACA;AACA;AACA;AACA;AACO,IAAMA,gBAAgB,gBAAGC,gBAAK,CAACC,UAAU,CAC/C,SAASF,gBAAgBA,CAACG,KAAK,EAAEC,GAAG,EAAe;AAClD,EAAA,IACCC,SAAS,GAiBNF,KAAK,CAjBRE,SAAS;IACTC,IAAI,GAgBDH,KAAK,CAhBRG,IAAI;IAAAC,qBAAA,GAgBDJ,KAAK,CAfRK,eAAe;AAAfA,IAAAA,eAAe,GAAAD,qBAAA,KAAA,MAAA,GAAG,KAAK,GAAAA,qBAAA;IACvBE,aAAa,GAcVN,KAAK,CAdRM,aAAa;IACbC,OAAO,GAaJP,KAAK,CAbRO,OAAO;IACPC,EAAE,GAYCR,KAAK,CAZRQ,EAAE;IACFC,YAAY,GAWTT,KAAK,CAXRS,YAAY;IACZC,IAAI,GAUDV,KAAK,CAVRU,IAAI;IAAAC,qBAAA,GAUDX,KAAK,CATRY,kBAAkB;IAAlBA,kBAAkB,GAAAD,qBAAA,KAAA,MAAA,GAAG;AACpBE,MAAAA,QAAQ,EAAE,QAAQ;AAClBC,MAAAA,IAAI,EAAE,OAAO;AACbC,MAAAA,KAAK,EAAE;AACR,KAAC,GAAAJ,qBAAA;IAGDK,OAAO,GAEJhB,KAAK,CAFRgB,OA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;AACTS,IAAAA,IAAI,EAAEA;AAAK,GAAA,CACX,CAAC;AAEJ,CACD;;;;"}
@@ -9,6 +9,7 @@ var classnames = require('classnames');
9
9
  var index = require('../useTooltipPosition/index.js');
10
10
  var web = require('@react-spring/web');
11
11
  var index$1 = require('../../../utils/layers/index.js');
12
+ var useMrlAnalytics = require('../../../hooks/useMrlAnalytics/useMrlAnalytics.js');
12
13
  var setAttributes = require('../../../utils/setAttributes/setAttributes.js');
13
14
  var MrlPortal = require('../../portal/MrlPortal.js');
14
15
 
@@ -35,7 +36,7 @@ function _interopNamespace(e) {
35
36
  var React__namespace = /*#__PURE__*/_interopNamespace(React);
36
37
  var classnames__default = /*#__PURE__*/_interopDefault(classnames);
37
38
 
38
- var _excluded = ["children", "clickToClose", "disableTooltipHover", "display", "text", "attrs", "dataQa", "position", "anchor", "srAnnouncement", "tooltipClass", "tooltipContentClass"],
39
+ var _excluded = ["children", "clickToClose", "disableTooltipHover", "display", "text", "attrs", "dataQa", "position", "anchor", "srAnnouncement", "tooltipClass", "tooltipContentClass", "eventId"],
39
40
  _excluded2 = ["className", "onBlur", "onFocus", "onKeyDown", "onMouseOver", "onMouseOut", "onMouseUp", "children"];
40
41
  /**
41
42
  * MrlTooltip Component
@@ -65,7 +66,9 @@ var MrlTooltip = /*#__PURE__*/React__namespace.memo(props => {
65
66
  srAnnouncement = _props$srAnnouncement === void 0 ? true : _props$srAnnouncement,
66
67
  tooltipClass = props.tooltipClass,
67
68
  tooltipContentClass = props.tooltipContentClass,
69
+ eventId = props.eventId,
68
70
  rest = _rollupPluginBabelHelpers.objectWithoutProperties(props, _excluded);
71
+ var trackInteraction = useMrlAnalytics.useMrlTrackInteraction('MrlTooltip', eventId);
69
72
  var _React$useState = React__namespace.useState('mouse'),
70
73
  _React$useState2 = _rollupPluginBabelHelpers.slicedToArray(_React$useState, 2),
71
74
  interaction = _React$useState2[0],
@@ -89,6 +92,25 @@ var MrlTooltip = /*#__PURE__*/React__namespace.memo(props => {
89
92
  id = _React$useState6[0],
90
93
  setId = _React$useState6[1];
91
94
 
95
+ /**
96
+ * The tooltip shows and hides from hover, focus and click, so open/close is emitted
97
+ * from the resulting display state rather than from each individual handler.
98
+ */
99
+ var previousDisplayRef = React__namespace.useRef(defaultDisplay);
100
+ React__namespace.useEffect(() => {
101
+ if (previousDisplayRef.current === display) return;
102
+ previousDisplayRef.current = display;
103
+ trackInteraction({
104
+ action: display === 'show' ? 'open' : 'close',
105
+ metadata: {
106
+ interaction
107
+ },
108
+ variant: position
109
+ });
110
+ // `interaction` only annotates the event; it must not re-trigger it
111
+ // eslint-disable-next-line react-hooks/exhaustive-deps
112
+ }, [display, position, trackInteraction]);
113
+
92
114
  /**
93
115
  * Event handler to show tooltip when the trigger is focused
94
116
  */
@@ -1 +1 @@
1
- {"version":3,"file":"MrlTooltip.js","sources":["../../../../../src/components/tooltip/MrlTooltip/MrlTooltip.tsx"],"sourcesContent":["import * as React from 'react';\nimport { AttrsObject, getUniqueId } from '../../../utils';\nimport {\n\tMrlTooltipAnchor,\n\tMrlTooltipDefaults,\n\tMrlTooltipPosition,\n\tMrlTooltipState\n} from '../constants';\nimport { MrlTooltipContent } from '../MrlTooltipContent/MrlTooltipContent';\nimport { curryHandlers } from '../utils';\nimport classNames from 'classnames';\nimport { MrlPortal } from '../../portal';\nimport '../../../styles/shared/a11y-helpers/a11y.global.scss';\nimport { useTooltipPosition } from '../useTooltipPosition';\nimport { useTransition, animated } from '@react-spring/web';\nimport { PORTAL_LAYERS } from '../../../utils/layers';\n\ninterface MrlTooltipProps {\n\t/** The arrow position of the tooltip in relation to its trigger's content */\n\tanchor?: MrlTooltipAnchor;\n\n\t/**\n\t * Attributes that are applied to the component during the initial render.\n\t *\n\t * Example usage: html attributes, custom data attributes (data-qa), aria\n\t * @deprecated please use props for component instead\n\t */\n\tattrs?: AttrsObject;\n\n\t/**\n\t * Children to be rendered within the tooltip. The first child is used as the trigger.\n\t *\n\t * Warning: The tooltip is only setup to work with a single trigger. If multiple children\n\t * are passed in the component will not have event handling for the additional child elements.\n\t */\n\tchildren: React.ReactElement;\n\n\t/** Whether the tooltip should close when clicked */\n\tclickToClose?: boolean;\n\n\t/** The data-qa attribute for the tooltip */\n\tdataQa?: string;\n\n\t/** The state value to determine if the tooltip should be displayed */\n\tdisplay?: MrlTooltipState;\n\n\t/** Whether to disable the tooltip hover action that keeps it open */\n\tdisableTooltipHover?: boolean;\n\n\t/** The placement of the tooltip in relation to its trigger */\n\tposition?: MrlTooltipPosition;\n\n\t/** Whether to announce the tooltip content to screen readers */\n\tsrAnnouncement?: boolean;\n\n\t/** The textual label of tooltip */\n\ttext: string;\n\n\t/** A custom class selector to be applied to the tooltip wrapper */\n\ttooltipClass?: string;\n\n\t/** A class to be applied ot the tooltip content */\n\ttooltipContentClass?: string;\n\n\t/** A custom render function to render the tooltip content */\n\tcustomRender?: (text?: string) => React.ReactNode;\n}\n\n/**\n * MrlTooltip Component\n *\n * This component is not displayed when rendering this component if the primary pointing device can’t hover. Examples include touchscreens and screens that use a basic drawing stylus.\n * Pointing devices that can hover, but for which doing so is inconvenient and not part of the normal way they are used, also match this criteria. For example, a touchscreen where a long press is treated as hovering.\n * @param {MrlTooltipProps} props - The props of the component\n * @returns {HTMLElement} a configured Tooltip component\n */\nexport const MrlTooltip = React.memo((props: MrlTooltipProps): React.ReactElement => {\n\tconst {\n\t\tchildren,\n\t\tclickToClose = true,\n\t\tdisableTooltipHover = false,\n\t\tdisplay: defaultDisplay = 'hide',\n\t\ttext,\n\t\tattrs = {},\n\t\tdataQa,\n\t\tposition = MrlTooltipDefaults.position || 'top',\n\t\tanchor = MrlTooltipDefaults.anchor,\n\t\tsrAnnouncement = true,\n\t\ttooltipClass,\n\t\ttooltipContentClass,\n\t\t...rest\n\t} = props;\n\n\tconst [interaction, setInteraction] = React.useState('mouse');\n\n\tconst triggerRef = React.useRef<HTMLElement | null>(null);\n\n\tconst tooltipRef = React.useRef<HTMLDivElement>(null);\n\n\t/**\n\t * State value to determine if the tooltip should be displayed\n\t */\n\tconst [display, setDisplay] = React.useState<MrlTooltipState>(defaultDisplay);\n\n\t/**\n\t * State value to determine if the tooltip should be displayed\n\t */\n\tconst [id, setId] = React.useState<string>('');\n\n\t/**\n\t * Event handler to show tooltip when the trigger is focused\n\t */\n\tconst handleShowTooltip = React.useCallback(() => {\n\t\tsetDisplay('show');\n\t}, []);\n\n\tconst handleFocus = React.useCallback(() => {\n\t\tif (interaction === 'keyboard') {\n\t\t\thandleShowTooltip();\n\t\t}\n\t}, [interaction, handleShowTooltip]);\n\n\t/**\n\t * Event handler to hide the tooltip on mouseout\n\t */\n\tconst handleHideTooltip = (): void => {\n\t\tsetDisplay('hide');\n\t};\n\n\t/**\n\t * Event handler to hide the tooltip when a user presses escape\n\t * @param {React.KeyboardEvent} e Keyboard event\n\t */\n\tconst handleKeyDown = (e: React.KeyboardEvent): void => {\n\t\tif (e.key === 'Escape' || e.key === 'Enter' || e.key === ' ') {\n\t\t\thandleHideTooltip();\n\t\t}\n\t};\n\n\tconst handleSetKeyboardInteraction = (e: KeyboardEvent) => {\n\t\tif (e.key === 'Tab' || e.key === 'Enter' || e.key === ' ') {\n\t\t\tsetInteraction('keyboard');\n\t\t}\n\t};\n\n\tconst handlesetMouseInteraction = () => setInteraction('mouse');\n\n\t/**\n\t * Setup of the initial component attributes and events\n\t */\n\tReact.useEffect(() => {\n\t\tif (id === '') setId(getUniqueId('mrl-tooltip'));\n\t}, [id]);\n\n\tReact.useEffect(() => {\n\t\tsetDisplay(defaultDisplay);\n\t}, [defaultDisplay]);\n\n\t/**\n\t * Setting the triggerRef to the trigger element\n\t *\n\t * We need to use 'querySelector' because we cannot pass a ref to the child object. There are\n\t * some situations where the child component may not accept a ref, for example: a react router\n\t * link is passed as a child. In older versions of react router you could not pass a ref to the\n\t * component so this causes an issue.\n\t */\n\tReact.useEffect(() => {\n\t\tconst trigger = document.querySelector(`[data-tooltip-id=\"${id}\"]`);\n\t\ttriggerRef.current = trigger as HTMLElement;\n\t}, [id]);\n\n\tReact.useEffect(() => {\n\t\tconst currentTooltipRef = tooltipRef.current;\n\n\t\tdocument.addEventListener('keydown', handleSetKeyboardInteraction);\n\t\tdocument.addEventListener('mousedown', handlesetMouseInteraction);\n\n\t\tif (!disableTooltipHover && currentTooltipRef) {\n\t\t\tcurrentTooltipRef.addEventListener('mouseover', handleShowTooltip);\n\t\t\tcurrentTooltipRef.addEventListener('mouseout', handleHideTooltip);\n\t\t}\n\n\t\treturn () => {\n\t\t\tif (!disableTooltipHover && currentTooltipRef) {\n\t\t\t\tcurrentTooltipRef.removeEventListener('mouseover', handleShowTooltip);\n\t\t\t\tcurrentTooltipRef.removeEventListener('mouseout', handleHideTooltip);\n\t\t\t}\n\n\t\t\tdocument.removeEventListener('keydown', handleSetKeyboardInteraction);\n\t\t\tdocument.removeEventListener('mousedown', handlesetMouseInteraction);\n\t\t};\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [handleShowTooltip, tooltipRef.current]);\n\n\tconst positionStyles = useTooltipPosition(\n\t\ttriggerRef,\n\t\ttooltipRef,\n\t\t{\n\t\t\talign: anchor,\n\t\t\tposition: position\n\t\t},\n\t\tdisplay === 'show',\n\t\t-1\n\t);\n\n\tconst inlineStyles = {\n\t\tmenu: {\n\t\t\tleft: positionStyles.left,\n\t\t\tposition: 'fixed' as const,\n\t\t\ttop: positionStyles.top\n\t\t}\n\t};\n\n\tconst transitions = useTransition(display === 'show', {\n\t\tconfig: { duration: display === 'show' ? 150 : 25 },\n\t\tenter: { opacity: 1 },\n\t\tfrom: { opacity: 0 },\n\t\tleave: { opacity: 0 }\n\t});\n\n\treturn (\n\t\t<>\n\t\t\t{React.Children.map(children, (child, index) => {\n\t\t\t\tif (index === 0 && React.isValidElement(child)) {\n\t\t\t\t\tconst {\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t\tonBlur,\n\t\t\t\t\t\tonFocus,\n\t\t\t\t\t\tonKeyDown,\n\t\t\t\t\t\tonMouseOver,\n\t\t\t\t\t\tonMouseOut,\n\t\t\t\t\t\tonMouseUp,\n\t\t\t\t\t\tchildren,\n\t\t\t\t\t\t...otherProps\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\t} = (child as any).props;\n\n\t\t\t\t\treturn React.cloneElement(child as React.ReactElement, {\n\t\t\t\t\t\t'aria-describedby': display === 'show' && srAnnouncement ? id : undefined,\n\t\t\t\t\t\tclassName: classNames(\n\t\t\t\t\t\t\ttooltipClass,\n\t\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t\t'mrl-tooltip-trigger',\n\t\t\t\t\t\t\tdisplay === 'show' && 'mrl-tooltip-trigger--active'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tonBlur: curryHandlers(onBlur, handleHideTooltip),\n\t\t\t\t\t\t...(clickToClose && !disableTooltipHover\n\t\t\t\t\t\t\t? { onMouseUp: curryHandlers(onMouseUp, handleHideTooltip) }\n\t\t\t\t\t\t\t: {}),\n\t\t\t\t\t\tonFocus: curryHandlers(onFocus, handleFocus),\n\t\t\t\t\t\tonKeyDown: curryHandlers(onKeyDown, handleKeyDown),\n\t\t\t\t\t\tonMouseOut: curryHandlers(onMouseOut, handleHideTooltip),\n\t\t\t\t\t\tonMouseOver: curryHandlers(onMouseOver, handleShowTooltip),\n\t\t\t\t\t\t...otherProps,\n\t\t\t\t\t\tchildren,\n\t\t\t\t\t\t['data-tooltip-id']: id\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn child;\n\t\t\t})}\n\t\t\t<MrlPortal\n\t\t\t\tid={PORTAL_LAYERS.TOOLTIP.name}\n\t\t\t\tlayer={PORTAL_LAYERS.TOOLTIP}\n\t\t\t\tclassName={PORTAL_LAYERS.TOOLTIP.name}\n\t\t\t\tdata-qa={PORTAL_LAYERS.TOOLTIP.name}\n\t\t\t>\n\t\t\t\t{transitions(\n\t\t\t\t\t(style, item) =>\n\t\t\t\t\t\titem && (\n\t\t\t\t\t\t\t<animated.div ref={tooltipRef} style={{ ...inlineStyles.menu, ...style }}>\n\t\t\t\t\t\t\t\t<MrlTooltipContent\n\t\t\t\t\t\t\t\t\t{...rest}\n\t\t\t\t\t\t\t\t\tattrs={attrs}\n\t\t\t\t\t\t\t\t\tanchor={anchor}\n\t\t\t\t\t\t\t\t\tdataQa={dataQa}\n\t\t\t\t\t\t\t\t\tid={id}\n\t\t\t\t\t\t\t\t\tposition={position}\n\t\t\t\t\t\t\t\t\ttext={text}\n\t\t\t\t\t\t\t\t\ttooltipContentClass={tooltipContentClass}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</animated.div>\n\t\t\t\t\t\t)\n\t\t\t\t)}\n\t\t\t</MrlPortal>\n\t\t</>\n\t);\n});\n\nMrlTooltip.displayName = 'MrlTooltip';\n"],"names":["MrlTooltip","React","memo","props","children","_props$clickToClose","clickToClose","_props$disableTooltip","disableTooltipHover","_props$display","display","defaultDisplay","text","_props$attrs","attrs","dataQa","_props$position","position","MrlTooltipDefaults","_props$anchor","anchor","_props$srAnnouncement","srAnnouncement","tooltipClass","tooltipContentClass","rest","_objectWithoutProperties","_excluded","_React$useState","useState","_React$useState2","_slicedToArray","interaction","setInteraction","triggerRef","useRef","tooltipRef","_React$useState3","_React$useState4","setDisplay","_React$useState5","_React$useState6","id","setId","handleShowTooltip","useCallback","handleFocus","handleHideTooltip","handleKeyDown","e","key","handleSetKeyboardInteraction","handlesetMouseInteraction","useEffect","getUniqueId","trigger","document","querySelector","concat","current","currentTooltipRef","addEventListener","removeEventListener","positionStyles","useTooltipPosition","align","inlineStyles","menu","left","top","transitions","useTransition","config","duration","enter","opacity","from","leave","createElement","Fragment","Children","map","child","index","isValidElement","_props","className","onBlur","onFocus","onKeyDown","onMouseOver","onMouseOut","onMouseUp","otherProps","_excluded2","cloneElement","_objectSpread","undefined","classNames","curryHandlers","MrlPortal","PORTAL_LAYERS","TOOLTIP","name","layer","style","item","animated","div","ref","MrlTooltipContent","_extends","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,WAAW,CACX,CAACmC,KAAK,EAAEC,IAAI,KACXA,IAAI,iBACHzG,gBAAA,CAAA6E,aAAA,CAAC6B,YAAQ,CAACC,GAAG,EAAA;AAACC,IAAAA,GAAG,EAAEzE,UAAW;IAACqE,KAAK,EAAAT,uCAAA,CAAAA,uCAAA,KAAO9B,YAAY,CAACC,IAAI,CAAA,EAAKsC,KAAK;GAAG,eACxExG,gBAAA,CAAA6E,aAAA,CAACgC,mCAAiB,EAAAC,iCAAA,KACbtF,IAAI,EAAA;AACRX,IAAAA,KAAK,EAAEA,KAAM;AACbM,IAAAA,MAAM,EAAEA,MAAO;AACfL,IAAAA,MAAM,EAAEA,MAAO;AACf2B,IAAAA,EAAE,EAAEA,EAAG;AACPzB,IAAAA,QAAQ,EAAEA,QAAS;AACnBL,IAAAA,IAAI,EAAEA,IAAK;AACXY,IAAAA,mBAAmB,EAAEA;AAAoB,GAAA,CACzC,CACY,CAEjB,CACU,CACV,CAAC;AAEL,CAAC;AAEDxB,UAAU,CAACgH,WAAW,GAAG,YAAY;;;;"}
1
+ {"version":3,"file":"MrlTooltip.js","sources":["../../../../../src/components/tooltip/MrlTooltip/MrlTooltip.tsx"],"sourcesContent":["import * as React from 'react';\nimport { AttrsObject, getUniqueId } from '../../../utils';\nimport {\n\tMrlTooltipAnchor,\n\tMrlTooltipDefaults,\n\tMrlTooltipPosition,\n\tMrlTooltipState\n} from '../constants';\nimport { MrlTooltipContent } from '../MrlTooltipContent/MrlTooltipContent';\nimport { curryHandlers } from '../utils';\nimport classNames from 'classnames';\nimport { MrlPortal } from '../../portal';\nimport '../../../styles/shared/a11y-helpers/a11y.global.scss';\nimport { useTooltipPosition } from '../useTooltipPosition';\nimport { useTransition, animated } from '@react-spring/web';\nimport { PORTAL_LAYERS } from '../../../utils/layers';\nimport { useMrlTrackInteraction } from '../../../hooks/useMrlAnalytics';\n\ninterface MrlTooltipProps {\n\t/** The arrow position of the tooltip in relation to its trigger's content */\n\tanchor?: MrlTooltipAnchor;\n\n\t/**\n\t * Attributes that are applied to the component during the initial render.\n\t *\n\t * Example usage: html attributes, custom data attributes (data-qa), aria\n\t * @deprecated please use props for component instead\n\t */\n\tattrs?: AttrsObject;\n\n\t/**\n\t * Children to be rendered within the tooltip. The first child is used as the trigger.\n\t *\n\t * Warning: The tooltip is only setup to work with a single trigger. If multiple children\n\t * are passed in the component will not have event handling for the additional child elements.\n\t */\n\tchildren: React.ReactElement;\n\n\t/** Whether the tooltip should close when clicked */\n\tclickToClose?: boolean;\n\n\t/** The data-qa attribute for the tooltip */\n\tdataQa?: string;\n\n\t/** The state value to determine if the tooltip should be displayed */\n\tdisplay?: MrlTooltipState;\n\n\t/** Whether to disable the tooltip hover action that keeps it open */\n\tdisableTooltipHover?: boolean;\n\n\t/** The placement of the tooltip in relation to its trigger */\n\tposition?: MrlTooltipPosition;\n\n\t/** Whether to announce the tooltip content to screen readers */\n\tsrAnnouncement?: boolean;\n\n\t/** The textual label of tooltip */\n\ttext: string;\n\n\t/** A custom class selector to be applied to the tooltip wrapper */\n\ttooltipClass?: string;\n\n\t/** A class to be applied ot the tooltip content */\n\ttooltipContentClass?: string;\n\n\t/** A custom render function to render the tooltip content */\n\tcustomRender?: (text?: string) => React.ReactNode;\n\n\t/**\n\t * Enables interaction tracking for this tooltip. Provide a stable, non-PII id\n\t * (e.g. 'facilitation-timer-tooltip'). When omitted, the tooltip emits no analytics.\n\t *\n\t * Note: tooltips open on hover, so an instrumented tooltip is a high-volume source.\n\t * Only add an id where the reveal itself is the signal you need.\n\t */\n\teventId?: string;\n}\n\n/**\n * MrlTooltip Component\n *\n * This component is not displayed when rendering this component if the primary pointing device can’t hover. Examples include touchscreens and screens that use a basic drawing stylus.\n * Pointing devices that can hover, but for which doing so is inconvenient and not part of the normal way they are used, also match this criteria. For example, a touchscreen where a long press is treated as hovering.\n * @param {MrlTooltipProps} props - The props of the component\n * @returns {HTMLElement} a configured Tooltip component\n */\nexport const MrlTooltip = React.memo((props: MrlTooltipProps): React.ReactElement => {\n\tconst {\n\t\tchildren,\n\t\tclickToClose = true,\n\t\tdisableTooltipHover = false,\n\t\tdisplay: defaultDisplay = 'hide',\n\t\ttext,\n\t\tattrs = {},\n\t\tdataQa,\n\t\tposition = MrlTooltipDefaults.position || 'top',\n\t\tanchor = MrlTooltipDefaults.anchor,\n\t\tsrAnnouncement = true,\n\t\ttooltipClass,\n\t\ttooltipContentClass,\n\t\teventId,\n\t\t...rest\n\t} = props;\n\n\tconst trackInteraction = useMrlTrackInteraction('MrlTooltip', eventId);\n\n\tconst [interaction, setInteraction] = React.useState('mouse');\n\n\tconst triggerRef = React.useRef<HTMLElement | null>(null);\n\n\tconst tooltipRef = React.useRef<HTMLDivElement>(null);\n\n\t/**\n\t * State value to determine if the tooltip should be displayed\n\t */\n\tconst [display, setDisplay] = React.useState<MrlTooltipState>(defaultDisplay);\n\n\t/**\n\t * State value to determine if the tooltip should be displayed\n\t */\n\tconst [id, setId] = React.useState<string>('');\n\n\t/**\n\t * The tooltip shows and hides from hover, focus and click, so open/close is emitted\n\t * from the resulting display state rather than from each individual handler.\n\t */\n\tconst previousDisplayRef = React.useRef<MrlTooltipState>(defaultDisplay);\n\n\tReact.useEffect(() => {\n\t\tif (previousDisplayRef.current === display) return;\n\n\t\tpreviousDisplayRef.current = display;\n\n\t\ttrackInteraction({\n\t\t\taction: display === 'show' ? 'open' : 'close',\n\t\t\tmetadata: { interaction },\n\t\t\tvariant: position\n\t\t});\n\t\t// `interaction` only annotates the event; it must not re-trigger it\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [display, position, trackInteraction]);\n\n\t/**\n\t * Event handler to show tooltip when the trigger is focused\n\t */\n\tconst handleShowTooltip = React.useCallback(() => {\n\t\tsetDisplay('show');\n\t}, []);\n\n\tconst handleFocus = React.useCallback(() => {\n\t\tif (interaction === 'keyboard') {\n\t\t\thandleShowTooltip();\n\t\t}\n\t}, [interaction, handleShowTooltip]);\n\n\t/**\n\t * Event handler to hide the tooltip on mouseout\n\t */\n\tconst handleHideTooltip = (): void => {\n\t\tsetDisplay('hide');\n\t};\n\n\t/**\n\t * Event handler to hide the tooltip when a user presses escape\n\t * @param {React.KeyboardEvent} e Keyboard event\n\t */\n\tconst handleKeyDown = (e: React.KeyboardEvent): void => {\n\t\tif (e.key === 'Escape' || e.key === 'Enter' || e.key === ' ') {\n\t\t\thandleHideTooltip();\n\t\t}\n\t};\n\n\tconst handleSetKeyboardInteraction = (e: KeyboardEvent) => {\n\t\tif (e.key === 'Tab' || e.key === 'Enter' || e.key === ' ') {\n\t\t\tsetInteraction('keyboard');\n\t\t}\n\t};\n\n\tconst handlesetMouseInteraction = () => setInteraction('mouse');\n\n\t/**\n\t * Setup of the initial component attributes and events\n\t */\n\tReact.useEffect(() => {\n\t\tif (id === '') setId(getUniqueId('mrl-tooltip'));\n\t}, [id]);\n\n\tReact.useEffect(() => {\n\t\tsetDisplay(defaultDisplay);\n\t}, [defaultDisplay]);\n\n\t/**\n\t * Setting the triggerRef to the trigger element\n\t *\n\t * We need to use 'querySelector' because we cannot pass a ref to the child object. There are\n\t * some situations where the child component may not accept a ref, for example: a react router\n\t * link is passed as a child. In older versions of react router you could not pass a ref to the\n\t * component so this causes an issue.\n\t */\n\tReact.useEffect(() => {\n\t\tconst trigger = document.querySelector(`[data-tooltip-id=\"${id}\"]`);\n\t\ttriggerRef.current = trigger as HTMLElement;\n\t}, [id]);\n\n\tReact.useEffect(() => {\n\t\tconst currentTooltipRef = tooltipRef.current;\n\n\t\tdocument.addEventListener('keydown', handleSetKeyboardInteraction);\n\t\tdocument.addEventListener('mousedown', handlesetMouseInteraction);\n\n\t\tif (!disableTooltipHover && currentTooltipRef) {\n\t\t\tcurrentTooltipRef.addEventListener('mouseover', handleShowTooltip);\n\t\t\tcurrentTooltipRef.addEventListener('mouseout', handleHideTooltip);\n\t\t}\n\n\t\treturn () => {\n\t\t\tif (!disableTooltipHover && currentTooltipRef) {\n\t\t\t\tcurrentTooltipRef.removeEventListener('mouseover', handleShowTooltip);\n\t\t\t\tcurrentTooltipRef.removeEventListener('mouseout', handleHideTooltip);\n\t\t\t}\n\n\t\t\tdocument.removeEventListener('keydown', handleSetKeyboardInteraction);\n\t\t\tdocument.removeEventListener('mousedown', handlesetMouseInteraction);\n\t\t};\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [handleShowTooltip, tooltipRef.current]);\n\n\tconst positionStyles = useTooltipPosition(\n\t\ttriggerRef,\n\t\ttooltipRef,\n\t\t{\n\t\t\talign: anchor,\n\t\t\tposition: position\n\t\t},\n\t\tdisplay === 'show',\n\t\t-1\n\t);\n\n\tconst inlineStyles = {\n\t\tmenu: {\n\t\t\tleft: positionStyles.left,\n\t\t\tposition: 'fixed' as const,\n\t\t\ttop: positionStyles.top\n\t\t}\n\t};\n\n\tconst transitions = useTransition(display === 'show', {\n\t\tconfig: { duration: display === 'show' ? 150 : 25 },\n\t\tenter: { opacity: 1 },\n\t\tfrom: { opacity: 0 },\n\t\tleave: { opacity: 0 }\n\t});\n\n\treturn (\n\t\t<>\n\t\t\t{React.Children.map(children, (child, index) => {\n\t\t\t\tif (index === 0 && React.isValidElement(child)) {\n\t\t\t\t\tconst {\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t\tonBlur,\n\t\t\t\t\t\tonFocus,\n\t\t\t\t\t\tonKeyDown,\n\t\t\t\t\t\tonMouseOver,\n\t\t\t\t\t\tonMouseOut,\n\t\t\t\t\t\tonMouseUp,\n\t\t\t\t\t\tchildren,\n\t\t\t\t\t\t...otherProps\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\t} = (child as any).props;\n\n\t\t\t\t\treturn React.cloneElement(child as React.ReactElement, {\n\t\t\t\t\t\t'aria-describedby': display === 'show' && srAnnouncement ? id : undefined,\n\t\t\t\t\t\tclassName: classNames(\n\t\t\t\t\t\t\ttooltipClass,\n\t\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t\t'mrl-tooltip-trigger',\n\t\t\t\t\t\t\tdisplay === 'show' && 'mrl-tooltip-trigger--active'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tonBlur: curryHandlers(onBlur, handleHideTooltip),\n\t\t\t\t\t\t...(clickToClose && !disableTooltipHover\n\t\t\t\t\t\t\t? { onMouseUp: curryHandlers(onMouseUp, handleHideTooltip) }\n\t\t\t\t\t\t\t: {}),\n\t\t\t\t\t\tonFocus: curryHandlers(onFocus, handleFocus),\n\t\t\t\t\t\tonKeyDown: curryHandlers(onKeyDown, handleKeyDown),\n\t\t\t\t\t\tonMouseOut: curryHandlers(onMouseOut, handleHideTooltip),\n\t\t\t\t\t\tonMouseOver: curryHandlers(onMouseOver, handleShowTooltip),\n\t\t\t\t\t\t...otherProps,\n\t\t\t\t\t\tchildren,\n\t\t\t\t\t\t['data-tooltip-id']: id\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\treturn child;\n\t\t\t})}\n\t\t\t<MrlPortal\n\t\t\t\tid={PORTAL_LAYERS.TOOLTIP.name}\n\t\t\t\tlayer={PORTAL_LAYERS.TOOLTIP}\n\t\t\t\tclassName={PORTAL_LAYERS.TOOLTIP.name}\n\t\t\t\tdata-qa={PORTAL_LAYERS.TOOLTIP.name}\n\t\t\t>\n\t\t\t\t{transitions(\n\t\t\t\t\t(style, item) =>\n\t\t\t\t\t\titem && (\n\t\t\t\t\t\t\t<animated.div ref={tooltipRef} style={{ ...inlineStyles.menu, ...style }}>\n\t\t\t\t\t\t\t\t<MrlTooltipContent\n\t\t\t\t\t\t\t\t\t{...rest}\n\t\t\t\t\t\t\t\t\tattrs={attrs}\n\t\t\t\t\t\t\t\t\tanchor={anchor}\n\t\t\t\t\t\t\t\t\tdataQa={dataQa}\n\t\t\t\t\t\t\t\t\tid={id}\n\t\t\t\t\t\t\t\t\tposition={position}\n\t\t\t\t\t\t\t\t\ttext={text}\n\t\t\t\t\t\t\t\t\ttooltipContentClass={tooltipContentClass}\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</animated.div>\n\t\t\t\t\t\t)\n\t\t\t\t)}\n\t\t\t</MrlPortal>\n\t\t</>\n\t);\n});\n\nMrlTooltip.displayName = 'MrlTooltip';\n"],"names":["MrlTooltip","React","memo","props","children","_props$clickToClose","clickToClose","_props$disableTooltip","disableTooltipHover","_props$display","display","defaultDisplay","text","_props$attrs","attrs","dataQa","_props$position","position","MrlTooltipDefaults","_props$anchor","anchor","_props$srAnnouncement","srAnnouncement","tooltipClass","tooltipContentClass","eventId","rest","_objectWithoutProperties","_excluded","trackInteraction","useMrlTrackInteraction","_React$useState","useState","_React$useState2","_slicedToArray","interaction","setInteraction","triggerRef","useRef","tooltipRef","_React$useState3","_React$useState4","setDisplay","_React$useState5","_React$useState6","id","setId","previousDisplayRef","useEffect","current","action","metadata","variant","handleShowTooltip","useCallback","handleFocus","handleHideTooltip","handleKeyDown","e","key","handleSetKeyboardInteraction","handlesetMouseInteraction","getUniqueId","trigger","document","querySelector","concat","currentTooltipRef","addEventListener","removeEventListener","positionStyles","useTooltipPosition","align","inlineStyles","menu","left","top","transitions","useTransition","config","duration","enter","opacity","from","leave","createElement","Fragment","Children","map","child","index","isValidElement","_props","className","onBlur","onFocus","onKeyDown","onMouseOver","onMouseOut","onMouseUp","otherProps","_excluded2","cloneElement","_objectSpread","undefined","classNames","curryHandlers","MrlPortal","PORTAL_LAYERS","TOOLTIP","name","layer","style","item","animated","div","ref","MrlTooltipContent","_extends","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8EA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,IAAMA,UAAU,gBAAGC,gBAAK,CAACC,IAAI,CAAEC,KAAsB,IAAyB;AACpF,EAAA,IACCC,QAAQ,GAcLD,KAAK,CAdRC,QAAQ;IAAAC,mBAAA,GAcLF,KAAK,CAbRG,YAAY;AAAZA,IAAAA,YAAY,GAAAD,mBAAA,KAAA,MAAA,GAAG,IAAI,GAA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A,OAAO4C,KAAK;AACb,EAAA,CAAC,CAAC,eACFxF,gBAAA,CAAAoF,aAAA,CAACsB,mBAAS,EAAA;AACT9D,IAAAA,EAAE,EAAE+D,qBAAa,CAACC,OAAO,CAACC,IAAK;IAC/BC,KAAK,EAAEH,qBAAa,CAACC,OAAQ;AAC7BhB,IAAAA,SAAS,EAAEe,qBAAa,CAACC,OAAO,CAACC,IAAK;IACtC,SAAA,EAASF,qBAAa,CAACC,OAAO,CAACC;AAAK,GAAA,EAEnCjC,WAAW,CACX,CAACmC,KAAK,EAAEC,IAAI,KACXA,IAAI,iBACHhH,gBAAA,CAAAoF,aAAA,CAAC6B,YAAQ,CAACC,GAAG,EAAA;AAACC,IAAAA,GAAG,EAAE7E,UAAW;IAACyE,KAAK,EAAAT,uCAAA,CAAAA,uCAAA,KAAO9B,YAAY,CAACC,IAAI,CAAA,EAAKsC,KAAK;GAAG,eACxE/G,gBAAA,CAAAoF,aAAA,CAACgC,mCAAiB,EAAAC,iCAAA,KACb5F,IAAI,EAAA;AACRZ,IAAAA,KAAK,EAAEA,KAAM;AACbM,IAAAA,MAAM,EAAEA,MAAO;AACfL,IAAAA,MAAM,EAAEA,MAAO;AACf8B,IAAAA,EAAE,EAAEA,EAAG;AACP5B,IAAAA,QAAQ,EAAEA,QAAS;AACnBL,IAAAA,IAAI,EAAEA,IAAK;AACXY,IAAAA,mBAAmB,EAAEA;AAAoB,GAAA,CACzC,CACY,CAEjB,CACU,CACV,CAAC;AAEL,CAAC;AAEDxB,UAAU,CAACuH,WAAW,GAAG,YAAY;;;;"}
@@ -31,15 +31,15 @@ var React__namespace = /*#__PURE__*/_interopNamespace(React);
31
31
  */
32
32
  var useMrlAnalytics = () => React__namespace.useContext(MrlAnalyticsContext.MrlAnalyticsContext);
33
33
  /**
34
- * Component-facing helper. Binds component identity + trackingId once, then
35
- * `emit({ action })` per interaction. No-ops entirely when trackingId is absent,
34
+ * Component-facing helper. Binds component identity + eventId once, then
35
+ * `emit({ action })` per interaction. No-ops entirely when eventId is absent,
36
36
  * so instrumentation is opt-in and attributable.
37
37
  *
38
38
  * @param component - the emitting component's name, e.g. 'MrlButton'
39
- * @param trackingId - consumer-supplied, non-PII id; undefined disables emission
39
+ * @param eventId - consumer-supplied, non-PII id; undefined disables emission
40
40
  * @returns an `emit` callback that fires a single interaction per call
41
41
  */
42
- var useMrlTrackInteraction = (component, trackingId) => {
42
+ var useMrlTrackInteraction = (component, eventId) => {
43
43
  var _useMrlAnalytics = useMrlAnalytics(),
44
44
  track = _useMrlAnalytics.track;
45
45
  return React__namespace.useCallback(_ref => {
@@ -47,20 +47,20 @@ var useMrlTrackInteraction = (component, trackingId) => {
47
47
  variant = _ref.variant,
48
48
  metadata = _ref.metadata;
49
49
  // opt-in: no id → no event (volume + PII guard)
50
- if (!trackingId) return;
50
+ if (!eventId) return;
51
51
  try {
52
52
  track({
53
53
  action,
54
54
  component,
55
+ eventId,
55
56
  metadata,
56
57
  toolkitVersion: version.TOOLKIT_VERSION,
57
- trackingId,
58
58
  variant
59
59
  });
60
60
  } catch (e) {
61
61
  return;
62
62
  }
63
- }, [track, component, trackingId]);
63
+ }, [track, component, eventId]);
64
64
  };
65
65
 
66
66
  exports.useMrlAnalytics = useMrlAnalytics;
@@ -1 +1 @@
1
- {"version":3,"file":"useMrlAnalytics.js","sources":["../../../../src/hooks/useMrlAnalytics/useMrlAnalytics.ts"],"sourcesContent":["import * as React from 'react';\nimport { MrlAnalyticsContext } from '../../contexts/MrlAnalyticsContext';\nimport { MrlAnalyticsEvent, MrlTrack } from '../../contexts/MrlAnalyticsContext/types';\nimport { TOOLKIT_VERSION } from '../../version';\n\n/**\n * Raw accessor for the analytics context.\n *\n * @returns the injected `track` transport (default no-op)\n */\nexport const useMrlAnalytics = (): { track: MrlTrack } => React.useContext(MrlAnalyticsContext);\n\ntype EmitArgs = Pick<MrlAnalyticsEvent, 'action' | 'variant' | 'metadata'>;\n\n/**\n * Component-facing helper. Binds component identity + trackingId once, then\n * `emit({ action })` per interaction. No-ops entirely when trackingId is absent,\n * so instrumentation is opt-in and attributable.\n *\n * @param component - the emitting component's name, e.g. 'MrlButton'\n * @param trackingId - consumer-supplied, non-PII id; undefined disables emission\n * @returns an `emit` callback that fires a single interaction per call\n */\nexport const useMrlTrackInteraction = (component: string, trackingId?: string) => {\n\tconst { track } = useMrlAnalytics();\n\n\treturn React.useCallback(\n\t\t({ action, variant, metadata }: EmitArgs) => {\n\t\t\t// opt-in: no id → no event (volume + PII guard)\n\t\t\tif (!trackingId) return;\n\t\t\ttry {\n\t\t\t\ttrack({\n\t\t\t\t\taction,\n\t\t\t\t\tcomponent,\n\t\t\t\t\tmetadata,\n\t\t\t\t\ttoolkitVersion: TOOLKIT_VERSION,\n\t\t\t\t\ttrackingId,\n\t\t\t\t\tvariant\n\t\t\t\t});\n\t\t\t} catch (e) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t},\n\t\t[track, component, trackingId]\n\t);\n};\n"],"names":["useMrlAnalytics","React","useContext","MrlAnalyticsContext","useMrlTrackInteraction","component","trackingId","_useMrlAnalytics","track","useCallback","_ref","action","variant","metadata","toolkitVersion","TOOLKIT_VERSION","e"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAKA;AACA;AACA;AACA;AACA;AACO,IAAMA,eAAe,GAAGA,MAA2BC,gBAAK,CAACC,UAAU,CAACC,uCAAmB;AAI9F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACaC,sBAAsB,GAAGA,CAACC,SAAiB,EAAEC,UAAmB,KAAK;AACjF,EAAA,IAAAC,gBAAA,GAAkBP,eAAe,EAAE;IAA3BQ,KAAK,GAAAD,gBAAA,CAALC,KAAK;AAEb,EAAA,OAAOP,gBAAK,CAACQ,WAAW,CACvBC,IAAA,IAA6C;AAAA,IAAA,IAA1CC,MAAM,GAAAD,IAAA,CAANC,MAAM;MAAEC,OAAO,GAAAF,IAAA,CAAPE,OAAO;MAAEC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;AAC3B;IACA,IAAI,CAACP,UAAU,EAAE;IACjB,IAAI;AACHE,MAAAA,KAAK,CAAC;QACLG,MAAM;QACNN,SAAS;QACTQ,QAAQ;AACRC,QAAAA,cAAc,EAAEC,uBAAe;QAC/BT,UAAU;AACVM,QAAAA;AACD,OAAC,CAAC;IACH,CAAC,CAAC,OAAOI,CAAC,EAAE;AACX,MAAA;AACD,IAAA;EACD,CAAC,EACD,CAACR,KAAK,EAAEH,SAAS,EAAEC,UAAU,CAC9B,CAAC;AACF;;;;;"}
1
+ {"version":3,"file":"useMrlAnalytics.js","sources":["../../../../src/hooks/useMrlAnalytics/useMrlAnalytics.ts"],"sourcesContent":["import * as React from 'react';\nimport { MrlAnalyticsContext } from '../../contexts/MrlAnalyticsContext';\nimport { MrlAnalyticsEvent, MrlTrack } from '../../contexts/MrlAnalyticsContext/types';\nimport { TOOLKIT_VERSION } from '../../version';\n\n/**\n * Raw accessor for the analytics context.\n *\n * @returns the injected `track` transport (default no-op)\n */\nexport const useMrlAnalytics = (): { track: MrlTrack } => React.useContext(MrlAnalyticsContext);\n\ntype EmitArgs = Pick<MrlAnalyticsEvent, 'action' | 'variant' | 'metadata'>;\n\n/**\n * Component-facing helper. Binds component identity + eventId once, then\n * `emit({ action })` per interaction. No-ops entirely when eventId is absent,\n * so instrumentation is opt-in and attributable.\n *\n * @param component - the emitting component's name, e.g. 'MrlButton'\n * @param eventId - consumer-supplied, non-PII id; undefined disables emission\n * @returns an `emit` callback that fires a single interaction per call\n */\nexport const useMrlTrackInteraction = (component: string, eventId?: string) => {\n\tconst { track } = useMrlAnalytics();\n\n\treturn React.useCallback(\n\t\t({ action, variant, metadata }: EmitArgs) => {\n\t\t\t// opt-in: no id → no event (volume + PII guard)\n\t\t\tif (!eventId) return;\n\t\t\ttry {\n\t\t\t\ttrack({\n\t\t\t\t\taction,\n\t\t\t\t\tcomponent,\n\t\t\t\t\teventId,\n\t\t\t\t\tmetadata,\n\t\t\t\t\ttoolkitVersion: TOOLKIT_VERSION,\n\t\t\t\t\tvariant\n\t\t\t\t});\n\t\t\t} catch (e) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t},\n\t\t[track, component, eventId]\n\t);\n};\n"],"names":["useMrlAnalytics","React","useContext","MrlAnalyticsContext","useMrlTrackInteraction","component","eventId","_useMrlAnalytics","track","useCallback","_ref","action","variant","metadata","toolkitVersion","TOOLKIT_VERSION","e"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAKA;AACA;AACA;AACA;AACA;AACO,IAAMA,eAAe,GAAGA,MAA2BC,gBAAK,CAACC,UAAU,CAACC,uCAAmB;AAI9F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;IACaC,sBAAsB,GAAGA,CAACC,SAAiB,EAAEC,OAAgB,KAAK;AAC9E,EAAA,IAAAC,gBAAA,GAAkBP,eAAe,EAAE;IAA3BQ,KAAK,GAAAD,gBAAA,CAALC,KAAK;AAEb,EAAA,OAAOP,gBAAK,CAACQ,WAAW,CACvBC,IAAA,IAA6C;AAAA,IAAA,IAA1CC,MAAM,GAAAD,IAAA,CAANC,MAAM;MAAEC,OAAO,GAAAF,IAAA,CAAPE,OAAO;MAAEC,QAAQ,GAAAH,IAAA,CAARG,QAAQ;AAC3B;IACA,IAAI,CAACP,OAAO,EAAE;IACd,IAAI;AACHE,MAAAA,KAAK,CAAC;QACLG,MAAM;QACNN,SAAS;QACTC,OAAO;QACPO,QAAQ;AACRC,QAAAA,cAAc,EAAEC,uBAAe;AAC/BH,QAAAA;AACD,OAAC,CAAC;IACH,CAAC,CAAC,OAAOI,CAAC,EAAE;AACX,MAAA;AACD,IAAA;EACD,CAAC,EACD,CAACR,KAAK,EAAEH,SAAS,EAAEC,OAAO,CAC3B,CAAC;AACF;;;;;"}
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var TOOLKIT_VERSION = "4.72.0";
3
+ var TOOLKIT_VERSION = "4.73.0-dev-t0WE.1";
4
4
 
5
5
  exports.TOOLKIT_VERSION = TOOLKIT_VERSION;
6
6
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sources":["../../src/version.ts"],"sourcesContent":["export const TOOLKIT_VERSION = \"4.72.0\";"],"names":["TOOLKIT_VERSION"],"mappings":";;AAAO,IAAMA,eAAe,GAAG;;;;"}
1
+ {"version":3,"file":"version.js","sources":["../../src/version.ts"],"sourcesContent":["export const TOOLKIT_VERSION = \"4.73.0-dev-t0WE.1\";"],"names":["TOOLKIT_VERSION"],"mappings":";;AAAO,IAAMA,eAAe,GAAG;;;;"}
@@ -48,6 +48,11 @@ export interface MrlAvatarButtonPropTypes extends MrlAvatarPropTypes, React.HTML
48
48
  * Tooltip configuration for the button
49
49
  */
50
50
  tooltip?: TooltipConfig;
51
+ /**
52
+ * Enables interaction tracking for this button. Provide a stable, non-PII id
53
+ * (e.g. 'workspace-member-avatar'). When omitted, the button emits no analytics.
54
+ */
55
+ eventId?: string;
51
56
  /**
52
57
  * Reference to the DOM element that is the MrlAvatarButton
53
58
  */
@@ -58,4 +63,4 @@ export interface MrlAvatarButtonPropTypes extends MrlAvatarPropTypes, React.HTML
58
63
  * @param {MrlAvatarButtonPropTypes} props the props for your MrlAvatarButton
59
64
  * @returns {React.ReactElement} an avatar button containing the props you pass
60
65
  */
61
- export declare const MrlAvatarButton: ({ buttonClassName, dataQa, id, includeInRoving, isToggleButton, label, loading, loadingText, onClick, size, state, toggleAria, tooltip, triggerRef, ...rest }: MrlAvatarButtonPropTypes) => React.ReactElement;
66
+ export declare const MrlAvatarButton: ({ buttonClassName, dataQa, id, includeInRoving, isToggleButton, label, loading, loadingText, onClick, size, state, toggleAria, tooltip, eventId, triggerRef, ...rest }: MrlAvatarButtonPropTypes) => React.ReactElement;
@@ -34,6 +34,11 @@ export interface MrlBreadcrumbItemProps extends React.ComponentPropsWithRef<'li'
34
34
  isTruncated?: boolean;
35
35
  link?: BreadcrumbItem['link'];
36
36
  text?: BreadcrumbItem['text'];
37
+ /**
38
+ * Enables interaction tracking for this breadcrumb. Provide a stable, non-PII id
39
+ * (e.g. 'room-breadcrumb'). When omitted, the breadcrumb emits no analytics.
40
+ */
41
+ eventId?: string;
37
42
  }
38
43
  /**
39
44
  * MrlBreadcrumbItem component.
@@ -85,7 +85,7 @@ export interface MrlButtonProps extends Omit<MrlComponentProps, 'style'>, React.
85
85
  * Enables interaction tracking for this button. Provide a stable, non-PII id
86
86
  * (e.g. 'board-share-cta'). When omitted, the button emits no analytics.
87
87
  */
88
- trackingId?: string;
88
+ eventId?: string;
89
89
  /**
90
90
  * Determines which aria setup to use for various toggle/selected styles.
91
91
  * pressed - use for an traditional “toggle button”
@@ -80,6 +80,11 @@ export interface MrlIconButtonProps extends Omit<MrlComponentProps, 'style'>, Re
80
80
  * The arrow position of the tooltip in relation to the button.
81
81
  */
82
82
  tipAnchor?: MrlTooltipAnchor;
83
+ /**
84
+ * Enables interaction tracking for this button. Provide a stable, non-PII id
85
+ * (e.g. 'board-share-cta'). When omitted, the button emits no analytics.
86
+ */
87
+ eventId?: string;
83
88
  /**
84
89
  * Determines which aria setup to use for various toggle/selected styles.
85
90
  * pressed - use for an traditional “toggle button”
@@ -23,6 +23,13 @@ export interface MrlCalloutProps extends MrlCalloutPopoverProps {
23
23
  title?: string;
24
24
  primaryCta?: MrlCalloutCTA;
25
25
  secondaryCta?: MrlCalloutCTA;
26
+ /**
27
+ * Enables interaction tracking for this callout. Provide a stable, non-PII id
28
+ * (e.g. 'ai-onboarding-callout'). When omitted, the callout emits no analytics.
29
+ *
30
+ * Note: title, eyebrow and description text are never emitted.
31
+ */
32
+ eventId?: string;
26
33
  }
27
34
  /**
28
35
  * MrlCallout component.
@@ -18,6 +18,13 @@ export type MrlFilterProps = {
18
18
  * The default checked value for the filter. It will match the value of the MrlFilterItem.
19
19
  */
20
20
  defaultCheckedValue?: string;
21
+ /**
22
+ * Enables interaction tracking for this filter group. Provide a stable, non-PII id
23
+ * (e.g. 'templates-filter'). When omitted, the filter emits no analytics.
24
+ *
25
+ * Note: the selected value is never emitted.
26
+ */
27
+ eventId?: string;
21
28
  } & Omit<React.ComponentPropsWithoutRef<'div'>, 'defaultChecked' | 'defaultValue'> & Required<Pick<RovingPropTypes, 'orientation'>> & DataQa;
22
29
  /**
23
30
  * MrlFilter component.
@@ -13,6 +13,13 @@ export type MrlFilterItemProps = {
13
13
  * The count of items for this filter option.
14
14
  */
15
15
  count?: number;
16
+ /**
17
+ * Enables interaction tracking for this filter option. Provide a stable, non-PII id
18
+ * (e.g. 'templates-category-filter'). When omitted, the option emits no analytics.
19
+ *
20
+ * Note: the option's value and content are never emitted.
21
+ */
22
+ eventId?: string;
16
23
  } & React.ComponentPropsWithoutRef<'span'> & DataQa;
17
24
  /**
18
25
  * MrlFilterItem component.
@@ -31,6 +31,11 @@ interface MrlCheckboxProps {
31
31
  * }>
32
32
  */
33
33
  description?: string | React.ReactNode;
34
+ /**
35
+ * Enables interaction tracking for this checkbox. Provide a stable, non-PII id
36
+ * (e.g. 'export-include-comments'). When omitted, the checkbox emits no analytics.
37
+ */
38
+ eventId?: string;
34
39
  }
35
40
  /**
36
41
  * Form element with an associated text label that allows the user to select one or more options
@@ -38,5 +43,5 @@ interface MrlCheckboxProps {
38
43
  * @param {MrlCheckboxProps} props - the component props
39
44
  * @returns a checkbox element with an associated label
40
45
  */
41
- export declare function MrlCheckbox({ attrs, className, description, hasMultilineLabel, state, selected, icon, label, ...rest }: MrlCheckboxProps): JSX.Element;
46
+ export declare function MrlCheckbox({ attrs, className, description, hasMultilineLabel, state, selected, icon, label, eventId, ...rest }: MrlCheckboxProps): JSX.Element;
42
47
  export {};
@@ -8,6 +8,11 @@ interface MrlCheckboxStandaloneProps {
8
8
  state?: CheckboxStates;
9
9
  /** Sets what selection state the checkbox is in. */
10
10
  selected?: CheckboxSelected;
11
+ /**
12
+ * Enables interaction tracking for this checkbox. Provide a stable, non-PII id
13
+ * (e.g. 'export-include-comments'). When omitted, the checkbox emits no analytics.
14
+ */
15
+ eventId?: string;
11
16
  }
12
17
  /**
13
18
  * Input that allows the user to select one or more options from a provided list.
@@ -16,5 +21,5 @@ interface MrlCheckboxStandaloneProps {
16
21
  * @param {MrlCheckboxStandaloneProps} props - the component props
17
22
  * @returns a checkbox element
18
23
  */
19
- export declare function MrlCheckboxStandalone({ attrs, state, selected, ...rest }: MrlCheckboxStandaloneProps): JSX.Element;
24
+ export declare function MrlCheckboxStandalone({ attrs, state, selected, eventId, ...rest }: MrlCheckboxStandaloneProps): JSX.Element;
20
25
  export {};
@@ -19,6 +19,13 @@ export interface MrlDatePickerProps extends React.ComponentPropsWithRef<'input'>
19
19
  * @link https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date
20
20
  */
21
21
  onChange?: React.ComponentPropsWithRef<'input'>['onChange'];
22
+ /**
23
+ * Enables interaction tracking for this date picker. Provide a stable, non-PII id
24
+ * (e.g. 'trial-end-date'). When omitted, the date picker emits no analytics.
25
+ *
26
+ * Note: the selected date is never emitted — only that a change happened.
27
+ */
28
+ eventId?: string;
22
29
  }
23
30
  /**
24
31
  * Allows the user to input a date
@@ -48,6 +48,11 @@ export interface MrlLegacySelectProptypes extends React.HTMLAttributes<HTMLDivEl
48
48
  * Can be used in conjunction with `hookChange` to create a controlled component.
49
49
  */
50
50
  value?: string;
51
+ /**
52
+ * Enables interaction tracking for this select. Provide a stable, non-PII id
53
+ * (e.g. 'workspace-role-select'). When omitted, the select emits no analytics.
54
+ */
55
+ eventId?: string;
51
56
  }
52
57
  /**
53
58
  * Creates and exports component class for Mural Select
@@ -55,4 +60,4 @@ export interface MrlLegacySelectProptypes extends React.HTMLAttributes<HTMLDivEl
55
60
  * @param {MrlLegacySelectProptypes} props the props for your MrlLink
56
61
  * @returns {React.ReactElement} an a element containing the text you pass
57
62
  */
58
- export declare const MrlLegacySelect: ({ attrs, children, kind, labelId, size, ...theRest }: MrlLegacySelectProptypes) => React.ReactElement;
63
+ export declare const MrlLegacySelect: ({ attrs, children, kind, labelId, size, eventId, ...theRest }: MrlLegacySelectProptypes) => React.ReactElement;
@@ -26,6 +26,13 @@ export interface MrlLegacySelectItemProptypes extends React.HTMLAttributes<HTMLD
26
26
  * content for the item
27
27
  */
28
28
  children: React.ReactNode;
29
+ /**
30
+ * Enables interaction tracking for this option. Provide a stable, non-PII id
31
+ * (e.g. 'workspace-role-option'). When omitted, the option emits no analytics.
32
+ *
33
+ * Note: the option's value and text are never emitted.
34
+ */
35
+ eventId?: string;
29
36
  }
30
37
  /**
31
38
  * Renders a select component
@@ -33,4 +40,4 @@ export interface MrlLegacySelectItemProptypes extends React.HTMLAttributes<HTMLD
33
40
  * @param {MrlLegacySelectItemProptypes} props the props for your MrlLink
34
41
  * @returns {React.ReactElement} an a element containing the text you pass
35
42
  */
36
- export declare const MrlLegacySelectItem: ({ attrs, children, index, value, isDisabled, ...theRest }: MrlLegacySelectItemProptypes) => React.ReactElement;
43
+ export declare const MrlLegacySelectItem: ({ attrs, children, index, value, isDisabled, eventId, ...theRest }: MrlLegacySelectItemProptypes) => React.ReactElement;
@@ -36,6 +36,11 @@ interface MrlRadioButtonProps extends React.ComponentPropsWithoutRef<'input'> {
36
36
  description?: string | React.ReactNode;
37
37
  /** Data attribute for QA testing */
38
38
  ['data-qa']?: string;
39
+ /**
40
+ * Enables interaction tracking for this radio button. Provide a stable, non-PII id
41
+ * (e.g. 'plan-selection'). When omitted, the radio button emits no analytics.
42
+ */
43
+ eventId?: string;
39
44
  }
40
45
  /**
41
46
  * Form element with an associated text label and description that allows the user to select one
@@ -44,5 +49,5 @@ interface MrlRadioButtonProps extends React.ComponentPropsWithoutRef<'input'> {
44
49
  * @param {MrlRadioButtonProps} props - the component props
45
50
  * @returns an input with type "radio" with an associated label
46
51
  */
47
- export declare function MrlRadioButton({ className, description, hasMultilineLabel, name, value, icon, disabled, hasError, label, style, ...rest }: MrlRadioButtonProps): JSX.Element;
52
+ export declare function MrlRadioButton({ className, description, hasMultilineLabel, name, value, icon, disabled, hasError, label, onChange, style, eventId, ...rest }: MrlRadioButtonProps): JSX.Element;
48
53
  export {};
@@ -13,6 +13,11 @@ interface MrlRadioButtonStandaloneProps extends React.ComponentPropsWithoutRef<'
13
13
  hasError?: boolean;
14
14
  /** Additional class to add to the label */
15
15
  className?: string;
16
+ /**
17
+ * Enables interaction tracking for this radio button. Provide a stable, non-PII id
18
+ * (e.g. 'plan-selection'). When omitted, the radio button emits no analytics.
19
+ */
20
+ eventId?: string;
16
21
  }
17
22
  /**
18
23
  * Input that allows the user to select one options from a provided radio group.
@@ -22,5 +27,5 @@ interface MrlRadioButtonStandaloneProps extends React.ComponentPropsWithoutRef<'
22
27
  * @param {MrlRadioButtonStandaloneProps} props - the component props
23
28
  * @returns an input element with type="radio"
24
29
  */
25
- export declare function MrlRadioButtonStandalone({ className, disabled, hasError, id, name, ref, value, ...rest }: MrlRadioButtonStandaloneProps): JSX.Element;
30
+ export declare function MrlRadioButtonStandalone({ className, disabled, hasError, id, name, onChange, ref, eventId, value, ...rest }: MrlRadioButtonStandaloneProps): JSX.Element;
26
31
  export {};
@@ -14,6 +14,13 @@ export interface MrlCreatableSelectProps<Option, IsMulti extends boolean = false
14
14
  */
15
15
  ['data-qa']?: string;
16
16
  showClearIndicatorIcon?: boolean;
17
+ /**
18
+ * Enables interaction tracking for this select. Provide a stable, non-PII id
19
+ * (e.g. 'template-tag-picker'). When omitted, the select emits no analytics.
20
+ *
21
+ * Note: option labels, values and created text are never emitted — only the kind of change.
22
+ */
23
+ eventId?: string;
17
24
  }
18
25
  export declare const CREATABLE_SELECT_CLASS_NAME_PREFIX = "MrlCreatableSelect";
19
26
  export declare const CREATABLE_SELECT_MENU_LIST_CLASS_NAME = "MrlCreatableSelect__menu-list";
@@ -14,6 +14,13 @@ export interface MrlMultiCreatableSelectProps<Option, IsMulti extends boolean =
14
14
  */
15
15
  ['data-qa']?: string;
16
16
  showClearIndicatorIcon?: boolean;
17
+ /**
18
+ * Enables interaction tracking for this select. Provide a stable, non-PII id
19
+ * (e.g. 'mural-tag-picker'). When omitted, the select emits no analytics.
20
+ *
21
+ * Note: option labels, values and created text are never emitted — only the kind of change.
22
+ */
23
+ eventId?: string;
17
24
  }
18
25
  export declare const MULTI_CREATABLE_SELECT_CLASS_NAME_PREFIX = "MrlMultiCreatableSelect";
19
26
  export declare const MULTI_CREATABLE_SELECT_MENU_LIST_CLASS_NAME = "MrlMultiCreatableSelect__menu-list";
@@ -12,6 +12,13 @@ export interface MrlMultiSelectProps<T, IsMulti extends boolean = false, Group e
12
12
  * - value-container, <data-qa-prefix>-value-container
13
13
  */
14
14
  ['data-qa']?: string;
15
+ /**
16
+ * Enables interaction tracking for this select. Provide a stable, non-PII id
17
+ * (e.g. 'invite-members-picker'). When omitted, the select emits no analytics.
18
+ *
19
+ * Note: option labels and values are never emitted — only the kind of change.
20
+ */
21
+ eventId?: string;
15
22
  }
16
23
  export declare const MULTI_SELECT_CLASS_NAME_PREFIX = "MrlMultiSelect";
17
24
  export declare const MULTI_SELECT_MENU_LIST_CLASS_NAME = "MrlMultiSelect__menu-list";
@@ -12,6 +12,13 @@ export interface MrlSelectProps<Option, IsMulti extends boolean = false, Group e
12
12
  * - value-container, <data-qa-prefix>-value-container
13
13
  */
14
14
  ['data-qa']?: string;
15
+ /**
16
+ * Enables interaction tracking for this select. Provide a stable, non-PII id
17
+ * (e.g. 'member-role-select'). When omitted, the select emits no analytics.
18
+ *
19
+ * Note: option labels and values are never emitted — only the kind of change.
20
+ */
21
+ eventId?: string;
15
22
  }
16
23
  export declare const SELECT_CLASS_NAME_PREFIX = "MrlSelect";
17
24
  export declare const SELECT_MENU_LIST_CLASS_NAME = "MrlSelect__menu-list";
@@ -3,6 +3,11 @@ interface MrlSwitchProps extends React.ComponentPropsWithoutRef<'input'> {
3
3
  className?: string;
4
4
  disabled?: boolean;
5
5
  id?: string;
6
+ /**
7
+ * Enables interaction tracking for this switch. Provide a stable, non-PII id
8
+ * (e.g. 'workspace-sso-toggle'). When omitted, the switch emits no analytics.
9
+ */
10
+ eventId?: string;
6
11
  /**
7
12
  * The `label` is best used as a string, which will style according to MrlLabel styles.
8
13
  * If you need custom styles, you can use `className` or use a span that you style as `label`
@@ -11,5 +16,5 @@ interface MrlSwitchProps extends React.ComponentPropsWithoutRef<'input'> {
11
16
  onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
12
17
  selected?: boolean;
13
18
  }
14
- export declare const MrlSwitch: React.MemoExoticComponent<({ className, disabled, id, label, onChange, selected, ...rest }: MrlSwitchProps) => React.JSX.Element>;
19
+ export declare const MrlSwitch: React.MemoExoticComponent<({ className, disabled, id, label, onChange, selected, eventId, ...rest }: MrlSwitchProps) => React.JSX.Element>;
15
20
  export {};
@@ -5,6 +5,11 @@ interface MrlSwitchStandaloneProps extends React.ComponentPropsWithoutRef<'input
5
5
  labelledBy?: string;
6
6
  onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
7
7
  selected?: boolean;
8
+ /**
9
+ * Enables interaction tracking for this switch. Provide a stable, non-PII id
10
+ * (e.g. 'workspace-sso-toggle'). When omitted, the switch emits no analytics.
11
+ */
12
+ eventId?: string;
8
13
  }
9
- export declare const MrlSwitchStandalone: React.MemoExoticComponent<({ className, id, labelledBy, onChange, selected, ...rest }: MrlSwitchStandaloneProps) => React.JSX.Element>;
14
+ export declare const MrlSwitchStandalone: React.MemoExoticComponent<({ className, id, labelledBy, onChange, selected, eventId, ...rest }: MrlSwitchStandaloneProps) => React.JSX.Element>;
10
15
  export {};
@@ -31,6 +31,14 @@ interface MrlEditableTextInputProps extends React.InputHTMLAttributes<HTMLInputE
31
31
  * @default false
32
32
  */
33
33
  showIconOnHover?: boolean;
34
+ /**
35
+ * Enables interaction tracking for this input. Provide a stable, non-PII id
36
+ * (e.g. 'mural-title'). When omitted, the input emits no analytics.
37
+ *
38
+ * Note: the input's value is never emitted, and `change` is emitted once per
39
+ * editing session (on blur, when the value actually changed) rather than per keystroke.
40
+ */
41
+ eventId?: string;
34
42
  }
35
43
  export declare const MrlEditableTextInput: React.ForwardRefExoticComponent<MrlEditableTextInputProps & React.RefAttributes<HTMLButtonElement>>;
36
44
  export {};