@muraldevkit/ui-toolkit 4.73.0 → 4.74.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (237) hide show
  1. package/dist/cjs/components/avatar/MrlAvatar/MrlAvatar.js +1 -1
  2. package/dist/cjs/components/avatar/MrlAvatar/MrlAvatar.js.map +1 -1
  3. package/dist/cjs/components/avatar/MrlAvatarButton/MrlAvatarButton.js +3 -3
  4. package/dist/cjs/components/avatar/MrlAvatarButton/MrlAvatarButton.js.map +1 -1
  5. package/dist/cjs/components/badge/MrlBadge/MrlBadge.js +1 -1
  6. package/dist/cjs/components/badge/MrlBadge/MrlBadge.js.map +1 -1
  7. package/dist/cjs/components/button/MrlButton/MrlButton.js +2 -2
  8. package/dist/cjs/components/button/MrlButton/MrlButton.js.map +1 -1
  9. package/dist/cjs/components/button/MrlIconButton/MrlIconButton.js +2 -2
  10. package/dist/cjs/components/button/MrlIconButton/MrlIconButton.js.map +1 -1
  11. package/dist/cjs/components/callout/MrlCallout/MrlCallout.js +8 -17
  12. package/dist/cjs/components/callout/MrlCallout/MrlCallout.js.map +1 -1
  13. package/dist/cjs/components/empty/default/MrlEmpty.js +1 -1
  14. package/dist/cjs/components/form/checkbox/MrlCheckboxStandalone/MrlCheckboxStandalone.js +1 -1
  15. package/dist/cjs/components/form/checkbox/MrlCheckboxStandalone/MrlCheckboxStandalone.js.map +1 -1
  16. package/dist/cjs/components/form/label/MrlLabelWithDescription/MrlLabelWithDescription.js +2 -2
  17. package/dist/cjs/components/form/label/MrlLabelWithDescription/MrlLabelWithDescription.js.map +1 -1
  18. package/dist/cjs/components/form/legacy-select/MrlLegacySelect/MrlLegacySelect.js +2 -2
  19. package/dist/cjs/components/form/legacy-select/MrlLegacySelect/MrlLegacySelect.js.map +1 -1
  20. package/dist/cjs/components/form/legacy-select/MrlLegacySelectItem/MrlLegacySelectItem.js +1 -1
  21. package/dist/cjs/components/form/legacy-select/MrlLegacySelectItem/MrlLegacySelectItem.js.map +1 -1
  22. package/dist/cjs/components/form/radio/MrlRadioButton/MrlRadioButton.js +1 -1
  23. package/dist/cjs/components/form/radio/MrlRadioButton/MrlRadioButton.js.map +1 -1
  24. package/dist/cjs/components/form/radio/MrlRadioGroup/MrlRadioGroup.js.map +1 -1
  25. package/dist/cjs/components/form/select/MrlCreatableSelect/MrlCreatableSelect.js +5 -5
  26. package/dist/cjs/components/form/select/MrlCreatableSelect/MrlCreatableSelect.js.map +1 -1
  27. package/dist/cjs/components/form/select/MrlMultiCreatableSelect/MrlMultiCreatableSelect.js +5 -5
  28. package/dist/cjs/components/form/select/MrlMultiCreatableSelect/MrlMultiCreatableSelect.js.map +1 -1
  29. package/dist/cjs/components/form/select/MrlMultiSelect/MrlMultiSelect.js +6 -6
  30. package/dist/cjs/components/form/select/MrlMultiSelect/MrlMultiSelect.js.map +1 -1
  31. package/dist/cjs/components/form/select/MrlSelect/MrlSelect.js +4 -4
  32. package/dist/cjs/components/form/select/MrlSelect/MrlSelect.js.map +1 -1
  33. package/dist/cjs/components/form/switch/MrlSwitch/MrlSwitch.js +1 -1
  34. package/dist/cjs/components/form/switch/MrlSwitch/MrlSwitch.js.map +1 -1
  35. package/dist/cjs/components/form/switch/MrlSwitchStandalone/MrlSwitchStandalone.js +1 -1
  36. package/dist/cjs/components/form/switch/MrlSwitchStandalone/MrlSwitchStandalone.js.map +1 -1
  37. package/dist/cjs/components/form/text-input/MrlEditableTextInput/MrlEditableTextInput.js +1 -1
  38. package/dist/cjs/components/form/text-input/MrlEditableTextInput/MrlEditableTextInput.js.map +1 -1
  39. package/dist/cjs/components/form/text-input/MrlEditableTextInput/MrlEditableTextInputRightIcon.js +1 -1
  40. package/dist/cjs/components/form/text-input/MrlEditableTextInput/MrlEditableTextInputRightIcon.js.map +1 -1
  41. package/dist/cjs/components/form/text-input/MrlTextInput/MrlTextInput.js +1 -1
  42. package/dist/cjs/components/form/text-input/MrlTextInput/MrlTextInput.js.map +1 -1
  43. package/dist/cjs/components/form/text-input/MrlTextInput/MrlTextInputRightIcon.js +1 -1
  44. package/dist/cjs/components/form/text-input/MrlTextInput/MrlTextInputRightIcon.js.map +1 -1
  45. package/dist/cjs/components/form/textarea/MrlEditableTextarea/MrlEditableTextarea.js +1 -1
  46. package/dist/cjs/components/form/textarea/MrlEditableTextarea/MrlEditableTextarea.js.map +1 -1
  47. package/dist/cjs/components/form/textarea/MrlEditableTextarea/MrlEditableTextareaRightButton.js +1 -1
  48. package/dist/cjs/components/form/textarea/MrlEditableTextarea/MrlEditableTextareaRightButton.js.map +1 -1
  49. package/dist/cjs/components/form/utils.js.map +1 -1
  50. package/dist/cjs/components/layout/MrlSidebar/MrlSidebar.js +3 -3
  51. package/dist/cjs/components/layout/MrlSidebar/MrlSidebar.js.map +1 -1
  52. package/dist/cjs/components/link/MrlLink/MrlLink.js +1 -1
  53. package/dist/cjs/components/link/MrlLink/MrlLink.js.map +1 -1
  54. package/dist/cjs/components/link/MrlLinkButton/MrlLinkButton.js +2 -2
  55. package/dist/cjs/components/link/MrlLinkButton/MrlLinkButton.js.map +1 -1
  56. package/dist/cjs/components/loader/MrlProgressBar/MrlProgressBar.js +1 -1
  57. package/dist/cjs/components/loader/MrlProgressBar/MrlProgressBar.js.map +1 -1
  58. package/dist/cjs/components/menu/MrlMenu/MrlMenu.js +1 -1
  59. package/dist/cjs/components/menu/MrlMenu/MrlMenu.js.map +1 -1
  60. package/dist/cjs/components/menu/MrlMenuItem/MrlMenuItem.js +2 -2
  61. package/dist/cjs/components/menu/MrlMenuItem/MrlMenuItem.js.map +1 -1
  62. package/dist/cjs/components/menu/MrlMenuItemLink/MrlMenuItemLink.js +1 -1
  63. package/dist/cjs/components/menu/MrlMenuItemLink/MrlMenuItemLink.js.map +1 -1
  64. package/dist/cjs/components/modal/MrlModal/MrlModal.js +3 -3
  65. package/dist/cjs/components/modal/MrlModal/MrlModal.js.map +1 -1
  66. package/dist/cjs/components/modal/MrlModalHeader/MrlModalHeader.js +1 -1
  67. package/dist/cjs/components/modal/MrlModalHeader/MrlModalHeader.js.map +1 -1
  68. package/dist/cjs/components/navigation-sidebar/MrlSidebarNavGroup/MrlSidebarNavGroup.js +1 -1
  69. package/dist/cjs/components/navigation-sidebar/MrlSidebarNavGroup/MrlSidebarNavGroup.js.map +1 -1
  70. package/dist/cjs/components/navigation-sidebar/MrlSidebarNavItem/MrlSidebarNavItem.js +1 -1
  71. package/dist/cjs/components/navigation-sidebar/MrlSidebarNavItem/MrlSidebarNavItem.js.map +1 -1
  72. package/dist/cjs/components/notification/MrlBlockNotification/MrlBlockNotification.js +3 -3
  73. package/dist/cjs/components/notification/MrlBlockNotification/MrlBlockNotification.js.map +1 -1
  74. package/dist/cjs/components/pagination/MrlPaginationButton/MrlPaginationButton.js +3 -3
  75. package/dist/cjs/components/pagination/MrlPaginationButton/MrlPaginationButton.js.map +1 -1
  76. package/dist/cjs/components/popover/MrlPopover/MrlPopover.js +4 -4
  77. package/dist/cjs/components/popover/MrlPopover/MrlPopover.js.map +1 -1
  78. package/dist/cjs/components/table/MrlSmartTable/MrlSmartTable.js +10 -10
  79. package/dist/cjs/components/table/MrlSmartTable/MrlSmartTable.js.map +1 -1
  80. package/dist/cjs/components/tabs/MrlTab/MrlTab.js +1 -1
  81. package/dist/cjs/components/tabs/MrlTab/MrlTab.js.map +1 -1
  82. package/dist/cjs/components/tabs/MrlTabContent/MrlTabContent.js +1 -1
  83. package/dist/cjs/components/tabs/MrlTabContent/MrlTabContent.js.map +1 -1
  84. package/dist/cjs/components/tabs/MrlTabGroup/MrlTabGroup.js +1 -1
  85. package/dist/cjs/components/tabs/MrlTabGroup/MrlTabGroup.js.map +1 -1
  86. package/dist/cjs/components/tabs/MrlTabLink/MrlTabLink.js +1 -1
  87. package/dist/cjs/components/tabs/MrlTabLink/MrlTabLink.js.map +1 -1
  88. package/dist/cjs/components/tabs/MrlTabs/MrlTabs.js.map +1 -1
  89. package/dist/cjs/components/toolbar/MrlToolbar/MrlToolbar.js +4 -4
  90. package/dist/cjs/components/toolbar/MrlToolbar/MrlToolbar.js.map +1 -1
  91. package/dist/cjs/components/toolbar/MrlToolbarButton/MrlToolbarButton.js +2 -2
  92. package/dist/cjs/components/toolbar/MrlToolbarButton/MrlToolbarButton.js.map +1 -1
  93. package/dist/cjs/version.js +1 -1
  94. package/dist/cjs/version.js.map +1 -1
  95. package/dist/components/avatar/MrlAvatarButton/MrlAvatarButton.d.ts +2 -1
  96. package/dist/components/button/MrlButton/MrlButton.d.ts +1 -1
  97. package/dist/components/button/MrlIconButton/MrlIconButton.d.ts +1 -1
  98. package/dist/components/callout/MrlCallout/MrlCallout.d.ts +0 -2
  99. package/dist/components/form/text-input/MrlEditableTextInput/MrlEditableTextInputRightIcon.d.ts +1 -1
  100. package/dist/components/form/text-input/MrlTextInput/MrlTextInput.d.ts +1 -1
  101. package/dist/components/form/text-input/MrlTextInput/MrlTextInputRightIcon.d.ts +1 -1
  102. package/dist/components/form/textarea/MrlEditableTextarea/MrlEditableTextarea.d.ts +1 -1
  103. package/dist/components/form/textarea/MrlEditableTextarea/MrlEditableTextareaRightButton.d.ts +1 -1
  104. package/dist/components/form/utils.d.ts +0 -13
  105. package/dist/components/link/MrlLinkButton/MrlLinkButton.d.ts +1 -1
  106. package/dist/components/menu/MrlMenu/MrlMenu.d.ts +1 -1
  107. package/dist/components/menu/MrlMenuItem/MrlMenuItem.d.ts +1 -1
  108. package/dist/components/menu/MrlMenuItemLink/MrlMenuItemLink.d.ts +1 -1
  109. package/dist/components/menu/demo/MenuWithTrigger.d.ts +1 -2
  110. package/dist/components/navigation-sidebar/MrlSidebarNavItem/MrlSidebarNavItem.d.ts +1 -1
  111. package/dist/components/notification/MrlBlockNotification/MrlBlockNotification.d.ts +1 -1
  112. package/dist/components/pagination/MrlPaginationButton/MrlPaginationButton.d.ts +1 -1
  113. package/dist/components/popover/MrlPopover/MrlPopover.d.ts +1 -1
  114. package/dist/components/tabs/MrlTabs/MrlTabs.d.ts +1 -1
  115. package/dist/components/toolbar/MrlToolbar/MrlToolbar.d.ts +2 -1
  116. package/dist/components/toolbar/MrlToolbarButton/MrlToolbarButton.d.ts +2 -1
  117. package/dist/esm/components/avatar/MrlAvatar/MrlAvatar.js +1 -1
  118. package/dist/esm/components/avatar/MrlAvatar/MrlAvatar.js.map +1 -1
  119. package/dist/esm/components/avatar/MrlAvatarButton/MrlAvatarButton.js +3 -3
  120. package/dist/esm/components/avatar/MrlAvatarButton/MrlAvatarButton.js.map +1 -1
  121. package/dist/esm/components/badge/MrlBadge/MrlBadge.js +1 -1
  122. package/dist/esm/components/badge/MrlBadge/MrlBadge.js.map +1 -1
  123. package/dist/esm/components/button/MrlButton/MrlButton.js +2 -2
  124. package/dist/esm/components/button/MrlButton/MrlButton.js.map +1 -1
  125. package/dist/esm/components/button/MrlIconButton/MrlIconButton.js +2 -2
  126. package/dist/esm/components/button/MrlIconButton/MrlIconButton.js.map +1 -1
  127. package/dist/esm/components/callout/MrlCallout/MrlCallout.js +8 -17
  128. package/dist/esm/components/callout/MrlCallout/MrlCallout.js.map +1 -1
  129. package/dist/esm/components/empty/default/MrlEmpty.js +1 -1
  130. package/dist/esm/components/form/checkbox/MrlCheckboxStandalone/MrlCheckboxStandalone.js +1 -1
  131. package/dist/esm/components/form/checkbox/MrlCheckboxStandalone/MrlCheckboxStandalone.js.map +1 -1
  132. package/dist/esm/components/form/label/MrlLabelWithDescription/MrlLabelWithDescription.js +2 -2
  133. package/dist/esm/components/form/label/MrlLabelWithDescription/MrlLabelWithDescription.js.map +1 -1
  134. package/dist/esm/components/form/legacy-select/MrlLegacySelect/MrlLegacySelect.js +2 -2
  135. package/dist/esm/components/form/legacy-select/MrlLegacySelect/MrlLegacySelect.js.map +1 -1
  136. package/dist/esm/components/form/legacy-select/MrlLegacySelectItem/MrlLegacySelectItem.js +1 -1
  137. package/dist/esm/components/form/legacy-select/MrlLegacySelectItem/MrlLegacySelectItem.js.map +1 -1
  138. package/dist/esm/components/form/radio/MrlRadioButton/MrlRadioButton.js +1 -1
  139. package/dist/esm/components/form/radio/MrlRadioButton/MrlRadioButton.js.map +1 -1
  140. package/dist/esm/components/form/radio/MrlRadioGroup/MrlRadioGroup.js.map +1 -1
  141. package/dist/esm/components/form/select/MrlCreatableSelect/MrlCreatableSelect.js +5 -5
  142. package/dist/esm/components/form/select/MrlCreatableSelect/MrlCreatableSelect.js.map +1 -1
  143. package/dist/esm/components/form/select/MrlMultiCreatableSelect/MrlMultiCreatableSelect.js +5 -5
  144. package/dist/esm/components/form/select/MrlMultiCreatableSelect/MrlMultiCreatableSelect.js.map +1 -1
  145. package/dist/esm/components/form/select/MrlMultiSelect/MrlMultiSelect.js +6 -6
  146. package/dist/esm/components/form/select/MrlMultiSelect/MrlMultiSelect.js.map +1 -1
  147. package/dist/esm/components/form/select/MrlSelect/MrlSelect.js +4 -4
  148. package/dist/esm/components/form/select/MrlSelect/MrlSelect.js.map +1 -1
  149. package/dist/esm/components/form/switch/MrlSwitch/MrlSwitch.js +1 -1
  150. package/dist/esm/components/form/switch/MrlSwitch/MrlSwitch.js.map +1 -1
  151. package/dist/esm/components/form/switch/MrlSwitchStandalone/MrlSwitchStandalone.js +1 -1
  152. package/dist/esm/components/form/switch/MrlSwitchStandalone/MrlSwitchStandalone.js.map +1 -1
  153. package/dist/esm/components/form/text-input/MrlEditableTextInput/MrlEditableTextInput.js +1 -1
  154. package/dist/esm/components/form/text-input/MrlEditableTextInput/MrlEditableTextInput.js.map +1 -1
  155. package/dist/esm/components/form/text-input/MrlEditableTextInput/MrlEditableTextInputRightIcon.js +1 -1
  156. package/dist/esm/components/form/text-input/MrlEditableTextInput/MrlEditableTextInputRightIcon.js.map +1 -1
  157. package/dist/esm/components/form/text-input/MrlTextInput/MrlTextInput.js +1 -1
  158. package/dist/esm/components/form/text-input/MrlTextInput/MrlTextInput.js.map +1 -1
  159. package/dist/esm/components/form/text-input/MrlTextInput/MrlTextInputRightIcon.js +1 -1
  160. package/dist/esm/components/form/text-input/MrlTextInput/MrlTextInputRightIcon.js.map +1 -1
  161. package/dist/esm/components/form/textarea/MrlEditableTextarea/MrlEditableTextarea.js +1 -1
  162. package/dist/esm/components/form/textarea/MrlEditableTextarea/MrlEditableTextarea.js.map +1 -1
  163. package/dist/esm/components/form/textarea/MrlEditableTextarea/MrlEditableTextareaRightButton.js +1 -1
  164. package/dist/esm/components/form/textarea/MrlEditableTextarea/MrlEditableTextareaRightButton.js.map +1 -1
  165. package/dist/esm/components/form/utils.js.map +1 -1
  166. package/dist/esm/components/layout/MrlSidebar/MrlSidebar.js +3 -3
  167. package/dist/esm/components/layout/MrlSidebar/MrlSidebar.js.map +1 -1
  168. package/dist/esm/components/link/MrlLink/MrlLink.js +1 -1
  169. package/dist/esm/components/link/MrlLink/MrlLink.js.map +1 -1
  170. package/dist/esm/components/link/MrlLinkButton/MrlLinkButton.js +2 -2
  171. package/dist/esm/components/link/MrlLinkButton/MrlLinkButton.js.map +1 -1
  172. package/dist/esm/components/loader/MrlProgressBar/MrlProgressBar.js +1 -1
  173. package/dist/esm/components/loader/MrlProgressBar/MrlProgressBar.js.map +1 -1
  174. package/dist/esm/components/menu/MrlMenu/MrlMenu.js +1 -1
  175. package/dist/esm/components/menu/MrlMenu/MrlMenu.js.map +1 -1
  176. package/dist/esm/components/menu/MrlMenuItem/MrlMenuItem.js +2 -2
  177. package/dist/esm/components/menu/MrlMenuItem/MrlMenuItem.js.map +1 -1
  178. package/dist/esm/components/menu/MrlMenuItemLink/MrlMenuItemLink.js +1 -1
  179. package/dist/esm/components/menu/MrlMenuItemLink/MrlMenuItemLink.js.map +1 -1
  180. package/dist/esm/components/modal/MrlModal/MrlModal.js +3 -3
  181. package/dist/esm/components/modal/MrlModal/MrlModal.js.map +1 -1
  182. package/dist/esm/components/modal/MrlModalHeader/MrlModalHeader.js +1 -1
  183. package/dist/esm/components/modal/MrlModalHeader/MrlModalHeader.js.map +1 -1
  184. package/dist/esm/components/navigation-sidebar/MrlSidebarNavGroup/MrlSidebarNavGroup.js +1 -1
  185. package/dist/esm/components/navigation-sidebar/MrlSidebarNavGroup/MrlSidebarNavGroup.js.map +1 -1
  186. package/dist/esm/components/navigation-sidebar/MrlSidebarNavItem/MrlSidebarNavItem.js +1 -1
  187. package/dist/esm/components/navigation-sidebar/MrlSidebarNavItem/MrlSidebarNavItem.js.map +1 -1
  188. package/dist/esm/components/notification/MrlBlockNotification/MrlBlockNotification.js +3 -3
  189. package/dist/esm/components/notification/MrlBlockNotification/MrlBlockNotification.js.map +1 -1
  190. package/dist/esm/components/pagination/MrlPaginationButton/MrlPaginationButton.js +3 -3
  191. package/dist/esm/components/pagination/MrlPaginationButton/MrlPaginationButton.js.map +1 -1
  192. package/dist/esm/components/popover/MrlPopover/MrlPopover.js +4 -4
  193. package/dist/esm/components/popover/MrlPopover/MrlPopover.js.map +1 -1
  194. package/dist/esm/components/table/MrlSmartTable/MrlSmartTable.js +10 -10
  195. package/dist/esm/components/table/MrlSmartTable/MrlSmartTable.js.map +1 -1
  196. package/dist/esm/components/tabs/MrlTab/MrlTab.js +1 -1
  197. package/dist/esm/components/tabs/MrlTab/MrlTab.js.map +1 -1
  198. package/dist/esm/components/tabs/MrlTabContent/MrlTabContent.js +1 -1
  199. package/dist/esm/components/tabs/MrlTabContent/MrlTabContent.js.map +1 -1
  200. package/dist/esm/components/tabs/MrlTabGroup/MrlTabGroup.js +1 -1
  201. package/dist/esm/components/tabs/MrlTabGroup/MrlTabGroup.js.map +1 -1
  202. package/dist/esm/components/tabs/MrlTabLink/MrlTabLink.js +1 -1
  203. package/dist/esm/components/tabs/MrlTabLink/MrlTabLink.js.map +1 -1
  204. package/dist/esm/components/tabs/MrlTabs/MrlTabs.js.map +1 -1
  205. package/dist/esm/components/toolbar/MrlToolbar/MrlToolbar.js +4 -4
  206. package/dist/esm/components/toolbar/MrlToolbar/MrlToolbar.js.map +1 -1
  207. package/dist/esm/components/toolbar/MrlToolbarButton/MrlToolbarButton.js +2 -2
  208. package/dist/esm/components/toolbar/MrlToolbarButton/MrlToolbarButton.js.map +1 -1
  209. package/dist/esm/version.js +1 -1
  210. package/dist/esm/version.js.map +1 -1
  211. package/dist/types/components/avatar/MrlAvatarButton/MrlAvatarButton.d.ts +2 -1
  212. package/dist/types/components/button/MrlButton/MrlButton.d.ts +1 -1
  213. package/dist/types/components/button/MrlIconButton/MrlIconButton.d.ts +1 -1
  214. package/dist/types/components/callout/MrlCallout/MrlCallout.d.ts +0 -2
  215. package/dist/types/components/form/text-input/MrlEditableTextInput/MrlEditableTextInputRightIcon.d.ts +1 -1
  216. package/dist/types/components/form/text-input/MrlTextInput/MrlTextInput.d.ts +1 -1
  217. package/dist/types/components/form/text-input/MrlTextInput/MrlTextInputRightIcon.d.ts +1 -1
  218. package/dist/types/components/form/textarea/MrlEditableTextarea/MrlEditableTextarea.d.ts +1 -1
  219. package/dist/types/components/form/textarea/MrlEditableTextarea/MrlEditableTextareaRightButton.d.ts +1 -1
  220. package/dist/types/components/form/utils.d.ts +0 -13
  221. package/dist/types/components/link/MrlLinkButton/MrlLinkButton.d.ts +1 -1
  222. package/dist/types/components/menu/MrlMenu/MrlMenu.d.ts +1 -1
  223. package/dist/types/components/menu/MrlMenuItem/MrlMenuItem.d.ts +1 -1
  224. package/dist/types/components/menu/MrlMenuItemLink/MrlMenuItemLink.d.ts +1 -1
  225. package/dist/types/components/menu/demo/MenuWithTrigger.d.ts +1 -2
  226. package/dist/types/components/navigation-sidebar/MrlSidebarNavItem/MrlSidebarNavItem.d.ts +1 -1
  227. package/dist/types/components/notification/MrlBlockNotification/MrlBlockNotification.d.ts +1 -1
  228. package/dist/types/components/pagination/MrlPaginationButton/MrlPaginationButton.d.ts +1 -1
  229. package/dist/types/components/popover/MrlPopover/MrlPopover.d.ts +1 -1
  230. package/dist/types/components/tabs/MrlTabs/MrlTabs.d.ts +1 -1
  231. package/dist/types/components/toolbar/MrlToolbar/MrlToolbar.d.ts +2 -1
  232. package/dist/types/components/toolbar/MrlToolbarButton/MrlToolbarButton.d.ts +2 -1
  233. package/dist/types/utils/isObject/index.d.ts +1 -1
  234. package/dist/types/utils/setAttributes/index.d.ts +1 -1
  235. package/dist/utils/isObject/index.d.ts +1 -1
  236. package/dist/utils/setAttributes/index.d.ts +1 -1
  237. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"MrlIconButton.js","sources":["../../../../../src/components/button/MrlIconButton/MrlIconButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport classnames from 'classnames';\nimport {\n\tbuttonDefaults,\n\tMrlButtonKind,\n\tMrlButtonSize,\n\tMrlGhostIconButtonSize,\n\tToggleAria\n} from '../constants';\nimport { _isDisabled, _isSelected, _isToggleButton, _spinnerProps } from '../helpers';\nimport { AttrsObject, MrlComponentProps, setAttributes, getUniqueId } from '../../../utils';\nimport { MrlTooltipAnchor, MrlTooltipDefaults, MrlTooltipPosition } from '../../tooltip/constants';\nimport { MrlButtonState, MrlSpinner, MrlTooltip, ToggleStyle } from '../../';\nimport { spinnerDefaults } from '../../loader/constants';\nimport { useMrlTrackInteraction } from '../../../hooks/useMrlAnalytics';\nimport './MrlIconButton.scss';\n\nexport interface MrlIconButtonProps\n\textends Omit<MrlComponentProps, 'style'>,\n\t\tReact.ComponentProps<'button'> {\n\t/**\n\t * Applies additional HTML attributes to the button element.\n\t * @deprecated\n\t */\n\tattrs?: AttrsObject;\n\t/**\n\t * Allow developers to add badge to buttons.\n\t */\n\tbadge?: React.ReactElement;\n\t/** Additional class to add to the button */\n\tclassName?: string;\n\t/**\n\t * Allows developers the ability to disable built in event listeners so they can manage user\n\t * interactions from the application.\n\t */\n\tdisableEvents?: boolean;\n\n\t/** Whether to disable the tooltip hover action that keeps it open */\n\tdisableTooltipHover?: boolean;\n\n\t/**\n\t * The icon that will be rendered.\n\t */\n\ticon: React.ReactElement;\n\t/**\n\t * Changes the visual emphasis of the button.\n\t *\n\t * Note: size=\"xsmall\" should ONLY be used with a kind of `ghost` or `ghost-inverse`.\n\t */\n\tkind?: MrlButtonKind;\n\t/**\n\t * Displays a spinner in the button to indicate some action is in progress.\n\t */\n\tloading?: boolean;\n\t/**\n\t * Text for the spinner when the button is in a loading state.\n\t */\n\tloadingText?: string;\n\n\t/**\n\t * onClick event for the button.\n\t */\n\tonClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;\n\n\t/**\n\t * onKeyDown event for the button.\n\t */\n\tonKeyUp?: (e: React.KeyboardEvent<HTMLButtonElement>) => void;\n\n\t/**\n\t * onMouseUp event for the button.\n\t */\n\tonMouseUp?: (e: React.MouseEvent<HTMLButtonElement>) => void;\n\n\t/**\n\t * The placement of the tooltip in relation to the button.\n\t */\n\tposition?: MrlTooltipPosition;\n\t/**\n\t * Changes the size of the button so it can scale with its surrounding context.\n\t *\n\t * Note: size=\"xsmall\" should ONLY be used with a kind of `ghost` or `ghost-inverse`.\n\t */\n\tsize?: MrlButtonSize | MrlGhostIconButtonSize;\n\t/**\n\t * Changes the state of the button based on user permissions or actions.\n\t *\n\t * Note: The Basic Button does not fully support state=\"disabled\", use\n\t * the 'disabled' prop instead. Since it does not support state=\"disabled\",\n\t * it also doesn't not support state=\"selected-disabled\".\n\t */\n\tstate?: MrlButtonState;\n\t/**\n\t * The textual label describing the button's purpose/action.\n\t * Icon buttons require a text label to ensure accessibility.\n\t */\n\ttext: string;\n\t/**\n\t * The arrow position of the tooltip in relation to the button.\n\t */\n\ttipAnchor?: MrlTooltipAnchor;\n\n\t/**\n\t * Enables interaction tracking for this button. Provide a stable, non-PII id\n\t * (e.g. 'board-share-cta'). When omitted, the button emits no analytics.\n\t */\n\teventId?: string;\n\n\t/**\n\t * Determines which aria setup to use for various toggle/selected styles.\n\t * pressed - use for an traditional “toggle button”\n\t * selected - use for tabs and custom select options\n\t * expanded - use for menus, panels, and popovers\n\t * checked - use for custom [radiobutton](https://www.w3.org/WAI/ARIA/apg/patterns/radiobutton/#wai-aria-roles-states-and-properties-16)\n\t * \t\tor [checkbox](https://www.w3.org/WAI/ARIA/apg/patterns/checkbox/#wai-aria-roles-states-and-properties-5) inputs\n\t */\n\ttoggleAria?: ToggleAria;\n\t/**\n\t * Selected state variant when the button is a Toggle Button. The visual styles\n\t * are also impacted by the \"kind\" prop. Toggle buttons are only supported\n\t * when \"kind\" is set to either \"ghost\" or \"ghost-inverse\". Setting this prop\n\t * informs the component that this is a toggle button and to add that functionality\n\t */\n\ttoggleStyle?: ToggleStyle;\n\n\t/**\n\t * An optional class name to add to the tooltip wrapper.\n\t */\n\twrapperClassName?: string;\n\n\t/**\n\t * Controlled state that overrides the internal state management.\n\t * When provided, this takes precedence over the `state` prop and allows\n\t * the parent component to fully control the icon button's state.\n\t */\n\tcontrolledState?: MrlButtonState;\n}\n\nexport const MrlIconButton = React.forwardRef<HTMLButtonElement, MrlIconButtonProps>(\n\tfunction MrlIconButton(\n\t\t{\n\t\t\t['aria-label']: ariaLabel,\n\t\t\tattrs = {},\n\t\t\tbadge,\n\t\t\tclassName,\n\t\t\tdisableEvents = false,\n\t\t\tdisableTooltipHover = false,\n\t\t\ticon,\n\t\t\t// We intentionally deviate from the basic button for icon-buttons since the vast\n\t\t\t// majority of icon buttons are ghost buttons. The proptype remains\n\t\t\t// consistent with the basic button however to keep our code DRY.\n\t\t\tkind = 'ghost',\n\t\t\tloading = false,\n\t\t\tloadingText = spinnerDefaults.text,\n\t\t\tonClick,\n\t\t\tonKeyUp,\n\t\t\tonMouseUp,\n\t\t\tposition = MrlTooltipDefaults.position,\n\t\t\ttoggleAria = buttonDefaults.toggleAria,\n\t\t\ttoggleStyle,\n\t\t\ttext,\n\t\t\ttipAnchor = MrlTooltipDefaults.anchor,\n\t\t\teventId,\n\t\t\tsize = buttonDefaults.size,\n\t\t\tstate = buttonDefaults.state,\n\t\t\twrapperClassName,\n\t\t\tcontrolledState,\n\t\t\t...remainingProps\n\t\t}: MrlIconButtonProps,\n\t\tref\n\t) {\n\t\t/**\n\t\t * Determine the effective button state.\n\t\t * Uses controlledState if provided (controlled mode),\n\t\t * otherwise falls back to the state prop (uncontrolled mode).\n\t\t * This allows the component to work in both controlled and uncontrolled scenarios.\n\t\t */\n\t\tconst effectiveButtonState = controlledState ?? state;\n\n\t\tconst [isSelected, setIsSelected] = React.useState(() => _isSelected(effectiveButtonState));\n\n\t\tconst trackInteraction = useMrlTrackInteraction('MrlIconButton', eventId);\n\n\t\tconst buttonRef = React.useRef<HTMLButtonElement>(null);\n\t\tReact.useImperativeHandle<HTMLButtonElement | null, HTMLButtonElement | null>(\n\t\t\tref,\n\t\t\t() => buttonRef.current\n\t\t);\n\n\t\t/**\n\t\t * MrlIconButton could behave as a toggle button if toggleStyle is 'default' or 'secondary'\n\t\t */\n\t\tconst isToggleButton = toggleStyle && _isToggleButton(toggleStyle);\n\n\t\t/**\n\t\t * We need to watch the value of state to keep in sync\n\t\t * the value of state passed as props and the internal\n\t\t * isSelected piece of state.\n\t\t */\n\t\tReact.useEffect(() => {\n\t\t\t// allows consumers to set the 'selected' or 'selected-disabled' state from a parent component.\n\t\t\tsetIsSelected(_isSelected(effectiveButtonState));\n\t\t}, [effectiveButtonState]);\n\n\t\t/**\n\t\t * Handle onClick events\n\t\t * @param {React.MouseEvent<HTMLButtonElement>} e - mouse event\n\t\t */\n\t\tfunction handleOnClick(e: React.MouseEvent<HTMLButtonElement>) {\n\t\t\te.stopPropagation();\n\n\t\t\tif (_isDisabled(effectiveButtonState, loading) || disableEvents) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\ttrackInteraction({ action: 'click', variant: kind });\n\n\t\t\tif (isToggleButton && !controlledState) {\n\t\t\t\tsetIsSelected((prevIsSelected) => !prevIsSelected);\n\t\t\t}\n\n\t\t\tif (onClick && typeof onClick === 'function') {\n\t\t\t\tonClick(e);\n\t\t\t}\n\t\t}\n\n\t\tconst classNames = classnames(\n\t\t\t'mrlIconButton',\n\t\t\t`mrlIconButton--${size}`,\n\t\t\t`mrlIconButton--${kind}`,\n\t\t\tisToggleButton && toggleStyle && `toggleStyle--${toggleStyle}`,\n\t\t\tattrs.class || attrs.className,\n\t\t\tclassName\n\t\t);\n\n\t\tdelete attrs.class;\n\t\tdelete attrs.className;\n\n\t\tconst getAriaLabel = (): string => {\n\t\t\t// Set loading text if loading\n\t\t\tif (loading) return `${loadingText} ${text}`;\n\n\t\t\t// Only set aria-label if we have actual content\n\t\t\tconst hasAriaLabel = ariaLabel && ariaLabel.trim() !== '';\n\n\t\t\t// If we have a custom ariaLabel, override the default text\n\t\t\tif (hasAriaLabel) return ariaLabel;\n\n\t\t\t// Fallback to icon button text\n\t\t\treturn text;\n\t\t};\n\n\t\tconst ariaLabelValue = getAriaLabel();\n\n\t\tconst attributes = setAttributes(attrs, {\n\t\t\t'aria-disabled': _isDisabled(effectiveButtonState, loading),\n\t\t\t'aria-label': ariaLabelValue,\n\t\t\t...(isToggleButton && { [`aria-${toggleAria}`]: isSelected || false }),\n\t\t\ttype: 'button'\n\t\t});\n\n\t\t// MrlSvg should always have size=\"auto\"\n\t\tconst iconWithSizeAuto = React.useMemo(\n\t\t\t() =>\n\t\t\t\tReact.cloneElement(icon, {\n\t\t\t\t\tsize: 'auto'\n\t\t\t\t}),\n\t\t\t[icon]\n\t\t);\n\n\t\tconst spinnerProps = _spinnerProps(kind, size);\n\t\tconst spinner = <MrlSpinner kind={spinnerProps.kind} size={spinnerProps.size} />;\n\n\t\tconst dataQaProp = (remainingProps as { 'data-qa'?: string })['data-qa'];\n\t\tconst tooltipQa = dataQaProp ? `${dataQaProp}-tooltip` : getUniqueId('tooltip');\n\t\tconst tooltipContentClass =\n\t\t\tsize === 'xsmall' || size === 'small' ? `mrlIconButton--${size}-wrapper` : undefined;\n\n\t\treturn (\n\t\t\t<MrlTooltip\n\t\t\t\tanchor={tipAnchor}\n\t\t\t\tdataQa={tooltipQa}\n\t\t\t\tposition={position}\n\t\t\t\ttext={text}\n\t\t\t\ttooltipClass={classnames('mrlIconButton-wrapper', wrapperClassName)}\n\t\t\t\ttooltipContentClass={tooltipContentClass}\n\t\t\t\tdisableTooltipHover={disableTooltipHover}\n\t\t\t\tsrAnnouncement={false}\n\t\t\t>\n\t\t\t\t<button\n\t\t\t\t\t{...attributes}\n\t\t\t\t\t{...remainingProps}\n\t\t\t\t\tclassName={classNames}\n\t\t\t\t\tref={buttonRef}\n\t\t\t\t\tonClick={handleOnClick}\n\t\t\t\t\tonKeyUp={onKeyUp}\n\t\t\t\t\tonMouseUp={onMouseUp}\n\t\t\t\t>\n\t\t\t\t\t{loading ? spinner : iconWithSizeAuto}\n\t\t\t\t\t{badge}\n\t\t\t\t</button>\n\t\t\t</MrlTooltip>\n\t\t);\n\t}\n);\n"],"names":["MrlIconButton","React","forwardRef","_ref","ref","ariaLabel","_ref$attrs","attrs","badge","className","_ref$disableEvents","disableEvents","_ref$disableTooltipHo","disableTooltipHover","icon","_ref$kind","kind","_ref$loading","loading","_ref$loadingText","loadingText","spinnerDefaults","text","onClick","onKeyUp","onMouseUp","_ref$position","position","MrlTooltipDefaults","_ref$toggleAria","toggleAria","buttonDefaults","toggleStyle","_ref$tipAnchor","tipAnchor","anchor","eventId","_ref$size","size","_ref$state","state","wrapperClassName","controlledState","remainingProps","_objectWithoutProperties","_excluded","effectiveButtonState","_React$useState","useState","_isSelected","_React$useState2","_slicedToArray","isSelected","setIsSelected","trackInteraction","useMrlTrackInteraction","buttonRef","useRef","useImperativeHandle","current","isToggleButton","_isToggleButton","useEffect","handleOnClick","e","stopPropagation","_isDisabled","action","variant","prevIsSelected","classNames","classnames","concat","class","getAriaLabel","hasAriaLabel","trim","ariaLabelValue","attributes","setAttributes","_objectSpread","type","iconWithSizeAuto","useMemo","cloneElement","spinnerProps","_spinnerProps","spinner","createElement","MrlSpinner","dataQaProp","tooltipQa","getUniqueId","tooltipContentClass","undefined","MrlTooltip","dataQa","tooltipClass","srAnnouncement","_extends"],"mappings":";;;;;;;;;;;;;AA0IO,IAAMA,aAAa,gBAAGC,KAAK,CAACC,UAAU,CAC5C,SAASF,aAAaA,CAAAG,IAAA,EA8BrBC,GAAG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CAA4B,SAAS,CAAC;EACxE,IAAMgD,SAAS,GAAGD,UAAU,GAAA,EAAA,CAAAlB,MAAA,CAAMkB,UAAU,EAAA,UAAA,CAAA,GAAaE,WAAW,CAAC,SAAS,CAAC;AAC/E,EAAA,IAAMC,mBAAmB,GACxBvD,IAAI,KAAK,QAAQ,IAAIA,IAAI,KAAK,OAAO,GAAA,iBAAA,CAAAkC,MAAA,CAAqBlC,IAAI,gBAAawD,SAAS;AAErF,EAAA,oBACC7F,KAAA,CAAAuF,aAAA,CAACO,UAAU,EAAA;AACV5D,IAAAA,MAAM,EAAED,SAAU;AAClB8D,IAAAA,MAAM,EAAEL,SAAU;AAClBhE,IAAAA,QAAQ,EAAEA,QAAS;AACnBL,IAAAA,IAAI,EAAEA,IAAK;AACX2E,IAAAA,YAAY,EAAE1B,UAAU,CAAC,uBAAuB,EAAE9B,gBAAgB,CAAE;AACpEoD,IAAAA,mBAAmB,EAAEA,mBAAoB;AACzChF,IAAAA,mBAAmB,EAAEA,mBAAoB;AACzCqF,IAAAA,cAAc,EAAE;GAAM,eAEtBjG,KAAA,CAAAuF,aAAA,CAAA,QAAA,EAAAW,QAAA,CAAA,EAAA,EACKrB,UAAU,EACVnC,cAAc,EAAA;AAClBlC,IAAAA,SAAS,EAAE6D,UAAW;AACtBlE,IAAAA,GAAG,EAAEoD,SAAU;AACfjC,IAAAA,OAAO,EAAEwC,aAAc;AACvBvC,IAAAA,OAAO,EAAEA,OAAQ;AACjBC,IAAAA,SAAS,EAAEA;GAAU,CAAA,EAEpBP,OAAO,GAAGqE,OAAO,GAAGL,gBAAgB,EACpC1E,KACM,CACG,CAAC;AAEf,CACD;;;;"}
1
+ {"version":3,"file":"MrlIconButton.js","sources":["../../../../../src/components/button/MrlIconButton/MrlIconButton.tsx"],"sourcesContent":["import * as React from 'react';\nimport classnames from 'classnames';\nimport {\n\tbuttonDefaults,\n\tMrlButtonKind,\n\tMrlButtonSize,\n\tMrlGhostIconButtonSize,\n\tToggleAria\n} from '../constants';\nimport { _isDisabled, _isSelected, _isToggleButton, _spinnerProps } from '../helpers';\nimport { AttrsObject, MrlComponentProps, setAttributes, getUniqueId } from '../../../utils';\nimport { MrlTooltipAnchor, MrlTooltipDefaults, MrlTooltipPosition } from '../../tooltip/constants';\nimport { MrlSpinner } from '../../loader/MrlSpinner/MrlSpinner';\nimport { MrlTooltip } from '../../tooltip/MrlTooltip/MrlTooltip';\nimport type { MrlButtonState, ToggleStyle } from '../MrlButton/MrlButton';\nimport { spinnerDefaults } from '../../loader/constants';\nimport { useMrlTrackInteraction } from '../../../hooks/useMrlAnalytics';\nimport './MrlIconButton.scss';\n\nexport interface MrlIconButtonProps\n\textends Omit<MrlComponentProps, 'style'>,\n\t\tReact.ComponentProps<'button'> {\n\t/**\n\t * Applies additional HTML attributes to the button element.\n\t * @deprecated\n\t */\n\tattrs?: AttrsObject;\n\t/**\n\t * Allow developers to add badge to buttons.\n\t */\n\tbadge?: React.ReactElement;\n\t/** Additional class to add to the button */\n\tclassName?: string;\n\t/**\n\t * Allows developers the ability to disable built in event listeners so they can manage user\n\t * interactions from the application.\n\t */\n\tdisableEvents?: boolean;\n\n\t/** Whether to disable the tooltip hover action that keeps it open */\n\tdisableTooltipHover?: boolean;\n\n\t/**\n\t * The icon that will be rendered.\n\t */\n\ticon: React.ReactElement;\n\t/**\n\t * Changes the visual emphasis of the button.\n\t *\n\t * Note: size=\"xsmall\" should ONLY be used with a kind of `ghost` or `ghost-inverse`.\n\t */\n\tkind?: MrlButtonKind;\n\t/**\n\t * Displays a spinner in the button to indicate some action is in progress.\n\t */\n\tloading?: boolean;\n\t/**\n\t * Text for the spinner when the button is in a loading state.\n\t */\n\tloadingText?: string;\n\n\t/**\n\t * onClick event for the button.\n\t */\n\tonClick?: (e: React.MouseEvent<HTMLButtonElement>) => void;\n\n\t/**\n\t * onKeyDown event for the button.\n\t */\n\tonKeyUp?: (e: React.KeyboardEvent<HTMLButtonElement>) => void;\n\n\t/**\n\t * onMouseUp event for the button.\n\t */\n\tonMouseUp?: (e: React.MouseEvent<HTMLButtonElement>) => void;\n\n\t/**\n\t * The placement of the tooltip in relation to the button.\n\t */\n\tposition?: MrlTooltipPosition;\n\t/**\n\t * Changes the size of the button so it can scale with its surrounding context.\n\t *\n\t * Note: size=\"xsmall\" should ONLY be used with a kind of `ghost` or `ghost-inverse`.\n\t */\n\tsize?: MrlButtonSize | MrlGhostIconButtonSize;\n\t/**\n\t * Changes the state of the button based on user permissions or actions.\n\t *\n\t * Note: The Basic Button does not fully support state=\"disabled\", use\n\t * the 'disabled' prop instead. Since it does not support state=\"disabled\",\n\t * it also doesn't not support state=\"selected-disabled\".\n\t */\n\tstate?: MrlButtonState;\n\t/**\n\t * The textual label describing the button's purpose/action.\n\t * Icon buttons require a text label to ensure accessibility.\n\t */\n\ttext: string;\n\t/**\n\t * The arrow position of the tooltip in relation to the button.\n\t */\n\ttipAnchor?: MrlTooltipAnchor;\n\n\t/**\n\t * Enables interaction tracking for this button. Provide a stable, non-PII id\n\t * (e.g. 'board-share-cta'). When omitted, the button emits no analytics.\n\t */\n\teventId?: string;\n\n\t/**\n\t * Determines which aria setup to use for various toggle/selected styles.\n\t * pressed - use for an traditional “toggle button”\n\t * selected - use for tabs and custom select options\n\t * expanded - use for menus, panels, and popovers\n\t * checked - use for custom [radiobutton](https://www.w3.org/WAI/ARIA/apg/patterns/radiobutton/#wai-aria-roles-states-and-properties-16)\n\t * \t\tor [checkbox](https://www.w3.org/WAI/ARIA/apg/patterns/checkbox/#wai-aria-roles-states-and-properties-5) inputs\n\t */\n\ttoggleAria?: ToggleAria;\n\t/**\n\t * Selected state variant when the button is a Toggle Button. The visual styles\n\t * are also impacted by the \"kind\" prop. Toggle buttons are only supported\n\t * when \"kind\" is set to either \"ghost\" or \"ghost-inverse\". Setting this prop\n\t * informs the component that this is a toggle button and to add that functionality\n\t */\n\ttoggleStyle?: ToggleStyle;\n\n\t/**\n\t * An optional class name to add to the tooltip wrapper.\n\t */\n\twrapperClassName?: string;\n\n\t/**\n\t * Controlled state that overrides the internal state management.\n\t * When provided, this takes precedence over the `state` prop and allows\n\t * the parent component to fully control the icon button's state.\n\t */\n\tcontrolledState?: MrlButtonState;\n}\n\nexport const MrlIconButton = React.forwardRef<HTMLButtonElement, MrlIconButtonProps>(\n\tfunction MrlIconButton(\n\t\t{\n\t\t\t['aria-label']: ariaLabel,\n\t\t\tattrs = {},\n\t\t\tbadge,\n\t\t\tclassName,\n\t\t\tdisableEvents = false,\n\t\t\tdisableTooltipHover = false,\n\t\t\ticon,\n\t\t\t// We intentionally deviate from the basic button for icon-buttons since the vast\n\t\t\t// majority of icon buttons are ghost buttons. The proptype remains\n\t\t\t// consistent with the basic button however to keep our code DRY.\n\t\t\tkind = 'ghost',\n\t\t\tloading = false,\n\t\t\tloadingText = spinnerDefaults.text,\n\t\t\tonClick,\n\t\t\tonKeyUp,\n\t\t\tonMouseUp,\n\t\t\tposition = MrlTooltipDefaults.position,\n\t\t\ttoggleAria = buttonDefaults.toggleAria,\n\t\t\ttoggleStyle,\n\t\t\ttext,\n\t\t\ttipAnchor = MrlTooltipDefaults.anchor,\n\t\t\teventId,\n\t\t\tsize = buttonDefaults.size,\n\t\t\tstate = buttonDefaults.state,\n\t\t\twrapperClassName,\n\t\t\tcontrolledState,\n\t\t\t...remainingProps\n\t\t}: MrlIconButtonProps,\n\t\tref\n\t) {\n\t\t/**\n\t\t * Determine the effective button state.\n\t\t * Uses controlledState if provided (controlled mode),\n\t\t * otherwise falls back to the state prop (uncontrolled mode).\n\t\t * This allows the component to work in both controlled and uncontrolled scenarios.\n\t\t */\n\t\tconst effectiveButtonState = controlledState ?? state;\n\n\t\tconst [isSelected, setIsSelected] = React.useState(() => _isSelected(effectiveButtonState));\n\n\t\tconst trackInteraction = useMrlTrackInteraction('MrlIconButton', eventId);\n\n\t\tconst buttonRef = React.useRef<HTMLButtonElement>(null);\n\t\tReact.useImperativeHandle<HTMLButtonElement | null, HTMLButtonElement | null>(\n\t\t\tref,\n\t\t\t() => buttonRef.current\n\t\t);\n\n\t\t/**\n\t\t * MrlIconButton could behave as a toggle button if toggleStyle is 'default' or 'secondary'\n\t\t */\n\t\tconst isToggleButton = toggleStyle && _isToggleButton(toggleStyle);\n\n\t\t/**\n\t\t * We need to watch the value of state to keep in sync\n\t\t * the value of state passed as props and the internal\n\t\t * isSelected piece of state.\n\t\t */\n\t\tReact.useEffect(() => {\n\t\t\t// allows consumers to set the 'selected' or 'selected-disabled' state from a parent component.\n\t\t\tsetIsSelected(_isSelected(effectiveButtonState));\n\t\t}, [effectiveButtonState]);\n\n\t\t/**\n\t\t * Handle onClick events\n\t\t * @param {React.MouseEvent<HTMLButtonElement>} e - mouse event\n\t\t */\n\t\tfunction handleOnClick(e: React.MouseEvent<HTMLButtonElement>) {\n\t\t\te.stopPropagation();\n\n\t\t\tif (_isDisabled(effectiveButtonState, loading) || disableEvents) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\ttrackInteraction({ action: 'click', variant: kind });\n\n\t\t\tif (isToggleButton && !controlledState) {\n\t\t\t\tsetIsSelected((prevIsSelected) => !prevIsSelected);\n\t\t\t}\n\n\t\t\tif (onClick && typeof onClick === 'function') {\n\t\t\t\tonClick(e);\n\t\t\t}\n\t\t}\n\n\t\tconst classNames = classnames(\n\t\t\t'mrlIconButton',\n\t\t\t`mrlIconButton--${size}`,\n\t\t\t`mrlIconButton--${kind}`,\n\t\t\tisToggleButton && toggleStyle && `toggleStyle--${toggleStyle}`,\n\t\t\tattrs.class || attrs.className,\n\t\t\tclassName\n\t\t);\n\n\t\tdelete attrs.class;\n\t\tdelete attrs.className;\n\n\t\tconst getAriaLabel = (): string => {\n\t\t\t// Set loading text if loading\n\t\t\tif (loading) return `${loadingText} ${text}`;\n\n\t\t\t// Only set aria-label if we have actual content\n\t\t\tconst hasAriaLabel = ariaLabel && ariaLabel.trim() !== '';\n\n\t\t\t// If we have a custom ariaLabel, override the default text\n\t\t\tif (hasAriaLabel) return ariaLabel;\n\n\t\t\t// Fallback to icon button text\n\t\t\treturn text;\n\t\t};\n\n\t\tconst ariaLabelValue = getAriaLabel();\n\n\t\tconst attributes = setAttributes(attrs, {\n\t\t\t'aria-disabled': _isDisabled(effectiveButtonState, loading),\n\t\t\t'aria-label': ariaLabelValue,\n\t\t\t...(isToggleButton && { [`aria-${toggleAria}`]: isSelected || false }),\n\t\t\ttype: 'button'\n\t\t});\n\n\t\t// MrlSvg should always have size=\"auto\"\n\t\tconst iconWithSizeAuto = React.useMemo(\n\t\t\t() =>\n\t\t\t\tReact.cloneElement(icon, {\n\t\t\t\t\tsize: 'auto'\n\t\t\t\t}),\n\t\t\t[icon]\n\t\t);\n\n\t\tconst spinnerProps = _spinnerProps(kind, size);\n\t\tconst spinner = <MrlSpinner kind={spinnerProps.kind} size={spinnerProps.size} />;\n\n\t\tconst dataQaProp = (remainingProps as { 'data-qa'?: string })['data-qa'];\n\t\tconst tooltipQa = dataQaProp ? `${dataQaProp}-tooltip` : getUniqueId('tooltip');\n\t\tconst tooltipContentClass =\n\t\t\tsize === 'xsmall' || size === 'small' ? `mrlIconButton--${size}-wrapper` : undefined;\n\n\t\treturn (\n\t\t\t<MrlTooltip\n\t\t\t\tanchor={tipAnchor}\n\t\t\t\tdataQa={tooltipQa}\n\t\t\t\tposition={position}\n\t\t\t\ttext={text}\n\t\t\t\ttooltipClass={classnames('mrlIconButton-wrapper', wrapperClassName)}\n\t\t\t\ttooltipContentClass={tooltipContentClass}\n\t\t\t\tdisableTooltipHover={disableTooltipHover}\n\t\t\t\tsrAnnouncement={false}\n\t\t\t>\n\t\t\t\t<button\n\t\t\t\t\t{...attributes}\n\t\t\t\t\t{...remainingProps}\n\t\t\t\t\tclassName={classNames}\n\t\t\t\t\tref={buttonRef}\n\t\t\t\t\tonClick={handleOnClick}\n\t\t\t\t\tonKeyUp={onKeyUp}\n\t\t\t\t\tonMouseUp={onMouseUp}\n\t\t\t\t>\n\t\t\t\t\t{loading ? spinner : iconWithSizeAuto}\n\t\t\t\t\t{badge}\n\t\t\t\t</button>\n\t\t\t</MrlTooltip>\n\t\t);\n\t}\n);\n"],"names":["MrlIconButton","React","forwardRef","_ref","ref","ariaLabel","_ref$attrs","attrs","badge","className","_ref$disableEvents","disableEvents","_ref$disableTooltipHo","disableTooltipHover","icon","_ref$kind","kind","_ref$loading","loading","_ref$loadingText","loadingText","spinnerDefaults","text","onClick","onKeyUp","onMouseUp","_ref$position","position","MrlTooltipDefaults","_ref$toggleAria","toggleAria","buttonDefaults","toggleStyle","_ref$tipAnchor","tipAnchor","anchor","eventId","_ref$size","size","_ref$state","state","wrapperClassName","controlledState","remainingProps","_objectWithoutProperties","_excluded","effectiveButtonState","_React$useState","useState","_isSelected","_React$useState2","_slicedToArray","isSelected","setIsSelected","trackInteraction","useMrlTrackInteraction","buttonRef","useRef","useImperativeHandle","current","isToggleButton","_isToggleButton","useEffect","handleOnClick","e","stopPropagation","_isDisabled","action","variant","prevIsSelected","classNames","classnames","concat","class","getAriaLabel","hasAriaLabel","trim","ariaLabelValue","attributes","setAttributes","_objectSpread","type","iconWithSizeAuto","useMemo","cloneElement","spinnerProps","_spinnerProps","spinner","createElement","MrlSpinner","dataQaProp","tooltipQa","getUniqueId","tooltipContentClass","undefined","MrlTooltip","dataQa","tooltipClass","srAnnouncement","_extends"],"mappings":";;;;;;;;;;;;;AA4IO,IAAMA,aAAa,gBAAGC,KAAK,CAACC,UAAU,CAC5C,SAASF,aAAaA,CAAAG,IAAA,EA8BrBC,GAAG,EACF;AAAA,EAAA,IA7BgBC,SAAS,GAAAF,IAAA,CAAxB,YAAY,CAAA;IAAAG,UAAA,GAAAH,IAAA,CACbI,KAAK;AAALA,IAAAA,KAAK,GAAAD,UAAA,KAAA,MAAA,GAAG,EAAE,GAAAA,UAAA;IACVE,KAAK,GAAAL,IAAA,CAALK,KAAK;IACLC,SAAS,GAAAN,IAAA,CAATM,SAAS;IAAAC,kBAAA,GAAAP,IAAA,CACTQ,aAAa;AAAbA,IAAAA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KAAA,CAAAuF,aAAA,CAACO,UAAU,EAAA;AACV5D,IAAAA,MAAM,EAAED,SAAU;AAClB8D,IAAAA,MAAM,EAAEL,SAAU;AAClBhE,IAAAA,QAAQ,EAAEA,QAAS;AACnBL,IAAAA,IAAI,EAAEA,IAAK;AACX2E,IAAAA,YAAY,EAAE1B,UAAU,CAAC,uBAAuB,EAAE9B,gBAAgB,CAAE;AACpEoD,IAAAA,mBAAmB,EAAEA,mBAAoB;AACzChF,IAAAA,mBAAmB,EAAEA,mBAAoB;AACzCqF,IAAAA,cAAc,EAAE;GAAM,eAEtBjG,KAAA,CAAAuF,aAAA,CAAA,QAAA,EAAAW,QAAA,CAAA,EAAA,EACKrB,UAAU,EACVnC,cAAc,EAAA;AAClBlC,IAAAA,SAAS,EAAE6D,UAAW;AACtBlE,IAAAA,GAAG,EAAEoD,SAAU;AACfjC,IAAAA,OAAO,EAAEwC,aAAc;AACvBvC,IAAAA,OAAO,EAAEA,OAAQ;AACjBC,IAAAA,SAAS,EAAEA;GAAU,CAAA,EAEpBP,OAAO,GAAGqE,OAAO,GAAGL,gBAAgB,EACpC1E,KACM,CACG,CAAC;AAEf,CACD;;;;"}
@@ -10,7 +10,7 @@ import { MrlText } from '../../text/MrlText/MrlText.js';
10
10
  import { MrlTextHeading } from '../../text/MrlTextHeading/MrlTextHeading.js';
11
11
  import { MrlButton } from '../../button/MrlButton/MrlButton.js';
12
12
 
13
- var _excluded = ["ariaControls", "alignment", "children", "description", "disableClickOutside", "disableFocusTrap", "eyebrow", "hasCloseButton", "image", "kind", "onOpen", "onClose", "point", "position", "primaryCta", "secondaryCta", "show", "spacing", "title", "eventId"];
13
+ var _excluded = ["ariaControls", "alignment", "children", "description", "disableClickOutside", "disableFocusTrap", "eyebrow", "hasCloseButton", "image", "onOpen", "onClose", "point", "position", "primaryCta", "secondaryCta", "show", "spacing", "title", "eventId"];
14
14
  /**
15
15
  * MrlCallout component.
16
16
  *
@@ -28,7 +28,6 @@ var MrlCallout = props => {
28
28
  description: props.description,
29
29
  eyebrow: props.eyebrow,
30
30
  image: props.image,
31
- kind: props.kind,
32
31
  title: props.title
33
32
  };
34
33
  }
@@ -46,8 +45,6 @@ var MrlCallout = props => {
46
45
  _ref$hasCloseButton = _ref.hasCloseButton,
47
46
  hasCloseButton = _ref$hasCloseButton === void 0 ? true : _ref$hasCloseButton,
48
47
  image = _ref.image,
49
- _ref$kind = _ref.kind,
50
- kind = _ref$kind === void 0 ? 'primary' : _ref$kind,
51
48
  onOpen = _ref.onOpen,
52
49
  onClose = _ref.onClose,
53
50
  _ref$point = _ref.point,
@@ -71,10 +68,9 @@ var MrlCallout = props => {
71
68
  if (wasShownRef.current === show) return;
72
69
  wasShownRef.current = show;
73
70
  trackInteraction({
74
- action: show ? 'open' : 'close',
75
- variant: kind
71
+ action: show ? 'open' : 'close'
76
72
  });
77
- }, [show, kind, trackInteraction]);
73
+ }, [show, trackInteraction]);
78
74
  if (/*#__PURE__*/React.isValidElement(children) && children.type === React.Fragment) {
79
75
  throw new Error('MrlCallout accepts a single child and does not accept a React.Fragment as a child.');
80
76
  }
@@ -99,9 +95,6 @@ var MrlCallout = props => {
99
95
  React.useEffect(() => {
100
96
  triggerRef.current = document.querySelector("#".concat(calloutId));
101
97
  }, [calloutId]);
102
- var popoverKind = kind === 'primary' ? 'inverse' : 'primary';
103
- var primaryCtaKind = kind === 'primary' ? 'inverse' : 'secondary';
104
- var secondaryCtaKind = kind === 'primary' ? 'ghost-inverse' : 'ghost';
105
98
  return /*#__PURE__*/React.createElement(React.Fragment, null, childElement, triggerRef && /*#__PURE__*/React.createElement(MrlPopover, _extends({
106
99
  actionState: {
107
100
  actionType: 'click',
@@ -113,7 +106,7 @@ var MrlCallout = props => {
113
106
  disableClickOutside: disableClickOutside,
114
107
  disableFocusTrap: disableFocusTrap,
115
108
  hasCloseButton: hasCloseButton,
116
- kind: popoverKind,
109
+ kind: "inverse",
117
110
  onClose: onClose,
118
111
  onOpen: onOpen,
119
112
  point: point,
@@ -145,14 +138,13 @@ var MrlCallout = props => {
145
138
  className: styles['MrlCallout--footer']
146
139
  }, secondaryCta && /*#__PURE__*/React.createElement(MrlButton, {
147
140
  "data-qa": secondaryCta.dataQa,
148
- kind: secondaryCtaKind,
141
+ kind: "ghost-inverse",
149
142
  onClick: () => {
150
143
  trackInteraction({
151
144
  action: 'click',
152
145
  metadata: {
153
146
  cta: 'secondary'
154
- },
155
- variant: kind
147
+ }
156
148
  });
157
149
  secondaryCta.onClick();
158
150
  },
@@ -160,14 +152,13 @@ var MrlCallout = props => {
160
152
  size: "small"
161
153
  }), primaryCta && /*#__PURE__*/React.createElement(MrlButton, {
162
154
  "data-qa": primaryCta.dataQa,
163
- kind: primaryCtaKind,
155
+ kind: "inverse",
164
156
  onClick: () => {
165
157
  trackInteraction({
166
158
  action: 'click',
167
159
  metadata: {
168
160
  cta: 'primary'
169
- },
170
- variant: kind
161
+ }
171
162
  });
172
163
  primaryCta.onClick();
173
164
  },
@@ -1 +1 @@
1
- {"version":3,"file":"MrlCallout.js","sources":["../../../../../src/components/callout/MrlCallout/MrlCallout.tsx"],"sourcesContent":["import * as React from 'react';\nimport { MrlPopover, MrlPopoverProps } from '../../popover';\nimport { MrlText, MrlTextHeading } from '../../text';\nimport styles from './MrlCallout.module.scss';\nimport { MrlButton } from '../../button';\nimport { getUniqueId } from '../../../utils';\nimport { PORTAL_LAYERS } from '../../../utils/layers';\nimport { useRef } from 'react';\nimport { useMrlTrackInteraction } from '../../../hooks/useMrlAnalytics';\n\nexport type MrlCalloutPopoverProps = Omit<\n\tMrlPopoverProps,\n\t'children' | 'actionState' | 'isSubMenu' | 'triggerRef' | 'kind'\n>;\n\ninterface MrlCalloutCTA {\n\tonClick: () => void;\n\tdataQa?: string;\n\ttext: string;\n}\n\nexport type CalloutKind = 'primary' | 'secondary';\n\nexport interface MrlCalloutProps extends MrlCalloutPopoverProps {\n\t/** a unique id that binds the callout content and the trigger for assistive technologies */\n\tariaControls?: string;\n\tautoFocus?: boolean;\n\tchildren: React.ReactElement;\n\tdisableClickOutside?: boolean;\n\tdescription?: string | JSX.Element;\n\teyebrow?: string;\n\tid?: string;\n\timage?: JSX.Element;\n\tkind?: CalloutKind;\n\trenderWithPortal?: boolean;\n\tshow: boolean;\n\ttitle?: string;\n\tprimaryCta?: MrlCalloutCTA;\n\tsecondaryCta?: MrlCalloutCTA;\n\t/**\n\t * Enables interaction tracking for this callout. Provide a stable, non-PII id\n\t * (e.g. 'ai-onboarding-callout'). When omitted, the callout emits no analytics.\n\t *\n\t * Note: title, eyebrow and description text are never emitted.\n\t */\n\teventId?: string;\n}\n\ntype MrlCalloutContent = Pick<\n\tMrlCalloutProps,\n\t'alignment' | 'description' | 'eyebrow' | 'image' | 'kind' | 'title'\n>;\n\n/**\n * MrlCallout component.\n *\n * @param props - The props.\n * @returns {React.ReactElement} The MrlCallout component.\n */\nexport const MrlCallout = (props: MrlCalloutProps): React.ReactElement => {\n\t// In some cases when `show` is false, the content is also null or empty.\n\t// At the same time callout shows fade-out animation and do not disappear immediately.\n\t// Saving last visible content to show it while animating on close.\n\tconst savedContent = useRef<MrlCalloutContent>();\n\tif (props.show) {\n\t\tsavedContent.current = {\n\t\t\talignment: props.alignment,\n\t\t\tdescription: props.description,\n\t\t\teyebrow: props.eyebrow,\n\t\t\timage: props.image,\n\t\t\tkind: props.kind,\n\t\t\ttitle: props.title\n\t\t};\n\t}\n\n\tconst {\n\t\tariaControls,\n\t\talignment = 'center',\n\t\tchildren,\n\t\tdescription,\n\t\tdisableClickOutside = true,\n\t\tdisableFocusTrap = true,\n\t\teyebrow,\n\t\thasCloseButton = true,\n\t\timage,\n\t\tkind = 'primary',\n\t\tonOpen,\n\t\tonClose,\n\t\tpoint = true,\n\t\tposition = 'bottom',\n\t\tprimaryCta,\n\t\tsecondaryCta,\n\t\tshow = true,\n\t\tspacing,\n\t\ttitle,\n\t\t// pulled out of `rest` so the nested MrlPopover doesn't emit a second, less\n\t\t// specific event for the same callout.\n\t\teventId,\n\t\t...rest\n\t} = props.show ? props : { ...props, ...savedContent.current };\n\n\tconst trackInteraction = useMrlTrackInteraction('MrlCallout', eventId);\n\n\t// the callout's visibility is consumer-controlled through `show`, so open/close\n\t// is emitted from that rather than from the popover's internal state.\n\tconst wasShownRef = React.useRef(false);\n\n\tReact.useEffect(() => {\n\t\tif (wasShownRef.current === show) return;\n\n\t\twasShownRef.current = show;\n\n\t\ttrackInteraction({ action: show ? 'open' : 'close', variant: kind });\n\t}, [show, kind, trackInteraction]);\n\n\tif (React.isValidElement(children) && children.type === React.Fragment) {\n\t\tthrow new Error(\n\t\t\t'MrlCallout accepts a single child and does not accept a React.Fragment as a child.'\n\t\t);\n\t}\n\n\tconst calloutId = React.useMemo(() => getUniqueId('callout-append'), []);\n\tconst triggerRef = React.useRef<HTMLElement | null>(null);\n\n\tconst childElement = React.useMemo(() => {\n\t\treturn React.Children.map(children, (child) => {\n\t\t\treturn React.cloneElement(child, {\n\t\t\t\t...child.props,\n\t\t\t\t/** if the callout is tied to an interactive element we need to ensure that it has role=\"button\" */\n\t\t\t\t...(child.type !== 'button' && { role: 'button' }),\n\t\t\t\t'aria-controls': ariaControls,\n\t\t\t\t'aria-expanded': show,\n\t\t\t\tid: calloutId\n\t\t\t});\n\t\t});\n\t}, [calloutId, children, show, ariaControls]);\n\n\t// Setting trigger ref to the element with the calloutId (set above in the childElement useMemo)\n\t//\n\t// We are using querySelector to set the triggerRef instead of assigning a ref directly in childElement because\n\t// a child element may already have a ref assigned to it and we don't want to override it.\n\tReact.useEffect(() => {\n\t\ttriggerRef.current = document.querySelector(`#${calloutId}`) as HTMLElement;\n\t}, [calloutId]);\n\n\tconst popoverKind = kind === 'primary' ? 'inverse' : 'primary';\n\tconst primaryCtaKind = kind === 'primary' ? 'inverse' : 'secondary';\n\tconst secondaryCtaKind = kind === 'primary' ? 'ghost-inverse' : 'ghost';\n\n\treturn (\n\t\t<>\n\t\t\t{childElement}\n\t\t\t{triggerRef && (\n\t\t\t\t<MrlPopover\n\t\t\t\t\tactionState={{ actionType: 'click', isOpen: show }}\n\t\t\t\t\talignment={alignment}\n\t\t\t\t\tclassName={styles['MrlCallout']}\n\t\t\t\t\tdisableClickToOpen\n\t\t\t\t\tdisableClickOutside={disableClickOutside}\n\t\t\t\t\tdisableFocusTrap={disableFocusTrap}\n\t\t\t\t\thasCloseButton={hasCloseButton}\n\t\t\t\t\tkind={popoverKind}\n\t\t\t\t\tonClose={onClose}\n\t\t\t\t\tonOpen={onOpen}\n\t\t\t\t\tpoint={point}\n\t\t\t\t\tportalProps={{\n\t\t\t\t\t\tid: PORTAL_LAYERS.CALLOUT.name,\n\t\t\t\t\t\tlayer: PORTAL_LAYERS.CALLOUT\n\t\t\t\t\t}}\n\t\t\t\t\tposition={position}\n\t\t\t\t\tspacing={spacing}\n\t\t\t\t\ttriggerRef={triggerRef}\n\t\t\t\t\t{...rest}\n\t\t\t\t>\n\t\t\t\t\t<div className={styles['MrlCallout--content']}>\n\t\t\t\t\t\t{eyebrow && (\n\t\t\t\t\t\t\t<MrlText attrs={{ className: styles['MrlCallout--eyebrow'] }} text={eyebrow} />\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{title && (\n\t\t\t\t\t\t\t<MrlTextHeading className={styles['MrlCallout--title']} level=\"2\" text={title} />\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{description && (\n\t\t\t\t\t\t\t<div className={styles['MrlCallout--description']}>\n\t\t\t\t\t\t\t\t{typeof description === 'string' ? <MrlText text={description} /> : description}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{image && <div className={styles['MrlCallout--image']}>{image}</div>}\n\t\t\t\t\t\t{(primaryCta || secondaryCta) && (\n\t\t\t\t\t\t\t<div className={styles['MrlCallout--footer']}>\n\t\t\t\t\t\t\t\t{secondaryCta && (\n\t\t\t\t\t\t\t\t\t<MrlButton\n\t\t\t\t\t\t\t\t\t\tdata-qa={secondaryCta.dataQa}\n\t\t\t\t\t\t\t\t\t\tkind={secondaryCtaKind}\n\t\t\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\t\t\ttrackInteraction({\n\t\t\t\t\t\t\t\t\t\t\t\taction: 'click',\n\t\t\t\t\t\t\t\t\t\t\t\tmetadata: { cta: 'secondary' },\n\t\t\t\t\t\t\t\t\t\t\t\tvariant: kind\n\t\t\t\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\t\t\t\tsecondaryCta.onClick();\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\ttext={secondaryCta.text}\n\t\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{primaryCta && (\n\t\t\t\t\t\t\t\t\t<MrlButton\n\t\t\t\t\t\t\t\t\t\tdata-qa={primaryCta.dataQa}\n\t\t\t\t\t\t\t\t\t\tkind={primaryCtaKind}\n\t\t\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\t\t\ttrackInteraction({\n\t\t\t\t\t\t\t\t\t\t\t\taction: 'click',\n\t\t\t\t\t\t\t\t\t\t\t\tmetadata: { cta: 'primary' },\n\t\t\t\t\t\t\t\t\t\t\t\tvariant: kind\n\t\t\t\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\t\t\t\tprimaryCta.onClick();\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\ttext={primaryCta.text}\n\t\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t</MrlPopover>\n\t\t\t)}\n\t\t</>\n\t);\n};\n"],"names":["MrlCallout","props","savedContent","useRef","show","current","alignment","description","eyebrow","image","kind","title","_ref","_objectSpread","ariaControls","_ref$alignment","children","_ref$disableClickOuts","disableClickOutside","_ref$disableFocusTrap","disableFocusTrap","_ref$hasCloseButton","hasCloseButton","_ref$kind","onOpen","onClose","_ref$point","point","_ref$position","position","primaryCta","secondaryCta","_ref$show","spacing","eventId","rest","_objectWithoutProperties","_excluded","trackInteraction","useMrlTrackInteraction","wasShownRef","React","useEffect","action","variant","isValidElement","type","Fragment","Error","calloutId","useMemo","getUniqueId","triggerRef","childElement","Children","map","child","cloneElement","role","id","document","querySelector","concat","popoverKind","primaryCtaKind","secondaryCtaKind","createElement","MrlPopover","_extends","actionState","actionType","isOpen","className","styles","disableClickToOpen","portalProps","PORTAL_LAYERS","CALLOUT","name","layer","MrlText","attrs","text","MrlTextHeading","level","MrlButton","dataQa","onClick","metadata","cta","size"],"mappings":";;;;;;;;;;;;;AAqDA;AACA;AACA;AACA;AACA;AACA;AACO,IAAMA,UAAU,GAAIC,KAAsB,IAAyB;AACzE;AACA;AACA;AACA,EAAA,IAAMC,YAAY,GAAGC,MAAM,EAAqB;EAChD,IAAIF,KAAK,CAACG,IAAI,EAAE;IACfF,YAAY,CAACG,OAAO,GAAG;MACtBC,SAAS,EAAEL,KAAK,CAACK,SAAS;MAC1BC,WAAW,EAAEN,KAAK,CAACM,WAAW;MAC9BC,OAAO,EAAEP,KAAK,CAACO,OAAO;MACtBC,KAAK,EAAER,KAAK,CAACQ,KAAK;MAClBC,IAAI,EAAET,KAAK,CAACS,IAAI;MAChBC,KAAK,EAAEV,KAAK,CAACU;KACb;AACF,EAAA;AAEA,EAAA,IAAAC,IAAA,GAwBIX,KAAK,CAACG,IAAI,GAAGH,KAAK,GAAAY,cAAA,CAAAA,cAAA,CAAA,EAAA,EAAQZ,KAAK,GAAKC,YAAY,CAACG,OAAO,CAAE;IAvB7DS,YAAY,GAAAF,IAAA,CAAZE,YAAY;IAAAC,cAAA,GAAAH,IAAA,CACZN,SAAS;AAATA,IAAAA,SAAS,GAAAS,cAAA,KAAA,MAAA,GAAG,QAAQ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hE,KAAW,CAAC,EACnE,CAACqB,UAAU,IAAIC,YAAY,kBAC3BU,KAAA,CAAAyB,aAAA,CAAA,KAAA,EAAA;IAAKM,SAAS,EAAEC,MAAM,CAAC,oBAAoB;AAAE,GAAA,EAC3C1C,YAAY,iBACZU,KAAA,CAAAyB,aAAA,CAACmB,SAAS,EAAA;IACT,SAAA,EAAStD,YAAY,CAACuD,MAAO;AAC7B5E,IAAAA,IAAI,EAAEuD,gBAAiB;IACvBsB,OAAO,EAAEA,MAAM;AACdjD,MAAAA,gBAAgB,CAAC;AAChBK,QAAAA,MAAM,EAAE,OAAO;AACf6C,QAAAA,QAAQ,EAAE;AAAEC,UAAAA,GAAG,EAAE;SAAa;AAC9B7C,QAAAA,OAAO,EAAElC;AACV,OAAC,CAAC;MAEFqB,YAAY,CAACwD,OAAO,EAAE;IACvB,CAAE;IACFL,IAAI,EAAEnD,YAAY,CAACmD,IAAK;AACxBQ,IAAAA,IAAI,EAAC;GACL,CACD,EACA5D,UAAU,iBACVW,KAAA,CAAAyB,aAAA,CAACmB,SAAS,EAAA;IACT,SAAA,EAASvD,UAAU,CAACwD,MAAO;AAC3B5E,IAAAA,IAAI,EAAEsD,cAAe;IACrBuB,OAAO,EAAEA,MAAM;AACdjD,MAAAA,gBAAgB,CAAC;AAChBK,QAAAA,MAAM,EAAE,OAAO;AACf6C,QAAAA,QAAQ,EAAE;AAAEC,UAAAA,GAAG,EAAE;SAAW;AAC5B7C,QAAAA,OAAO,EAAElC;AACV,OAAC,CAAC;MAEFoB,UAAU,CAACyD,OAAO,EAAE;IACrB,CAAE;IACFL,IAAI,EAAEpD,UAAU,CAACoD,IAAK;AACtBQ,IAAAA,IAAI,EAAC;AAAO,GACZ,CAEE,CAEF,CACM,CAEZ,CAAC;AAEL;;;;"}
1
+ {"version":3,"file":"MrlCallout.js","sources":["../../../../../src/components/callout/MrlCallout/MrlCallout.tsx"],"sourcesContent":["import * as React from 'react';\nimport { MrlPopover, MrlPopoverProps } from '../../popover';\nimport { MrlText, MrlTextHeading } from '../../text';\nimport styles from './MrlCallout.module.scss';\nimport { MrlButton } from '../../button';\nimport { getUniqueId } from '../../../utils';\nimport { PORTAL_LAYERS } from '../../../utils/layers';\nimport { useRef } from 'react';\nimport { useMrlTrackInteraction } from '../../../hooks/useMrlAnalytics';\n\nexport type MrlCalloutPopoverProps = Omit<\n\tMrlPopoverProps,\n\t'children' | 'actionState' | 'isSubMenu' | 'triggerRef' | 'kind'\n>;\n\ninterface MrlCalloutCTA {\n\tonClick: () => void;\n\tdataQa?: string;\n\ttext: string;\n}\n\nexport interface MrlCalloutProps extends MrlCalloutPopoverProps {\n\t/** a unique id that binds the callout content and the trigger for assistive technologies */\n\tariaControls?: string;\n\tautoFocus?: boolean;\n\tchildren: React.ReactElement;\n\tdisableClickOutside?: boolean;\n\tdescription?: string | JSX.Element;\n\teyebrow?: string;\n\tid?: string;\n\timage?: JSX.Element;\n\trenderWithPortal?: boolean;\n\tshow: boolean;\n\ttitle?: string;\n\tprimaryCta?: MrlCalloutCTA;\n\tsecondaryCta?: MrlCalloutCTA;\n\t/**\n\t * Enables interaction tracking for this callout. Provide a stable, non-PII id\n\t * (e.g. 'ai-onboarding-callout'). When omitted, the callout emits no analytics.\n\t *\n\t * Note: title, eyebrow and description text are never emitted.\n\t */\n\teventId?: string;\n}\n\ntype MrlCalloutContent = Pick<\n\tMrlCalloutProps,\n\t'alignment' | 'description' | 'eyebrow' | 'image' | 'title'\n>;\n\n/**\n * MrlCallout component.\n *\n * @param props - The props.\n * @returns {React.ReactElement} The MrlCallout component.\n */\nexport const MrlCallout = (props: MrlCalloutProps): React.ReactElement => {\n\t// In some cases when `show` is false, the content is also null or empty.\n\t// At the same time callout shows fade-out animation and do not disappear immediately.\n\t// Saving last visible content to show it while animating on close.\n\tconst savedContent = useRef<MrlCalloutContent>();\n\tif (props.show) {\n\t\tsavedContent.current = {\n\t\t\talignment: props.alignment,\n\t\t\tdescription: props.description,\n\t\t\teyebrow: props.eyebrow,\n\t\t\timage: props.image,\n\t\t\ttitle: props.title\n\t\t};\n\t}\n\n\tconst {\n\t\tariaControls,\n\t\talignment = 'center',\n\t\tchildren,\n\t\tdescription,\n\t\tdisableClickOutside = true,\n\t\tdisableFocusTrap = true,\n\t\teyebrow,\n\t\thasCloseButton = true,\n\t\timage,\n\t\tonOpen,\n\t\tonClose,\n\t\tpoint = true,\n\t\tposition = 'bottom',\n\t\tprimaryCta,\n\t\tsecondaryCta,\n\t\tshow = true,\n\t\tspacing,\n\t\ttitle,\n\t\t// pulled out of `rest` so the nested MrlPopover doesn't emit a second, less\n\t\t// specific event for the same callout.\n\t\teventId,\n\t\t...rest\n\t} = props.show ? props : { ...props, ...savedContent.current };\n\n\tconst trackInteraction = useMrlTrackInteraction('MrlCallout', eventId);\n\n\t// the callout's visibility is consumer-controlled through `show`, so open/close\n\t// is emitted from that rather than from the popover's internal state.\n\tconst wasShownRef = React.useRef(false);\n\n\tReact.useEffect(() => {\n\t\tif (wasShownRef.current === show) return;\n\n\t\twasShownRef.current = show;\n\n\t\ttrackInteraction({ action: show ? 'open' : 'close' });\n\t}, [show, trackInteraction]);\n\n\tif (React.isValidElement(children) && children.type === React.Fragment) {\n\t\tthrow new Error(\n\t\t\t'MrlCallout accepts a single child and does not accept a React.Fragment as a child.'\n\t\t);\n\t}\n\n\tconst calloutId = React.useMemo(() => getUniqueId('callout-append'), []);\n\tconst triggerRef = React.useRef<HTMLElement | null>(null);\n\n\tconst childElement = React.useMemo(() => {\n\t\treturn React.Children.map(children, (child) => {\n\t\t\treturn React.cloneElement(child, {\n\t\t\t\t...child.props,\n\t\t\t\t/** if the callout is tied to an interactive element we need to ensure that it has role=\"button\" */\n\t\t\t\t...(child.type !== 'button' && { role: 'button' }),\n\t\t\t\t'aria-controls': ariaControls,\n\t\t\t\t'aria-expanded': show,\n\t\t\t\tid: calloutId\n\t\t\t});\n\t\t});\n\t}, [calloutId, children, show, ariaControls]);\n\n\t// Setting trigger ref to the element with the calloutId (set above in the childElement useMemo)\n\t//\n\t// We are using querySelector to set the triggerRef instead of assigning a ref directly in childElement because\n\t// a child element may already have a ref assigned to it and we don't want to override it.\n\tReact.useEffect(() => {\n\t\ttriggerRef.current = document.querySelector(`#${calloutId}`) as HTMLElement;\n\t}, [calloutId]);\n\n\treturn (\n\t\t<>\n\t\t\t{childElement}\n\t\t\t{triggerRef && (\n\t\t\t\t<MrlPopover\n\t\t\t\t\tactionState={{ actionType: 'click', isOpen: show }}\n\t\t\t\t\talignment={alignment}\n\t\t\t\t\tclassName={styles['MrlCallout']}\n\t\t\t\t\tdisableClickToOpen\n\t\t\t\t\tdisableClickOutside={disableClickOutside}\n\t\t\t\t\tdisableFocusTrap={disableFocusTrap}\n\t\t\t\t\thasCloseButton={hasCloseButton}\n\t\t\t\t\tkind=\"inverse\"\n\t\t\t\t\tonClose={onClose}\n\t\t\t\t\tonOpen={onOpen}\n\t\t\t\t\tpoint={point}\n\t\t\t\t\tportalProps={{\n\t\t\t\t\t\tid: PORTAL_LAYERS.CALLOUT.name,\n\t\t\t\t\t\tlayer: PORTAL_LAYERS.CALLOUT\n\t\t\t\t\t}}\n\t\t\t\t\tposition={position}\n\t\t\t\t\tspacing={spacing}\n\t\t\t\t\ttriggerRef={triggerRef}\n\t\t\t\t\t{...rest}\n\t\t\t\t>\n\t\t\t\t\t<div className={styles['MrlCallout--content']}>\n\t\t\t\t\t\t{eyebrow && (\n\t\t\t\t\t\t\t<MrlText attrs={{ className: styles['MrlCallout--eyebrow'] }} text={eyebrow} />\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{title && (\n\t\t\t\t\t\t\t<MrlTextHeading className={styles['MrlCallout--title']} level=\"2\" text={title} />\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{description && (\n\t\t\t\t\t\t\t<div className={styles['MrlCallout--description']}>\n\t\t\t\t\t\t\t\t{typeof description === 'string' ? <MrlText text={description} /> : description}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t\t{image && <div className={styles['MrlCallout--image']}>{image}</div>}\n\t\t\t\t\t\t{(primaryCta || secondaryCta) && (\n\t\t\t\t\t\t\t<div className={styles['MrlCallout--footer']}>\n\t\t\t\t\t\t\t\t{secondaryCta && (\n\t\t\t\t\t\t\t\t\t<MrlButton\n\t\t\t\t\t\t\t\t\t\tdata-qa={secondaryCta.dataQa}\n\t\t\t\t\t\t\t\t\t\tkind=\"ghost-inverse\"\n\t\t\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\t\t\ttrackInteraction({\n\t\t\t\t\t\t\t\t\t\t\t\taction: 'click',\n\t\t\t\t\t\t\t\t\t\t\t\tmetadata: { cta: 'secondary' }\n\t\t\t\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\t\t\t\tsecondaryCta.onClick();\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\ttext={secondaryCta.text}\n\t\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t\t{primaryCta && (\n\t\t\t\t\t\t\t\t\t<MrlButton\n\t\t\t\t\t\t\t\t\t\tdata-qa={primaryCta.dataQa}\n\t\t\t\t\t\t\t\t\t\tkind=\"inverse\"\n\t\t\t\t\t\t\t\t\t\tonClick={() => {\n\t\t\t\t\t\t\t\t\t\t\ttrackInteraction({\n\t\t\t\t\t\t\t\t\t\t\t\taction: 'click',\n\t\t\t\t\t\t\t\t\t\t\t\tmetadata: { cta: 'primary' }\n\t\t\t\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\t\t\t\tprimaryCta.onClick();\n\t\t\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\t\t\ttext={primaryCta.text}\n\t\t\t\t\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t</MrlPopover>\n\t\t\t)}\n\t\t</>\n\t);\n};\n"],"names":["MrlCallout","props","savedContent","useRef","show","current","alignment","description","eyebrow","image","title","_ref","_objectSpread","ariaControls","_ref$alignment","children","_ref$disableClickOuts","disableClickOutside","_ref$disableFocusTrap","disableFocusTrap","_ref$hasCloseButton","hasCloseButton","onOpen","onClose","_ref$point","point","_ref$position","position","primaryCta","secondaryCta","_ref$show","spacing","eventId","rest","_objectWithoutProperties","_excluded","trackInteraction","useMrlTrackInteraction","wasShownRef","React","useEffect","action","isValidElement","type","Fragment","Error","calloutId","useMemo","getUniqueId","triggerRef","childElement","Children","map","child","cloneElement","role","id","document","querySelector","concat","createElement","MrlPopover","_extends","actionState","actionType","isOpen","className","styles","disableClickToOpen","kind","portalProps","PORTAL_LAYERS","CALLOUT","name","layer","MrlText","attrs","text","MrlTextHeading","level","MrlButton","dataQa","onClick","metadata","cta","size"],"mappings":";;;;;;;;;;;;;AAkDA;AACA;AACA;AACA;AACA;AACA;AACO,IAAMA,UAAU,GAAIC,KAAsB,IAAyB;AACzE;AACA;AACA;AACA,EAAA,IAAMC,YAAY,GAAGC,MAAM,EAAqB;EAChD,IAAIF,KAAK,CAACG,IAAI,EAAE;IACfF,YAAY,CAACG,OAAO,GAAG;MACtBC,SAAS,EAAEL,KAAK,CAACK,SAAS;MAC1BC,WAAW,EAAEN,KAAK,CAACM,WAAW;MAC9BC,OAAO,EAAEP,KAAK,CAACO,OAAO;MACtBC,KAAK,EAAER,KAAK,CAACQ,KAAK;MAClBC,KAAK,EAAET,KAAK,CAACS;KACb;AACF,EAAA;AAEA,EAAA,IAAAC,IAAA,GAuBIV,KAAK,CAACG,IAAI,GAAGH,KAAK,GAAAW,cAAA,CAAAA,cAAA,CAAA,EAAA,EAAQX,KAAK,GAAKC,YAAY,CAACG,OAAO,CAAE;IAtB7DQ,YAAY,GAAAF,IAAA,CAAZE,YAAY;IAAA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AAO,EAAEA,MAAM;AACd9C,MAAAA,gBAAgB,CAAC;AAChBK,QAAAA,MAAM,EAAE,OAAO;AACf0C,QAAAA,QAAQ,EAAE;AAAEC,UAAAA,GAAG,EAAE;AAAY;AAC9B,OAAC,CAAC;MAEFvD,YAAY,CAACqD,OAAO,EAAE;IACvB,CAAE;IACFL,IAAI,EAAEhD,YAAY,CAACgD,IAAK;AACxBQ,IAAAA,IAAI,EAAC;GACL,CACD,EACAzD,UAAU,iBACVW,KAAA,CAAAqB,aAAA,CAACoB,SAAS,EAAA;IACT,SAAA,EAASpD,UAAU,CAACqD,MAAO;AAC3BZ,IAAAA,IAAI,EAAC,SAAS;IACda,OAAO,EAAEA,MAAM;AACd9C,MAAAA,gBAAgB,CAAC;AAChBK,QAAAA,MAAM,EAAE,OAAO;AACf0C,QAAAA,QAAQ,EAAE;AAAEC,UAAAA,GAAG,EAAE;AAAU;AAC5B,OAAC,CAAC;MAEFxD,UAAU,CAACsD,OAAO,EAAE;IACrB,CAAE;IACFL,IAAI,EAAEjD,UAAU,CAACiD,IAAK;AACtBQ,IAAAA,IAAI,EAAC;AAAO,GACZ,CAEE,CAEF,CACM,CAEZ,CAAC;AAEL;;;;"}
@@ -5,8 +5,8 @@ import styles from '../MrlEmpty.module.scss.js';
5
5
  import { MrlGrid } from '../../grid/MrlGrid/MrlGrid.js';
6
6
  import { MrlRow } from '../../grid/MrlRow/MrlRow.js';
7
7
  import { MrlCol } from '../../grid/MrlCol/MrlCol.js';
8
- import { MrlTextHeading } from '../../text/MrlTextHeading/MrlTextHeading.js';
9
8
  import { MrlText } from '../../text/MrlText/MrlText.js';
9
+ import { MrlTextHeading } from '../../text/MrlTextHeading/MrlTextHeading.js';
10
10
 
11
11
  var _excluded = ["graphic", "description", "action", "heading"];
12
12
  /**
@@ -3,10 +3,10 @@ import * as React from 'react';
3
3
  import classnames from 'classnames';
4
4
  import { check, minus } from '@muraldevkit/ds-icons';
5
5
  import { checkboxDefaults } from '../../constants.js';
6
+ import { MrlSvg } from '../../../svg/MrlSvg/MrlSvg.js';
6
7
  import styles from './MrlCheckboxStandalone.module.scss.js';
7
8
  import { useMrlTrackInteraction } from '../../../../hooks/useMrlAnalytics/useMrlAnalytics.js';
8
9
  import { getUniqueId, setAttributes } from '../../../../utils/setAttributes/setAttributes.js';
9
- import { MrlSvg } from '../../../svg/MrlSvg/MrlSvg.js';
10
10
 
11
11
  var _excluded = ["attrs", "state", "selected", "eventId"];
12
12
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"MrlCheckboxStandalone.js","sources":["../../../../../../src/components/form/checkbox/MrlCheckboxStandalone/MrlCheckboxStandalone.tsx"],"sourcesContent":["import * as React from 'react';\nimport classnames from 'classnames';\nimport { AttrsObject, getUniqueId, setAttributes } from '../../../../utils';\nimport { check, minus } from '@muraldevkit/ds-icons';\nimport { checkboxDefaults, CheckboxSelected, CheckboxStates } from '../../constants';\nimport { MrlSvg } from '../../../';\nimport { useMrlTrackInteraction } from '../../../../hooks/useMrlAnalytics';\n\nimport styles from './MrlCheckboxStandalone.module.scss';\nimport './MrlCheckboxStandalone.global.scss';\n\ninterface MrlCheckboxStandaloneProps {\n\t/** Applies additional HTML attributes to the checkbox element */\n\tattrs?: AttrsObject;\n\t/** The current state of the checkbox input based on user interactions or permissions */\n\tstate?: CheckboxStates;\n\t/** Sets what selection state the checkbox is in. */\n\tselected?: CheckboxSelected;\n\t/**\n\t * Enables interaction tracking for this checkbox. Provide a stable, non-PII id\n\t * (e.g. 'export-include-comments'). When omitted, the checkbox emits no analytics.\n\t */\n\teventId?: string;\n}\n\n/**\n * Input that allows the user to select one or more options from a provided list.\n * Note, this component does not provide out of the box accessibility for ensuring\n * an associated label and must be manually setup during adoption.\n * @param {MrlCheckboxStandaloneProps} props - the component props\n * @returns a checkbox element\n */\nexport function MrlCheckboxStandalone({\n\tattrs = {},\n\tstate = checkboxDefaults.state,\n\tselected = checkboxDefaults.selected,\n\teventId,\n\t...rest\n}: MrlCheckboxStandaloneProps): JSX.Element {\n\tconst trackInteraction = useMrlTrackInteraction('MrlCheckboxStandalone', eventId);\n\t// Use attrs.id if the developer passes in a custom id\n\t// but we need to ensure one exists for accessibility\n\tconst checkboxIdRef = React.useRef<string>(attrs.id || getUniqueId('mrl-checkbox'));\n\tconst inputRef = React.useRef<HTMLInputElement>(null);\n\n\tif (!(attrs.id || attrs['aria-labelledby'])) {\n\t\tconsole.warn(\n\t\t\t'Warning: Mural Standalone Checkboxes must have either an id or' +\n\t\t\t\t' aria-labelledby attribute for proper accessibility.'\n\t\t);\n\t}\n\n\t// We need to use the ref to set indetermiant attr\n\t// due to not being an intrinsic HTML attr\n\tReact.useEffect(() => {\n\t\tconst indeterminate = selected === 'indeterminate';\n\n\t\tif (inputRef.current) {\n\t\t\tinputRef.current.indeterminate = indeterminate;\n\t\t}\n\t}, [selected]);\n\n\tdelete attrs.class;\n\tdelete attrs.className;\n\n\tconst attributes = setAttributes(attrs);\n\n\t// the consumer's handler arrives through `attrs`, so wrap it here rather than\n\t// relying on a top-level onChange prop.\n\tconst consumerOnChange = attributes.onChange as\n\t\t| ((e: React.ChangeEvent<HTMLInputElement>) => void)\n\t\t| undefined;\n\n\t/**\n\t * Handle change events\n\t *\n\t * @param {React.ChangeEvent<HTMLInputElement>} e - change event\n\t */\n\tconst handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n\t\ttrackInteraction({ action: 'change', metadata: { selected: e.target.checked } });\n\n\t\tconsumerOnChange?.(e);\n\t};\n\n\treturn (\n\t\t<div className={classnames(styles['MrlCheckboxStandalone'], 'MrlCheckboxStandalone')}>\n\t\t\t<span className=\"mrl-u-focus-wrapper\">\n\t\t\t\t<input\n\t\t\t\t\t{...rest}\n\t\t\t\t\t{...attributes}\n\t\t\t\t\taria-invalid={state === 'error'}\n\t\t\t\t\tchecked={selected === 'checked'}\n\t\t\t\t\tdisabled={state === 'disabled'}\n\t\t\t\t\tid={checkboxIdRef.current}\n\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\tref={inputRef}\n\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\tclassName={classnames(\n\t\t\t\t\t\tstyles['MrlCheckboxStandalone-input'],\n\t\t\t\t\t\t'MrlCheckboxStandalone-input'\n\t\t\t\t\t)}\n\t\t\t\t/>\n\t\t\t\t<span className=\"mrl-u-focus-indicator\"></span>\n\t\t\t\t<span\n\t\t\t\t\tclassName={classnames(\n\t\t\t\t\t\tstyles['MrlCheckboxStandalone-inputDisplay'],\n\t\t\t\t\t\t'MrlCheckboxStandalone-inputDisplay'\n\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t<MrlSvg\n\t\t\t\t\t\tsvg={selected !== 'indeterminate' ? check : minus}\n\t\t\t\t\t\tsize=\"auto\"\n\t\t\t\t\t\tclassName={styles['MrlCheckboxStandalone-inputDisplay-icon']}\n\t\t\t\t\t/>\n\t\t\t\t</span>\n\t\t\t</span>\n\t\t</div>\n\t);\n}\n"],"names":["MrlCheckboxStandalone","_ref","_ref$attrs","attrs","_ref$state","state","checkboxDefaults","_ref$selected","selected","eventId","rest","_objectWithoutProperties","_excluded","trackInteraction","useMrlTrackInteraction","checkboxIdRef","React","useRef","id","getUniqueId","inputRef","console","warn","useEffect","indeterminate","current","class","className","attributes","setAttributes","consumerOnChange","onChange","handleChange","e","action","metadata","target","checked","createElement","classnames","styles","_extends","disabled","ref","type","MrlSvg","svg","check","minus","size"],"mappings":";;;;;;;;;;;AAyBA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,qBAAqBA,CAAAC,IAAA,EAMO;AAAA,EAAA,IAAAC,UAAA,GAAAD,IAAA,CAL3CE,KAAK;AAALA,IAAAA,KAAK,GAAAD,UAAA,KAAA,MAAA,GAAG,EAAE,GAAAA,UAAA;IAAAE,UAAA,GAAAH,IAAA,CACVI,KAAK;AAALA,IAAAA,KAAK,GAAAD,UAAA,KAAA,MAAA,GAAGE,gBAAgB,CAACD,KAAK,GAAAD,UAAA;IAAAG,aAAA,G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AAGC,KAAM;AAClDC,IAAAA,IAAI,EAAC,MAAM;IACXtB,SAAS,EAAEa,MAAM,CAAC,yCAAyC;GAC3D,CACI,CACD,CACF,CAAC;AAER;;;;"}
1
+ {"version":3,"file":"MrlCheckboxStandalone.js","sources":["../../../../../../src/components/form/checkbox/MrlCheckboxStandalone/MrlCheckboxStandalone.tsx"],"sourcesContent":["import * as React from 'react';\nimport classnames from 'classnames';\nimport { AttrsObject, getUniqueId, setAttributes } from '../../../../utils';\nimport { check, minus } from '@muraldevkit/ds-icons';\nimport { checkboxDefaults, CheckboxSelected, CheckboxStates } from '../../constants';\nimport { MrlSvg } from '../../../svg/MrlSvg/MrlSvg';\nimport { useMrlTrackInteraction } from '../../../../hooks/useMrlAnalytics';\n\nimport styles from './MrlCheckboxStandalone.module.scss';\nimport './MrlCheckboxStandalone.global.scss';\n\ninterface MrlCheckboxStandaloneProps {\n\t/** Applies additional HTML attributes to the checkbox element */\n\tattrs?: AttrsObject;\n\t/** The current state of the checkbox input based on user interactions or permissions */\n\tstate?: CheckboxStates;\n\t/** Sets what selection state the checkbox is in. */\n\tselected?: CheckboxSelected;\n\t/**\n\t * Enables interaction tracking for this checkbox. Provide a stable, non-PII id\n\t * (e.g. 'export-include-comments'). When omitted, the checkbox emits no analytics.\n\t */\n\teventId?: string;\n}\n\n/**\n * Input that allows the user to select one or more options from a provided list.\n * Note, this component does not provide out of the box accessibility for ensuring\n * an associated label and must be manually setup during adoption.\n * @param {MrlCheckboxStandaloneProps} props - the component props\n * @returns a checkbox element\n */\nexport function MrlCheckboxStandalone({\n\tattrs = {},\n\tstate = checkboxDefaults.state,\n\tselected = checkboxDefaults.selected,\n\teventId,\n\t...rest\n}: MrlCheckboxStandaloneProps): JSX.Element {\n\tconst trackInteraction = useMrlTrackInteraction('MrlCheckboxStandalone', eventId);\n\t// Use attrs.id if the developer passes in a custom id\n\t// but we need to ensure one exists for accessibility\n\tconst checkboxIdRef = React.useRef<string>(attrs.id || getUniqueId('mrl-checkbox'));\n\tconst inputRef = React.useRef<HTMLInputElement>(null);\n\n\tif (!(attrs.id || attrs['aria-labelledby'])) {\n\t\tconsole.warn(\n\t\t\t'Warning: Mural Standalone Checkboxes must have either an id or' +\n\t\t\t\t' aria-labelledby attribute for proper accessibility.'\n\t\t);\n\t}\n\n\t// We need to use the ref to set indetermiant attr\n\t// due to not being an intrinsic HTML attr\n\tReact.useEffect(() => {\n\t\tconst indeterminate = selected === 'indeterminate';\n\n\t\tif (inputRef.current) {\n\t\t\tinputRef.current.indeterminate = indeterminate;\n\t\t}\n\t}, [selected]);\n\n\tdelete attrs.class;\n\tdelete attrs.className;\n\n\tconst attributes = setAttributes(attrs);\n\n\t// the consumer's handler arrives through `attrs`, so wrap it here rather than\n\t// relying on a top-level onChange prop.\n\tconst consumerOnChange = attributes.onChange as\n\t\t| ((e: React.ChangeEvent<HTMLInputElement>) => void)\n\t\t| undefined;\n\n\t/**\n\t * Handle change events\n\t *\n\t * @param {React.ChangeEvent<HTMLInputElement>} e - change event\n\t */\n\tconst handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {\n\t\ttrackInteraction({ action: 'change', metadata: { selected: e.target.checked } });\n\n\t\tconsumerOnChange?.(e);\n\t};\n\n\treturn (\n\t\t<div className={classnames(styles['MrlCheckboxStandalone'], 'MrlCheckboxStandalone')}>\n\t\t\t<span className=\"mrl-u-focus-wrapper\">\n\t\t\t\t<input\n\t\t\t\t\t{...rest}\n\t\t\t\t\t{...attributes}\n\t\t\t\t\taria-invalid={state === 'error'}\n\t\t\t\t\tchecked={selected === 'checked'}\n\t\t\t\t\tdisabled={state === 'disabled'}\n\t\t\t\t\tid={checkboxIdRef.current}\n\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\tref={inputRef}\n\t\t\t\t\ttype=\"checkbox\"\n\t\t\t\t\tclassName={classnames(\n\t\t\t\t\t\tstyles['MrlCheckboxStandalone-input'],\n\t\t\t\t\t\t'MrlCheckboxStandalone-input'\n\t\t\t\t\t)}\n\t\t\t\t/>\n\t\t\t\t<span className=\"mrl-u-focus-indicator\"></span>\n\t\t\t\t<span\n\t\t\t\t\tclassName={classnames(\n\t\t\t\t\t\tstyles['MrlCheckboxStandalone-inputDisplay'],\n\t\t\t\t\t\t'MrlCheckboxStandalone-inputDisplay'\n\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t<MrlSvg\n\t\t\t\t\t\tsvg={selected !== 'indeterminate' ? check : minus}\n\t\t\t\t\t\tsize=\"auto\"\n\t\t\t\t\t\tclassName={styles['MrlCheckboxStandalone-inputDisplay-icon']}\n\t\t\t\t\t/>\n\t\t\t\t</span>\n\t\t\t</span>\n\t\t</div>\n\t);\n}\n"],"names":["MrlCheckboxStandalone","_ref","_ref$attrs","attrs","_ref$state","state","checkboxDefaults","_ref$selected","selected","eventId","rest","_objectWithoutProperties","_excluded","trackInteraction","useMrlTrackInteraction","checkboxIdRef","React","useRef","id","getUniqueId","inputRef","console","warn","useEffect","indeterminate","current","class","className","attributes","setAttributes","consumerOnChange","onChange","handleChange","e","action","metadata","target","checked","createElement","classnames","styles","_extends","disabled","ref","type","MrlSvg","svg","check","minus","size"],"mappings":";;;;;;;;;;;AAyBA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,qBAAqBA,CAAAC,IAAA,EAMO;AAAA,EAAA,IAAAC,UAAA,GAAAD,IAAA,CAL3CE,KAAK;AAALA,IAAAA,KAAK,GAAAD,UAAA,KAAA,MAAA,GAAG,EAAE,GAAAA,UAAA;IAAAE,UAAA,GAAAH,IAAA,CACVI,KAAK;AAALA,IAAAA,KAAK,GAAAD,UAAA,KAAA,MAAA,GAAGE,gBAAgB,CAACD,KAAK,GAAAD,UAAA;IAAAG,aAAA,GAAAN,IAAA,CAC9BO,QAAQ;AAARA,IAAAA,QAAQ,GAAAD,aAAA,KAAA,MAAA,GAAGD,gBAAgB,CAACE,QAAQ,GAAAD,aAAA;IACpCE,OAAO,GAAAR,IAAA,CAAPQ,OAAO;AACJC,I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as _objectWithoutProperties, extends as _extends } from '../../../../_virtual/_rollupPluginBabelHelpers.js';
2
2
  import * as React from 'react';
3
3
  import classnames from 'classnames';
4
- import styles from './MrlLabelWithDescription.module.scss.js';
5
- import { MrlLabel } from '../MrlLabel/MrlLabel.js';
6
4
  import { MrlText } from '../../../text/MrlText/MrlText.js';
5
+ import { MrlLabel } from '../MrlLabel/MrlLabel.js';
6
+ import styles from './MrlLabelWithDescription.module.scss.js';
7
7
 
8
8
  var _excluded = ["className", "description", "descriptionId", "isDisabled", "isIndeterminate", "isSelected", "hasMultilineLabel", "htmlFor", "icon", "label"];
9
9
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"MrlLabelWithDescription.js","sources":["../../../../../../src/components/form/label/MrlLabelWithDescription/MrlLabelWithDescription.tsx"],"sourcesContent":["import * as React from 'react';\nimport classnames from 'classnames';\nimport { MrlLabel, MrlText } from '../../../';\nimport { StaticIconConfig } from '../../constants';\n\nimport styles from './MrlLabelWithDescription.module.scss';\n\ninterface MrlLabelWithDescriptionProps {\n\t/** Additional class to add to the container of the label and description */\n\tclassName?: string;\n\t/** Description text or a custom component */\n\tdescription?: string | React.ReactNode;\n\t/** The id that's linked to the form element \"aria-describedby\" attribute */\n\tdescriptionId?: string;\n\t/** Disabled state */\n\tisDisabled?: boolean;\n\t/** Indeterminate state */\n\tisIndeterminate?: boolean;\n\t/** Selected state */\n\tisSelected?: boolean;\n\t/** Adjusts the styles of the label, icon, and description when the label is multiline */\n\thasMultilineLabel?: boolean;\n\t/** ID of the form elements so all users can understand the relationship between the two elements */\n\thtmlFor: string;\n\t/** Leading label icon */\n\ticon?: StaticIconConfig;\n\t/** The text to display as the label */\n\tlabel: string;\n}\n\n/**\n * Form control label that can render a label, an icon and description text\n *\n * @param {MrlLabelWithDescriptionProps} props - the component props\n * @returns a form control label with description\n */\nexport function MrlLabelWithDescription({\n\tclassName,\n\tdescription,\n\tdescriptionId,\n\tisDisabled,\n\tisIndeterminate,\n\tisSelected,\n\thasMultilineLabel,\n\thtmlFor,\n\ticon,\n\tlabel,\n\t...rest\n}: MrlLabelWithDescriptionProps): JSX.Element {\n\tconst allClasses = classnames(className, styles['MrlLabelWithDescription'], {\n\t\t[styles['mrl-is--disabled']]: isDisabled,\n\t\t[styles['mrl-is--selected']]: isSelected,\n\t\t[styles['mrl-is--indeterminate']]: isIndeterminate\n\t});\n\n\treturn (\n\t\t<div className={allClasses}>\n\t\t\t<MrlLabel\n\t\t\t\t{...rest}\n\t\t\t\ticon={icon !== undefined ? icon : undefined}\n\t\t\t\ttext={label}\n\t\t\t\tkind=\"inline\"\n\t\t\t\thtmlFor={htmlFor}\n\t\t\t\tclassName={classnames(\n\t\t\t\t\tstyles['MrlLabelWithDescription-label'],\n\t\t\t\t\t'MrlLabelWithDescription-label',\n\t\t\t\t\t{\n\t\t\t\t\t\t[styles['has-icon']]: typeof icon !== 'undefined',\n\t\t\t\t\t\t[styles['has-multiline-label']]: hasMultilineLabel\n\t\t\t\t\t}\n\t\t\t\t)}\n\t\t\t/>\n\t\t\t{description && (\n\t\t\t\t<div\n\t\t\t\t\tclassName={classnames(\n\t\t\t\t\t\tstyles['MrlLabelWithDescription-description'],\n\t\t\t\t\t\t'MrlLabelWithDescription-description',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t[styles['has-icon']]: typeof icon !== 'undefined',\n\t\t\t\t\t\t\t[styles['has-multiline-label']]: hasMultilineLabel\n\t\t\t\t\t\t}\n\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t{typeof description === 'string' && (\n\t\t\t\t\t\t<MrlText\n\t\t\t\t\t\t\tattrs={{\n\t\t\t\t\t\t\t\tclassName: styles['MrlLabelWithDescription-text'],\n\t\t\t\t\t\t\t\tid: descriptionId\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\ttext={description}\n\t\t\t\t\t\t\tsize=\"xsmall\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\t{React.isValidElement(description) && description}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n"],"names":["MrlLabelWithDescription","_ref","className","description","descriptionId","isDisabled","isIndeterminate","isSelected","hasMultilineLabel","htmlFor","icon","label","rest","_objectWithoutProperties","_excluded","allClasses","classnames","styles","React","createElement","MrlLabel","_extends","undefined","text","kind","MrlText","attrs","id","size","isValidElement"],"mappings":";;;;;;;;AA8BA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,uBAAuBA,CAAAC,IAAA,EAYO;AAAA,EAAA,IAX7CC,SAAS,GAAAD,IAAA,CAATC,SAAS;IACTC,WAAW,GAAAF,IAAA,CAAXE,WAAW;IACXC,aAAa,GAAAH,IAAA,CAAbG,aAAa;IACbC,UAAU,GAAAJ,IAAA,CAAVI,UAAU;IACVC,eAAe,GAAAL,IAAA,CAAfK,eAAe;IACfC,UAAU,GAAAN,IAAA,CAAVM,UAAU;IACVC,iBAAiB,GAAAP,IAAA,CAAjBO,iBAAiB;IACjBC,OAAO,GAAAR,IAAA,CAAPQ,OAAO;IACPC,IAAI,GAAAT,IAAA,CAAJS,IAAI;IACJC,KAAK,GAAAV,IAAA,CAALU,KAAK;AACFC,IAAAA,IAAI,GAAAC,wBAAA,CAAAZ,IAAA,EAAAa,SAAA,CAAA;EAEP,IAAMC,UAAU,GAAGC,UAAU,CAACd,SAAS,EAAEe,MAAM,CAAC,yBAAyB,CAAC,EAAE;AAC3E,IAAA,CAACA,MAAM,CAAC,kBAAkB,CAAC,GAAGZ,UAAU;AACxC,IAAA,CAACY,MAAM,CAAC,kBAAkB,CAAC,GAAGV,UAAU;AACxC,IAAA,CAACU,MAAM,CAAC,uBAAuB,CAAC,GAAGX;AACpC,GAAC,CAAC;EAEF,oBACCY,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;AAAKjB,IAAAA,SAAS,EAAEa;GAAW,eAC1BG,KAAA,CAAAC,aAAA,CAACC,QAAQ,EAAAC,QAAA,KACJT,IAAI,EAAA;AACRF,IAAAA,IAAI,EAAEA,IAAI,KAAKY,SAAS,GAAGZ,IAAI,GAAGY,SAAU;AAC5CC,IAAAA,IAAI,EAAEZ,KAAM;AACZa,IAAAA,IAAI,EAAC,QAAQ;AACbf,IAAAA,OAAO,EAAEA,OAAQ;IACjBP,SAAS,EAAEc,UAAU,CACpBC,MAAM,CAAC,+BAA+B,CAAC,EACvC,+BAA+B,EAC/B;MACC,CAACA,MAAM,CAAC,UAAU,CAAC,GAAG,OAAOP,IAAI,KAAK,WAAW;AACjD,MAAA,CAACO,MAAM,CAAC,qBAAqB,CAAC,GAAGT;KAEnC;AAAE,GAAA,CACF,CAAC,EACDL,WAAW,iBACXe,KAAA,CAAAC,aAAA,CAAA,KAAA,EAAA;IACCjB,SAAS,EAAEc,UAAU,CACpBC,MAAM,CAAC,qCAAqC,CAAC,EAC7C,qCAAqC,EACrC;MACC,CAACA,MAAM,CAAC,UAAU,CAAC,GAAG,OAAOP,IAAI,KAAK,WAAW;AACjD,MAAA,CAACO,MAAM,CAAC,qBAAqB,CAAC,GAAGT;KAEnC;GAAE,EAED,OAAOL,WAAW,KAAK,QAAQ,iBAC/Be,KAAA,CAAAC,aAAA,CAACM,OAAO,EAAA;AACPC,IAAAA,KAAK,EAAE;AACNxB,MAAAA,SAAS,EAAEe,MAAM,CAAC,8BAA8B,CAAC;AACjDU,MAAAA,EAAE,EAAEvB;KACH;AACFmB,IAAAA,IAAI,EAAEpB,WAAY;AAClByB,IAAAA,IAAI,EAAC;AAAQ,GACb,CACD,eACAV,KAAK,CAACW,cAAc,CAAC1B,WAAW,CAAC,IAAIA,WAClC,CAEF,CAAC;AAER;;;;"}
1
+ {"version":3,"file":"MrlLabelWithDescription.js","sources":["../../../../../../src/components/form/label/MrlLabelWithDescription/MrlLabelWithDescription.tsx"],"sourcesContent":["import * as React from 'react';\nimport classnames from 'classnames';\nimport { MrlText } from '../../../text/MrlText/MrlText';\nimport { MrlLabel } from '../MrlLabel/MrlLabel';\nimport { StaticIconConfig } from '../../constants';\n\nimport styles from './MrlLabelWithDescription.module.scss';\n\ninterface MrlLabelWithDescriptionProps {\n\t/** Additional class to add to the container of the label and description */\n\tclassName?: string;\n\t/** Description text or a custom component */\n\tdescription?: string | React.ReactNode;\n\t/** The id that's linked to the form element \"aria-describedby\" attribute */\n\tdescriptionId?: string;\n\t/** Disabled state */\n\tisDisabled?: boolean;\n\t/** Indeterminate state */\n\tisIndeterminate?: boolean;\n\t/** Selected state */\n\tisSelected?: boolean;\n\t/** Adjusts the styles of the label, icon, and description when the label is multiline */\n\thasMultilineLabel?: boolean;\n\t/** ID of the form elements so all users can understand the relationship between the two elements */\n\thtmlFor: string;\n\t/** Leading label icon */\n\ticon?: StaticIconConfig;\n\t/** The text to display as the label */\n\tlabel: string;\n}\n\n/**\n * Form control label that can render a label, an icon and description text\n *\n * @param {MrlLabelWithDescriptionProps} props - the component props\n * @returns a form control label with description\n */\nexport function MrlLabelWithDescription({\n\tclassName,\n\tdescription,\n\tdescriptionId,\n\tisDisabled,\n\tisIndeterminate,\n\tisSelected,\n\thasMultilineLabel,\n\thtmlFor,\n\ticon,\n\tlabel,\n\t...rest\n}: MrlLabelWithDescriptionProps): JSX.Element {\n\tconst allClasses = classnames(className, styles['MrlLabelWithDescription'], {\n\t\t[styles['mrl-is--disabled']]: isDisabled,\n\t\t[styles['mrl-is--selected']]: isSelected,\n\t\t[styles['mrl-is--indeterminate']]: isIndeterminate\n\t});\n\n\treturn (\n\t\t<div className={allClasses}>\n\t\t\t<MrlLabel\n\t\t\t\t{...rest}\n\t\t\t\ticon={icon !== undefined ? icon : undefined}\n\t\t\t\ttext={label}\n\t\t\t\tkind=\"inline\"\n\t\t\t\thtmlFor={htmlFor}\n\t\t\t\tclassName={classnames(\n\t\t\t\t\tstyles['MrlLabelWithDescription-label'],\n\t\t\t\t\t'MrlLabelWithDescription-label',\n\t\t\t\t\t{\n\t\t\t\t\t\t[styles['has-icon']]: typeof icon !== 'undefined',\n\t\t\t\t\t\t[styles['has-multiline-label']]: hasMultilineLabel\n\t\t\t\t\t}\n\t\t\t\t)}\n\t\t\t/>\n\t\t\t{description && (\n\t\t\t\t<div\n\t\t\t\t\tclassName={classnames(\n\t\t\t\t\t\tstyles['MrlLabelWithDescription-description'],\n\t\t\t\t\t\t'MrlLabelWithDescription-description',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t[styles['has-icon']]: typeof icon !== 'undefined',\n\t\t\t\t\t\t\t[styles['has-multiline-label']]: hasMultilineLabel\n\t\t\t\t\t\t}\n\t\t\t\t\t)}\n\t\t\t\t>\n\t\t\t\t\t{typeof description === 'string' && (\n\t\t\t\t\t\t<MrlText\n\t\t\t\t\t\t\tattrs={{\n\t\t\t\t\t\t\t\tclassName: styles['MrlLabelWithDescription-text'],\n\t\t\t\t\t\t\t\tid: descriptionId\n\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\ttext={description}\n\t\t\t\t\t\t\tsize=\"xsmall\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t\t{React.isValidElement(description) && description}\n\t\t\t\t</div>\n\t\t\t)}\n\t\t</div>\n\t);\n}\n"],"names":["MrlLabelWithDescription","_ref","className","description","descriptionId","isDisabled","isIndeterminate","isSelected","hasMultilineLabel","htmlFor","icon","label","rest","_objectWithoutProperties","_excluded","allClasses","classnames","styles","React","createElement","MrlLabel","_extends","undefined","text","kind","MrlText","attrs","id","size","isValidElement"],"mappings":";;;;;;;;AA+BA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,uBAAuBA,CAAAC,IAAA,EAYO;AAAA,EAAA,IAX7CC,SAAS,GAAAD,IAAA,CAATC,SAAS;IACTC,WAAW,GAAAF,IAAA,CAAXE,WAAW;IACXC,aAAa,GAAAH,IAAA,CAAbG,aAAa;IACbC,UAAU,GAAAJ,IAAA,CAAVI,UAAU;IACVC,eAAe,GAAAL,IAAA,CAAfK,eAAe;IACfC,UAAU,GAAAN,IAAA,CAAVM,UAAU;IACVC,iBAAiB,GAAAP,IA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KAAK,WAAW;AACjD,MAAA,CAACO,MAAM,CAAC,qBAAqB,CAAC,GAAGT;KAEnC;GAAE,EAED,OAAOL,WAAW,KAAK,QAAQ,iBAC/Be,KAAA,CAAAC,aAAA,CAACM,OAAO,EAAA;AACPC,IAAAA,KAAK,EAAE;AACNxB,MAAAA,SAAS,EAAEe,MAAM,CAAC,8BAA8B,CAAC;AACjDU,MAAAA,EAAE,EAAEvB;KACH;AACFmB,IAAAA,IAAI,EAAEpB,WAAY;AAClByB,IAAAA,IAAI,EAAC;AAAQ,GACb,CACD,eACAV,KAAK,CAACW,cAAc,CAAC1B,WAAW,CAAC,IAAIA,WAClC,CAEF,CAAC;AAER;;;;"}
@@ -2,6 +2,8 @@ import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _
2
2
  import * as React from 'react';
3
3
  import classnames from 'classnames';
4
4
  import { chevronUpFilled, chevronDownFilled } from '@muraldevkit/ds-icons';
5
+ import { MrlPortal } from '../../../portal/MrlPortal.js';
6
+ import { MrlSvg } from '../../../svg/MrlSvg/MrlSvg.js';
5
7
  import { selectDefaults } from '../../constants.js';
6
8
  import { useSelect } from '../context/SelectContext.js';
7
9
  import { getActionFromKey, actions, getUpdatedIndex } from '../../utils.js';
@@ -11,8 +13,6 @@ import styles from './MrlLegacySelect.module.scss.js';
11
13
  import { useMrlTrackInteraction } from '../../../../hooks/useMrlAnalytics/useMrlAnalytics.js';
12
14
  import { useCoordinate } from '../../../../hooks/useCoordinate/index.js';
13
15
  import { setAttributes } from '../../../../utils/setAttributes/setAttributes.js';
14
- import { MrlPortal } from '../../../portal/MrlPortal.js';
15
- import { MrlSvg } from '../../../svg/MrlSvg/MrlSvg.js';
16
16
 
17
17
  var _excluded = ["attrs", "children", "kind", "labelId", "size", "eventId"];
18
18
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"MrlLegacySelect.js","sources":["../../../../../../src/components/form/legacy-select/MrlLegacySelect/MrlLegacySelect.tsx"],"sourcesContent":["import * as React from 'react';\nimport classnames from 'classnames';\nimport { chevronDownFilled, chevronUpFilled } from '@muraldevkit/ds-icons';\nimport { MrlPortal, MrlSvg } from '../../../';\nimport { SelectStates, selectDefaults, InputKinds, InputSizes } from '../../constants';\nimport { useSelect } from '../context/SelectContext';\nimport { getActionFromKey, actions, getUpdatedIndex } from '../../utils';\nimport { AttrsObject, setAttributes } from '../../../../utils';\nimport { useCoordinate } from '../../../../hooks';\nimport { PORTAL_LAYERS } from '../../../../utils/layers';\nimport { useClickOutside } from '../../../../hooks/useClickOutside';\nimport { useMrlTrackInteraction } from '../../../../hooks/useMrlAnalytics';\n\nimport styles from './MrlLegacySelect.module.scss';\n\nexport interface MrlLegacySelectProptypes extends React.HTMLAttributes<HTMLDivElement> {\n\t/** Additional function to be run when the value of the select changes */\n\thookChange?: (newValue?: string) => void | undefined;\n\n\t/** State of the select element based on user actions or permissions */\n\tstate?: SelectStates;\n\n\t/**\n\t * By default, we will select the first item in the list.\n\t * To select a different option by default, pass that item’s value as the defaultValue to the mrlSelect element.\n\t */\n\tdefaultValue?: string;\n\n\t/**\n\t * Because this is a custom element, we can't use a standard \"for\" attribute setup. The label\n\t * element needs to have an id and then we reference via the select with aria\n\t */\n\tlabelId: string;\n\n\t/**\n\t * Changes the visual style of the select trigger; Use 'inline when your select is inline\n\t * with other content\n\t */\n\tkind?: InputKinds;\n\n\t/**\n\t * Changes the visual size of the select trigger; Currently only supported when kind=\"inline\"\n\t */\n\tsize?: InputSizes;\n\n\t/**\n\t * Applies additional HTML attributes to the `mrl-select` element after the\n\t * hydration process. It is recommended only to use when overwriting an attribute\n\t * assigned internally by the design system.\n\t * When using in a framework wrapper (e.g., React), treat it as an object and don't stringify.\n\t * Otherwise, the value object needs to be stringified to not receive `\"[Object object]\"`.\n\t * Example: `attrs='{ \"tabindex\": \"1\" }'`\n\t */\n\tattrs?: AttrsObject;\n\n\t/**\n\t * menu - list of options for the user to chose from; expects an `MrlLegacySelectMenu` component\n\t */\n\tchildren?: React.ReactNode;\n\n\t/**\n\t * optional id - we will generate a unique one if it isn't given.\n\t * ID will be decorated with `${id}-mrl-select` to not conflict with aria controls.\n\t */\n\tid?: string;\n\n\t/**\n\t * optional value - control which item is selected by passing an `MrlLegacySelectItem` value (overrides `defaultValue`)\n\t * Can be used in conjunction with `hookChange` to create a controlled component.\n\t */\n\tvalue?: string;\n\n\t/**\n\t * Enables interaction tracking for this select. Provide a stable, non-PII id\n\t * (e.g. 'workspace-role-select'). When omitted, the select emits no analytics.\n\t */\n\teventId?: string;\n}\n\n/**\n * Creates and exports component class for Mural Select\n *\n * @param {MrlLegacySelectProptypes} props the props for your MrlLink\n * @returns {React.ReactElement} an a element containing the text you pass\n */\nexport const MrlLegacySelect = ({\n\tattrs = {},\n\tchildren,\n\tkind = selectDefaults.kind,\n\tlabelId,\n\tsize = selectDefaults.size,\n\teventId,\n\t...theRest\n}: MrlLegacySelectProptypes): React.ReactElement => {\n\tconst selectRef = React.useRef<HTMLDivElement>(null);\n\tconst portalRef = React.useRef<HTMLDivElement>(null);\n\tconst { dispatch, state: dispatchState } = useSelect();\n\tconst trackInteraction = useMrlTrackInteraction('MrlLegacySelect', eventId);\n\tconst coords = useCoordinate<HTMLDivElement | null>(selectRef.current, false, dispatchState.open);\n\n\tconst handleOpen = React.useCallback(\n\t\t(e: React.MouseEvent<HTMLDivElement, MouseEvent>) => {\n\t\t\te.stopPropagation();\n\n\t\t\tif (dispatchState.open) {\n\t\t\t\ttrackInteraction({ action: 'close' });\n\t\t\t\tdispatch({ payload: 'mouse', type: 'close' });\n\t\t\t} else {\n\t\t\t\ttrackInteraction({ action: 'open' });\n\t\t\t\tdispatch({ type: 'open' });\n\t\t\t}\n\t\t\ttheRest.onClick?.(e);\n\t\t},\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[dispatchState.open, trackInteraction]\n\t);\n\n\tconst handleKeyPress = React.useCallback(\n\t\t(event: React.KeyboardEvent<HTMLDivElement>) => {\n\t\t\t// trap tab when we are open\n\t\t\tif (dispatchState.open && event.key === 'Tab') {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tevent.stopPropagation();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst action = getActionFromKey(event, dispatchState.open);\n\t\t\tswitch (action) {\n\t\t\t\tcase actions.Last:\n\t\t\t\tcase actions.First:\n\t\t\t\t\tdispatch({ type: 'open' });\n\t\t\t\t\tbreak;\n\t\t\t\tcase actions.Type:\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\tdispatch({ type: 'open' });\n\t\t\t\t\tbreak;\n\t\t\t\tcase actions.Open:\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\tdispatch({ type: 'open' });\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\ttheRest.onKeyDown?.(event);\n\t\t},\n\t\t// only want to rereun this when our keydown changes or our state changes.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[dispatchState, theRest.onKeyDown]\n\t);\n\n\t/**\n\t * @TODO: move menu key handling to MrlLegacySelectMenu\n\t */\n\tconst handleGlobalKeyPress = React.useCallback(\n\t\t(event: KeyboardEvent) => {\n\t\t\tconst action = getActionFromKey(event as unknown as React.KeyboardEvent, dispatchState.open);\n\t\t\tconst items = portalRef?.current?.querySelectorAll('.mrl-selectItem') || [];\n\t\t\tconst lastItemIndex = items?.length - 1;\n\t\t\tconst firstItemIndex = 0;\n\t\t\tconst focusIndex = dispatchState.focusIndex || 0;\n\n\t\t\tswitch (action) {\n\t\t\t\tcase actions.PageDown:\n\t\t\t\tcase actions.Last:\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tdispatch({\n\t\t\t\t\t\tpayload: getUpdatedIndex(focusIndex, lastItemIndex, action),\n\t\t\t\t\t\ttype: 'focus'\n\t\t\t\t\t});\n\t\t\t\t\tbreak;\n\t\t\t\tcase actions.PageUp:\n\t\t\t\tcase actions.First:\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tdispatch({\n\t\t\t\t\t\tpayload: getUpdatedIndex(focusIndex, lastItemIndex, action),\n\t\t\t\t\t\ttype: 'focus'\n\t\t\t\t\t});\n\t\t\t\t\tbreak;\n\t\t\t\tcase actions.Previous:\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t// if not our first item then focus next.\n\t\t\t\t\tif (firstItemIndex !== focusIndex) {\n\t\t\t\t\t\tdispatch({\n\t\t\t\t\t\t\tpayload: focusIndex - 1,\n\t\t\t\t\t\t\ttype: 'focus'\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase actions.Next:\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t// if not our last item then focus next.\n\t\t\t\t\tif (lastItemIndex !== focusIndex) {\n\t\t\t\t\t\tdispatch({\n\t\t\t\t\t\t\tpayload: focusIndex + 1,\n\t\t\t\t\t\t\ttype: 'focus'\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase actions.CloseSelect:\n\t\t\t\tcase actions.Close:\n\t\t\t\t\tdispatch({ payload: 'keyboard', type: 'close' });\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t},\n\t\t// only want to change when state changes or we have different children.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[dispatchState, children]\n\t);\n\n\t/**\n\t * Detects if the select element has moved and closes the menu if it has\n\t *\n\t * We are using requestAnimationFrame to check the position of the select element\n\t * and compare it to the last known position. If the position has changed, we close\n\t * the menu.\n\t */\n\tconst lastPosition = React.useRef<DOMRect | null>(null);\n\tconst animationFrameRef = React.useRef<number | null>(null);\n\n\tReact.useEffect(() => {\n\t\tconst checkPositionChange = () => {\n\t\t\tif (selectRef.current && dispatchState.open) {\n\t\t\t\tconst currentPosition = selectRef.current.getBoundingClientRect();\n\n\t\t\t\t// If the last position is different than the current position, we know that the\n\t\t\t\t// menu has scrolled and we should close it.\n\t\t\t\tif (lastPosition.current && lastPosition.current.y !== currentPosition.y) {\n\t\t\t\t\tlastPosition.current = null;\n\t\t\t\t\tdispatch({ payload: 'mouse', type: 'close' });\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tlastPosition.current = currentPosition;\n\t\t\t}\n\t\t\tanimationFrameRef.current = requestAnimationFrame(checkPositionChange);\n\t\t};\n\n\t\tif (dispatchState.open) {\n\t\t\tanimationFrameRef.current = requestAnimationFrame(checkPositionChange);\n\t\t}\n\n\t\treturn () => {\n\t\t\tif (animationFrameRef.current) {\n\t\t\t\tcancelAnimationFrame(animationFrameRef.current);\n\t\t\t}\n\t\t};\n\t}, [dispatch, dispatchState.open]);\n\n\t/**\n\t * Sets focus to select element when it is closed\n\t */\n\tReact.useEffect(() => {\n\t\tif (!dispatchState.open && dispatchState.actionType === 'keyboard') {\n\t\t\tselectRef.current?.focus();\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [dispatchState.open]);\n\n\t/**\n\t * @TODO: move menu key handling to MrlLegacySelectMenu\n\t */\n\tReact.useEffect(() => {\n\t\tif (dispatchState.disabled || dispatchState.readOnly) {\n\t\t\treturn;\n\t\t}\n\n\t\tdocument?.addEventListener('keydown', handleGlobalKeyPress);\n\n\t\treturn () => {\n\t\t\tdocument?.removeEventListener('keydown', handleGlobalKeyPress);\n\t\t};\n\t}, [handleGlobalKeyPress, dispatchState.disabled, dispatchState.readOnly]);\n\n\t/**\n\t * This useEffect is responsible for setting the value if it passed in or changed\n\t * when the select is being used as a controlled component\n\t */\n\tReact.useEffect(() => {\n\t\tconst value = dispatchState.controlledValue;\n\n\t\tif (value && value !== dispatchState.selectedItem) {\n\t\t\tdispatch({ payload: value, type: 'select' });\n\n\t\t\tif (children) {\n\t\t\t\t// The first child is an instance of MrlLegacySelectMenu, so let's grab that\n\t\t\t\t// because we are looking to match the value against the children passed\n\t\t\t\t// into the MrlLegacySelectMenu component\n\t\t\t\tconst selectMenu = React.Children.toArray(children)[0];\n\n\t\t\t\tif (React.isValidElement(selectMenu)) {\n\t\t\t\t\t// Now let's grab the children of the array\n\t\t\t\t\tconst menuChildren = React.Children.toArray(selectMenu.props.children);\n\n\t\t\t\t\t// Once we have the children, we want to iterate over them to check to see if\n\t\t\t\t\t// the controlled value passed to the component matches any of the items in the menu\n\t\t\t\t\tconst matchedItem = menuChildren.find(\n\t\t\t\t\t\t(item) =>\n\t\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\t\t\tReact.isValidElement(item) && (item as any).props.value === value\n\t\t\t\t\t);\n\n\t\t\t\t\t// If we found a match, we want to set the selected text to the value of the item's children\n\t\t\t\t\tif (matchedItem && React.isValidElement(matchedItem)) {\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\t\tconst selectedText = (matchedItem as any).props.children;\n\t\t\t\t\t\tdispatch({ payload: selectedText, type: 'selectedText' });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [children, dispatchState.controlledValue, dispatchState.selectedItem]);\n\n\tconst attributes = setAttributes(attrs, {\n\t\t'aria-controls': dispatchState.id,\n\t\t'aria-disabled': dispatchState.disabled ? 'true' : 'false',\n\t\t'aria-expanded': dispatchState.open.toString(),\n\t\t'aria-haspopup': 'listbox',\n\t\t'aria-labelledby': labelId,\n\t\trole: 'combobox',\n\t\t...(!dispatchState.disabled && { tabIndex: '0' })\n\t});\n\n\tconst allClasses = classnames('mrl-select', attributes.className, theRest.className, {\n\t\t[styles['mrl-select']]: true,\n\t\t[styles['mrl-select--disabled']]: dispatchState.disabled,\n\t\t[styles['mrl-select--read-only']]: dispatchState.readOnly\n\t});\n\n\tconst selectClasses = classnames('mrl-select-trigger', {\n\t\t[styles['mrl-select-trigger']]: true,\n\t\t[styles['mrl-select-trigger--border']]: kind === 'default',\n\t\t[styles[`mrl-select-trigger--${kind}`]]: kind !== 'default',\n\t\t[styles[`mrl-select-trigger--${size}`]]: size !== 'default'\n\t});\n\n\tconst svgClasses = classnames({\n\t\t[styles['mrl-is--open']]: dispatchState.open,\n\t\t[styles['mrl-select-trigger-indicator']]: true\n\t});\n\n\tconst selectedText = React.useMemo(() => {\n\t\tif (dispatchState.selectedText) {\n\t\t\treturn dispatchState.selectedText;\n\t\t}\n\n\t\tif (children) {\n\t\t\treturn React.Children.toArray(children)[0];\n\t\t}\n\n\t\treturn 'loading...';\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [dispatchState.selectedText]);\n\n\tconst closeSelect = () => dispatch({ payload: 'mouse', type: 'close' });\n\tuseClickOutside(selectRef, portalRef, 'mousedown', closeSelect);\n\n\treturn (\n\t\t<div\n\t\t\t{...attributes}\n\t\t\t{...theRest}\n\t\t\t{...(!dispatchState.disabled && !dispatchState.readOnly && { onClick: handleOpen })}\n\t\t\t{...(!dispatchState.disabled && !dispatchState.readOnly && { onKeyDown: handleKeyPress })}\n\t\t\tdata-value={dispatchState.selectedItem}\n\t\t\tid={dispatchState.id}\n\t\t\tclassName={allClasses}\n\t\t\tref={selectRef}\n\t\t>\n\t\t\t<div className={selectClasses}>\n\t\t\t\t<span>{selectedText}</span>\n\t\t\t\t{!dispatchState.readOnly && (\n\t\t\t\t\t<MrlSvg\n\t\t\t\t\t\tsvg={dispatchState.open ? chevronUpFilled : chevronDownFilled}\n\t\t\t\t\t\tclassName={svgClasses}\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t\t{dispatchState.open && (\n\t\t\t\t<MrlPortal id=\"mrl-select-portal\" layer={PORTAL_LAYERS.SELECT}>\n\t\t\t\t\t<div\n\t\t\t\t\t\tref={portalRef}\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tleft: coords.left,\n\t\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\t\ttop: coords.top + coords.height,\n\t\t\t\t\t\t\twidth: `${coords.width}px`\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</div>\n\t\t\t\t</MrlPortal>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n"],"names":["MrlLegacySelect","_ref","_ref$attrs","attrs","children","_ref$kind","kind","selectDefaults","labelId","_ref$size","size","eventId","theRest","_objectWithoutProperties","_excluded","selectRef","React","useRef","portalRef","_useSelect","useSelect","dispatch","dispatchState","state","trackInteraction","useMrlTrackInteraction","coords","useCoordinate","current","open","handleOpen","useCallback","e","_theRest$onClick","stopPropagation","action","payload","type","onClick","call","handleKeyPress","event","_theRest$onKeyDown","key","preventDefault","getActionFromKey","actions","Last","First","Type","Open","onKeyDown","handleGlobalKeyPress","_portalRef$current","items","querySelectorAll","lastItemIndex","length","firstItemIndex","focusIndex","PageDown","getUpdatedIndex","PageUp","Previous","Next","CloseSelect","Close","lastPosition","animationFrameRef","useEffect","checkPositionChange","currentPosition","getBoundingClientRect","y","requestAnimationFrame","cancelAnimationFrame","actionType","_selectRef$current","focus","_document","disabled","readOnly","document","addEventListener","_document2","removeEventListener","value","controlledValue","selectedItem","selectMenu","Children","toArray","isValidElement","menuChildren","props","matchedItem","find","item","selectedText","attributes","setAttributes","_objectSpread","id","toString","role","tabIndex","allClasses","classnames","className","styles","selectClasses","concat","svgClasses","useMemo","closeSelect","useClickOutside","createElement","_extends","ref","MrlSvg","svg","chevronUpFilled","chevronDownFilled","MrlPortal","layer","PORTAL_LAYERS","SELECT","style","left","position","top","height","width"],"mappings":";;;;;;;;;;;;;;;;;AA+EA;AACA;AACA;AACA;AACA;AACA;AACO,IAAMA,eAAe,GAAGC,IAAA,IAQqB;AAAA,EAAA,IAAAC,UAAA,GAAAD,I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e,GAAGC,iBAAkB;AAC9Dd,IAAAA,SAAS,EAAEI,UAAW;AACtBtG,IAAAA,IAAI,EAAC;GACL,CAEE,CAAC,EACLY,aAAa,CAACO,IAAI,iBAClBb,KAAA,CAAAoG,aAAA,CAACO,SAAS,EAAA;AAACrB,IAAAA,EAAE,EAAC,mBAAmB;IAACsB,KAAK,EAAEC,aAAa,CAACC;GAAO,eAC7D9G,KAAA,CAAAoG,aAAA,CAAA,KAAA,EAAA;AACCE,IAAAA,GAAG,EAAEpG,SAAU;AACf6G,IAAAA,KAAK,EAAE;MACNC,IAAI,EAAEtG,MAAM,CAACsG,IAAI;AACjBC,MAAAA,QAAQ,EAAE,UAAU;AACpBC,MAAAA,GAAG,EAAExG,MAAM,CAACwG,GAAG,GAAGxG,MAAM,CAACyG,MAAM;AAC/BC,MAAAA,KAAK,EAAA,EAAA,CAAArB,MAAA,CAAKrF,MAAM,CAAC0G,KAAK,EAAA,IAAA;AACvB;GAAE,EAEDhI,QACG,CACK,CAER,CAAC;AAER;;;;"}
1
+ {"version":3,"file":"MrlLegacySelect.js","sources":["../../../../../../src/components/form/legacy-select/MrlLegacySelect/MrlLegacySelect.tsx"],"sourcesContent":["import * as React from 'react';\nimport classnames from 'classnames';\nimport { chevronDownFilled, chevronUpFilled } from '@muraldevkit/ds-icons';\nimport { MrlPortal } from '../../../portal/MrlPortal';\nimport { MrlSvg } from '../../../svg/MrlSvg/MrlSvg';\nimport { SelectStates, selectDefaults, InputKinds, InputSizes } from '../../constants';\nimport { useSelect } from '../context/SelectContext';\nimport { getActionFromKey, actions, getUpdatedIndex } from '../../utils';\nimport { AttrsObject, setAttributes } from '../../../../utils';\nimport { useCoordinate } from '../../../../hooks';\nimport { PORTAL_LAYERS } from '../../../../utils/layers';\nimport { useClickOutside } from '../../../../hooks/useClickOutside';\nimport { useMrlTrackInteraction } from '../../../../hooks/useMrlAnalytics';\n\nimport styles from './MrlLegacySelect.module.scss';\n\nexport interface MrlLegacySelectProptypes extends React.HTMLAttributes<HTMLDivElement> {\n\t/** Additional function to be run when the value of the select changes */\n\thookChange?: (newValue?: string) => void | undefined;\n\n\t/** State of the select element based on user actions or permissions */\n\tstate?: SelectStates;\n\n\t/**\n\t * By default, we will select the first item in the list.\n\t * To select a different option by default, pass that item’s value as the defaultValue to the mrlSelect element.\n\t */\n\tdefaultValue?: string;\n\n\t/**\n\t * Because this is a custom element, we can't use a standard \"for\" attribute setup. The label\n\t * element needs to have an id and then we reference via the select with aria\n\t */\n\tlabelId: string;\n\n\t/**\n\t * Changes the visual style of the select trigger; Use 'inline when your select is inline\n\t * with other content\n\t */\n\tkind?: InputKinds;\n\n\t/**\n\t * Changes the visual size of the select trigger; Currently only supported when kind=\"inline\"\n\t */\n\tsize?: InputSizes;\n\n\t/**\n\t * Applies additional HTML attributes to the `mrl-select` element after the\n\t * hydration process. It is recommended only to use when overwriting an attribute\n\t * assigned internally by the design system.\n\t * When using in a framework wrapper (e.g., React), treat it as an object and don't stringify.\n\t * Otherwise, the value object needs to be stringified to not receive `\"[Object object]\"`.\n\t * Example: `attrs='{ \"tabindex\": \"1\" }'`\n\t */\n\tattrs?: AttrsObject;\n\n\t/**\n\t * menu - list of options for the user to chose from; expects an `MrlLegacySelectMenu` component\n\t */\n\tchildren?: React.ReactNode;\n\n\t/**\n\t * optional id - we will generate a unique one if it isn't given.\n\t * ID will be decorated with `${id}-mrl-select` to not conflict with aria controls.\n\t */\n\tid?: string;\n\n\t/**\n\t * optional value - control which item is selected by passing an `MrlLegacySelectItem` value (overrides `defaultValue`)\n\t * Can be used in conjunction with `hookChange` to create a controlled component.\n\t */\n\tvalue?: string;\n\n\t/**\n\t * Enables interaction tracking for this select. Provide a stable, non-PII id\n\t * (e.g. 'workspace-role-select'). When omitted, the select emits no analytics.\n\t */\n\teventId?: string;\n}\n\n/**\n * Creates and exports component class for Mural Select\n *\n * @param {MrlLegacySelectProptypes} props the props for your MrlLink\n * @returns {React.ReactElement} an a element containing the text you pass\n */\nexport const MrlLegacySelect = ({\n\tattrs = {},\n\tchildren,\n\tkind = selectDefaults.kind,\n\tlabelId,\n\tsize = selectDefaults.size,\n\teventId,\n\t...theRest\n}: MrlLegacySelectProptypes): React.ReactElement => {\n\tconst selectRef = React.useRef<HTMLDivElement>(null);\n\tconst portalRef = React.useRef<HTMLDivElement>(null);\n\tconst { dispatch, state: dispatchState } = useSelect();\n\tconst trackInteraction = useMrlTrackInteraction('MrlLegacySelect', eventId);\n\tconst coords = useCoordinate<HTMLDivElement | null>(selectRef.current, false, dispatchState.open);\n\n\tconst handleOpen = React.useCallback(\n\t\t(e: React.MouseEvent<HTMLDivElement, MouseEvent>) => {\n\t\t\te.stopPropagation();\n\n\t\t\tif (dispatchState.open) {\n\t\t\t\ttrackInteraction({ action: 'close' });\n\t\t\t\tdispatch({ payload: 'mouse', type: 'close' });\n\t\t\t} else {\n\t\t\t\ttrackInteraction({ action: 'open' });\n\t\t\t\tdispatch({ type: 'open' });\n\t\t\t}\n\t\t\ttheRest.onClick?.(e);\n\t\t},\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[dispatchState.open, trackInteraction]\n\t);\n\n\tconst handleKeyPress = React.useCallback(\n\t\t(event: React.KeyboardEvent<HTMLDivElement>) => {\n\t\t\t// trap tab when we are open\n\t\t\tif (dispatchState.open && event.key === 'Tab') {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tevent.stopPropagation();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst action = getActionFromKey(event, dispatchState.open);\n\t\t\tswitch (action) {\n\t\t\t\tcase actions.Last:\n\t\t\t\tcase actions.First:\n\t\t\t\t\tdispatch({ type: 'open' });\n\t\t\t\t\tbreak;\n\t\t\t\tcase actions.Type:\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\tdispatch({ type: 'open' });\n\t\t\t\t\tbreak;\n\t\t\t\tcase actions.Open:\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\tdispatch({ type: 'open' });\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\ttheRest.onKeyDown?.(event);\n\t\t},\n\t\t// only want to rereun this when our keydown changes or our state changes.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[dispatchState, theRest.onKeyDown]\n\t);\n\n\t/**\n\t * @TODO: move menu key handling to MrlLegacySelectMenu\n\t */\n\tconst handleGlobalKeyPress = React.useCallback(\n\t\t(event: KeyboardEvent) => {\n\t\t\tconst action = getActionFromKey(event as unknown as React.KeyboardEvent, dispatchState.open);\n\t\t\tconst items = portalRef?.current?.querySelectorAll('.mrl-selectItem') || [];\n\t\t\tconst lastItemIndex = items?.length - 1;\n\t\t\tconst firstItemIndex = 0;\n\t\t\tconst focusIndex = dispatchState.focusIndex || 0;\n\n\t\t\tswitch (action) {\n\t\t\t\tcase actions.PageDown:\n\t\t\t\tcase actions.Last:\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tdispatch({\n\t\t\t\t\t\tpayload: getUpdatedIndex(focusIndex, lastItemIndex, action),\n\t\t\t\t\t\ttype: 'focus'\n\t\t\t\t\t});\n\t\t\t\t\tbreak;\n\t\t\t\tcase actions.PageUp:\n\t\t\t\tcase actions.First:\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\tdispatch({\n\t\t\t\t\t\tpayload: getUpdatedIndex(focusIndex, lastItemIndex, action),\n\t\t\t\t\t\ttype: 'focus'\n\t\t\t\t\t});\n\t\t\t\t\tbreak;\n\t\t\t\tcase actions.Previous:\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t// if not our first item then focus next.\n\t\t\t\t\tif (firstItemIndex !== focusIndex) {\n\t\t\t\t\t\tdispatch({\n\t\t\t\t\t\t\tpayload: focusIndex - 1,\n\t\t\t\t\t\t\ttype: 'focus'\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tcase actions.Next:\n\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t// if not our last item then focus next.\n\t\t\t\t\tif (lastItemIndex !== focusIndex) {\n\t\t\t\t\t\tdispatch({\n\t\t\t\t\t\t\tpayload: focusIndex + 1,\n\t\t\t\t\t\t\ttype: 'focus'\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase actions.CloseSelect:\n\t\t\t\tcase actions.Close:\n\t\t\t\t\tdispatch({ payload: 'keyboard', type: 'close' });\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t},\n\t\t// only want to change when state changes or we have different children.\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t\t[dispatchState, children]\n\t);\n\n\t/**\n\t * Detects if the select element has moved and closes the menu if it has\n\t *\n\t * We are using requestAnimationFrame to check the position of the select element\n\t * and compare it to the last known position. If the position has changed, we close\n\t * the menu.\n\t */\n\tconst lastPosition = React.useRef<DOMRect | null>(null);\n\tconst animationFrameRef = React.useRef<number | null>(null);\n\n\tReact.useEffect(() => {\n\t\tconst checkPositionChange = () => {\n\t\t\tif (selectRef.current && dispatchState.open) {\n\t\t\t\tconst currentPosition = selectRef.current.getBoundingClientRect();\n\n\t\t\t\t// If the last position is different than the current position, we know that the\n\t\t\t\t// menu has scrolled and we should close it.\n\t\t\t\tif (lastPosition.current && lastPosition.current.y !== currentPosition.y) {\n\t\t\t\t\tlastPosition.current = null;\n\t\t\t\t\tdispatch({ payload: 'mouse', type: 'close' });\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tlastPosition.current = currentPosition;\n\t\t\t}\n\t\t\tanimationFrameRef.current = requestAnimationFrame(checkPositionChange);\n\t\t};\n\n\t\tif (dispatchState.open) {\n\t\t\tanimationFrameRef.current = requestAnimationFrame(checkPositionChange);\n\t\t}\n\n\t\treturn () => {\n\t\t\tif (animationFrameRef.current) {\n\t\t\t\tcancelAnimationFrame(animationFrameRef.current);\n\t\t\t}\n\t\t};\n\t}, [dispatch, dispatchState.open]);\n\n\t/**\n\t * Sets focus to select element when it is closed\n\t */\n\tReact.useEffect(() => {\n\t\tif (!dispatchState.open && dispatchState.actionType === 'keyboard') {\n\t\t\tselectRef.current?.focus();\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [dispatchState.open]);\n\n\t/**\n\t * @TODO: move menu key handling to MrlLegacySelectMenu\n\t */\n\tReact.useEffect(() => {\n\t\tif (dispatchState.disabled || dispatchState.readOnly) {\n\t\t\treturn;\n\t\t}\n\n\t\tdocument?.addEventListener('keydown', handleGlobalKeyPress);\n\n\t\treturn () => {\n\t\t\tdocument?.removeEventListener('keydown', handleGlobalKeyPress);\n\t\t};\n\t}, [handleGlobalKeyPress, dispatchState.disabled, dispatchState.readOnly]);\n\n\t/**\n\t * This useEffect is responsible for setting the value if it passed in or changed\n\t * when the select is being used as a controlled component\n\t */\n\tReact.useEffect(() => {\n\t\tconst value = dispatchState.controlledValue;\n\n\t\tif (value && value !== dispatchState.selectedItem) {\n\t\t\tdispatch({ payload: value, type: 'select' });\n\n\t\t\tif (children) {\n\t\t\t\t// The first child is an instance of MrlLegacySelectMenu, so let's grab that\n\t\t\t\t// because we are looking to match the value against the children passed\n\t\t\t\t// into the MrlLegacySelectMenu component\n\t\t\t\tconst selectMenu = React.Children.toArray(children)[0];\n\n\t\t\t\tif (React.isValidElement(selectMenu)) {\n\t\t\t\t\t// Now let's grab the children of the array\n\t\t\t\t\tconst menuChildren = React.Children.toArray(selectMenu.props.children);\n\n\t\t\t\t\t// Once we have the children, we want to iterate over them to check to see if\n\t\t\t\t\t// the controlled value passed to the component matches any of the items in the menu\n\t\t\t\t\tconst matchedItem = menuChildren.find(\n\t\t\t\t\t\t(item) =>\n\t\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\t\t\tReact.isValidElement(item) && (item as any).props.value === value\n\t\t\t\t\t);\n\n\t\t\t\t\t// If we found a match, we want to set the selected text to the value of the item's children\n\t\t\t\t\tif (matchedItem && React.isValidElement(matchedItem)) {\n\t\t\t\t\t\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\t\t\t\t\t\tconst selectedText = (matchedItem as any).props.children;\n\t\t\t\t\t\tdispatch({ payload: selectedText, type: 'selectedText' });\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [children, dispatchState.controlledValue, dispatchState.selectedItem]);\n\n\tconst attributes = setAttributes(attrs, {\n\t\t'aria-controls': dispatchState.id,\n\t\t'aria-disabled': dispatchState.disabled ? 'true' : 'false',\n\t\t'aria-expanded': dispatchState.open.toString(),\n\t\t'aria-haspopup': 'listbox',\n\t\t'aria-labelledby': labelId,\n\t\trole: 'combobox',\n\t\t...(!dispatchState.disabled && { tabIndex: '0' })\n\t});\n\n\tconst allClasses = classnames('mrl-select', attributes.className, theRest.className, {\n\t\t[styles['mrl-select']]: true,\n\t\t[styles['mrl-select--disabled']]: dispatchState.disabled,\n\t\t[styles['mrl-select--read-only']]: dispatchState.readOnly\n\t});\n\n\tconst selectClasses = classnames('mrl-select-trigger', {\n\t\t[styles['mrl-select-trigger']]: true,\n\t\t[styles['mrl-select-trigger--border']]: kind === 'default',\n\t\t[styles[`mrl-select-trigger--${kind}`]]: kind !== 'default',\n\t\t[styles[`mrl-select-trigger--${size}`]]: size !== 'default'\n\t});\n\n\tconst svgClasses = classnames({\n\t\t[styles['mrl-is--open']]: dispatchState.open,\n\t\t[styles['mrl-select-trigger-indicator']]: true\n\t});\n\n\tconst selectedText = React.useMemo(() => {\n\t\tif (dispatchState.selectedText) {\n\t\t\treturn dispatchState.selectedText;\n\t\t}\n\n\t\tif (children) {\n\t\t\treturn React.Children.toArray(children)[0];\n\t\t}\n\n\t\treturn 'loading...';\n\t\t// eslint-disable-next-line react-hooks/exhaustive-deps\n\t}, [dispatchState.selectedText]);\n\n\tconst closeSelect = () => dispatch({ payload: 'mouse', type: 'close' });\n\tuseClickOutside(selectRef, portalRef, 'mousedown', closeSelect);\n\n\treturn (\n\t\t<div\n\t\t\t{...attributes}\n\t\t\t{...theRest}\n\t\t\t{...(!dispatchState.disabled && !dispatchState.readOnly && { onClick: handleOpen })}\n\t\t\t{...(!dispatchState.disabled && !dispatchState.readOnly && { onKeyDown: handleKeyPress })}\n\t\t\tdata-value={dispatchState.selectedItem}\n\t\t\tid={dispatchState.id}\n\t\t\tclassName={allClasses}\n\t\t\tref={selectRef}\n\t\t>\n\t\t\t<div className={selectClasses}>\n\t\t\t\t<span>{selectedText}</span>\n\t\t\t\t{!dispatchState.readOnly && (\n\t\t\t\t\t<MrlSvg\n\t\t\t\t\t\tsvg={dispatchState.open ? chevronUpFilled : chevronDownFilled}\n\t\t\t\t\t\tclassName={svgClasses}\n\t\t\t\t\t\tsize=\"small\"\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t\t{dispatchState.open && (\n\t\t\t\t<MrlPortal id=\"mrl-select-portal\" layer={PORTAL_LAYERS.SELECT}>\n\t\t\t\t\t<div\n\t\t\t\t\t\tref={portalRef}\n\t\t\t\t\t\tstyle={{\n\t\t\t\t\t\t\tleft: coords.left,\n\t\t\t\t\t\t\tposition: 'absolute',\n\t\t\t\t\t\t\ttop: coords.top + coords.height,\n\t\t\t\t\t\t\twidth: `${coords.width}px`\n\t\t\t\t\t\t}}\n\t\t\t\t\t>\n\t\t\t\t\t\t{children}\n\t\t\t\t\t</div>\n\t\t\t\t</MrlPortal>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n"],"names":["MrlLegacySelect","_ref","_ref$attrs","attrs","children","_ref$kind","kind","selectDefaults","labelId","_ref$size","size","eventId","theRest","_objectWithoutProperties","_excluded","selectRef","React","useRef","portalRef","_useSelect","useSelect","dispatch","dispatchState","state","trackInteraction","useMrlTrackInteraction","coords","useCoordinate","current","open","handleOpen","useCallback","e","_theRest$onClick","stopPropagation","action","payload","type","onClick","call","handleKeyPress","event","_theRest$onKeyDown","key","preventDefault","getActionFromKey","actions","Last","First","Type","Open","onKeyDown","handleGlobalKeyPress","_portalRef$current","items","querySelectorAll","lastItemIndex","length","firstItemIndex","focusIndex","PageDown","getUpdatedIndex","PageUp","Previous","Next","CloseSelect","Close","lastPosition","animationFrameRef","useEffect","checkPositionChange","currentPosition","getBoundingClientRect","y","requestAnimationFrame","cancelAnimationFrame","actionType","_selectRef$current","focus","_document","disabled","readOnly","document","addEventListener","_document2","removeEventListener","value","controlledValue","selectedItem","selectMenu","Children","toArray","isValidElement","menuChildren","props","matchedItem","find","item","selectedText","attributes","setAttributes","_objectSpread","id","toString","role","tabIndex","allClasses","classnames","className","styles","selectClasses","concat","svgClasses","useMemo","closeSelect","useClickOutside","createElement","_extends","ref","MrlSvg","svg","chevronUpFilled","chevronDownFilled","MrlPortal","layer","PORTAL_LAYERS","SELECT","style","left","position","top","height","width"],"mappings":";;;;;;;;;;;;;;;;;AAgFA;AACA;AACA;AACA;AACA;AACA;AACO,IAAMA,eAAe,GAAGC,IAAA,IAQqB;AAAA,EAAA,IAAAC,UAAA,GAAAD,IAAA,CAPnDE,KAAK;AAALA,IAAAA,KAAK,GAAAD,UAAA,KAAA,MAAA,GAAG,EAAE,GAAAA,UAAA;IACVE,QAAQ,GAAAH,IAAA,CAARG,QAAQ;IAAAC,SAAA,GAAAJ,IAAA,CACRK,IAAI;AAAJA,IAAAA,IAAI,GAAAD,SAAA,KAAA,MAAA,GAAGE,cAAc,CAACD,IAAI,GAAAD,SAAA;IAC1BG,OAAO,GAAAP,IAAA,CAAPO,OAAO;IAAAC,SAAA,GAAAR,IAAA,CACPS,IAAI;AAAJA,IAAAA,IAAI,GAAAD,SAAA,KAAA,MAAA,GAAGF,cAAc,CAACG,IAAI,GAAAD,SAAA;IAC1BE,OAAO,GAAAV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A,GAAG,EAAExG,MAAM,CAACwG,GAAG,GAAGxG,MAAM,CAACyG,MAAM;AAC/BC,MAAAA,KAAK,EAAA,EAAA,CAAArB,MAAA,CAAKrF,MAAM,CAAC0G,KAAK,EAAA,IAAA;AACvB;GAAE,EAEDhI,QACG,CACK,CAER,CAAC;AAER;;;;"}
@@ -2,11 +2,11 @@ import { objectWithoutProperties as _objectWithoutProperties, extends as _extend
2
2
  import * as React from 'react';
3
3
  import classnames from 'classnames';
4
4
  import { useSelect } from '../context/SelectContext.js';
5
+ import { MrlSvg } from '../../../svg/MrlSvg/MrlSvg.js';
5
6
  import { check } from '@muraldevkit/ds-icons';
6
7
  import styles from './MrlLegacySelectItem.module.scss.js';
7
8
  import { useMrlTrackInteraction } from '../../../../hooks/useMrlAnalytics/useMrlAnalytics.js';
8
9
  import { setAttributes } from '../../../../utils/setAttributes/setAttributes.js';
9
- import { MrlSvg } from '../../../svg/MrlSvg/MrlSvg.js';
10
10
 
11
11
  var _excluded = ["attrs", "children", "index", "value", "isDisabled", "eventId"];
12
12
  var getChildText = children => {