carbon-react 162.20.3 → 162.21.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (463) hide show
  1. package/esm/__internal__/character-count/character-count.style.js +1 -1
  2. package/esm/__internal__/checkable-input/checkable-input.style.js +1 -1
  3. package/esm/__internal__/checkable-input/hidden-checkable-input.style.js +1 -1
  4. package/esm/__internal__/error-border/error-border.style.js +1 -1
  5. package/esm/__internal__/field-help/field-help.style.js +1 -1
  6. package/esm/__internal__/fieldset/__next__/fieldset.style.js +1 -1
  7. package/esm/__internal__/fieldset/fieldset.style.js +1 -1
  8. package/esm/__internal__/form-field/form-field.style.js +1 -1
  9. package/esm/__internal__/full-screen-heading/full-screen-heading.style.js +1 -1
  10. package/esm/__internal__/hint-text/hint-text.style.js +1 -1
  11. package/esm/__internal__/input/input.style.js +1 -1
  12. package/esm/__internal__/input-icon-toggle/input-icon-toggle.style.js +1 -1
  13. package/esm/__internal__/label/label.style.js +1 -1
  14. package/esm/__internal__/legacy-error-border/error-border.style.js +1 -1
  15. package/esm/__internal__/legacy-hint-text/hint-text.style.js +1 -1
  16. package/esm/__internal__/legacy-input/input-presentation.style.js +1 -1
  17. package/esm/__internal__/legacy-input/input.style.js +1 -1
  18. package/esm/__internal__/legacy-label/icon-wrapper.style.js +1 -1
  19. package/esm/__internal__/legacy-label/label.style.js +1 -1
  20. package/esm/__internal__/modal/modal.style.js +1 -1
  21. package/esm/__internal__/popover/popover.style.js +1 -1
  22. package/esm/__internal__/popover-menu/hooks/index.d.ts +1 -0
  23. package/esm/__internal__/popover-menu/hooks/useHandleDropdownMenuKeyDown.d.ts +7 -1
  24. package/esm/__internal__/popover-menu/hooks/useHandleDropdownMenuKeyDown.js +1 -1
  25. package/esm/__internal__/popover-menu/menu-item/menu-item-content/menu-item-label.component.js +1 -1
  26. package/esm/__internal__/popover-menu/menu-item/menu-item-content/menu-item-leading.component.js +1 -1
  27. package/esm/__internal__/popover-menu/menu-item/menu-item-content/menu-item-subtext.component.js +1 -1
  28. package/esm/__internal__/popover-menu/menu-item/menu-item-divider/menu-item-divider.component.js +1 -1
  29. package/esm/__internal__/popover-menu/menu-item/menu-item-heading/menu-item-heading.component.js +1 -1
  30. package/esm/__internal__/popover-menu/menu-item/menu-item.component.js +1 -1
  31. package/esm/__internal__/popover-menu/popover-menu.component.d.ts +6 -1
  32. package/esm/__internal__/popover-menu/popover-menu.component.js +1 -1
  33. package/esm/__internal__/validation-message/__next__/validation-message.style.js +1 -1
  34. package/esm/__internal__/validation-message/validation-message.style.js +1 -1
  35. package/esm/__internal__/validations/validation-icon.style.js +1 -1
  36. package/esm/components/accordion/accordion.style.js +1 -1
  37. package/esm/components/action-popover/__internal__/action-popover.context.d.ts +0 -4
  38. package/esm/components/action-popover/__internal__/action-popover.utils.d.ts +2 -7
  39. package/esm/components/action-popover/__internal__/action-popover.utils.js +1 -1
  40. package/esm/components/action-popover/action-popover-divider/action-popover-divider.component.d.ts +1 -1
  41. package/esm/components/action-popover/action-popover-divider/action-popover-divider.component.js +1 -1
  42. package/esm/components/action-popover/action-popover-item/action-popover-item.component.d.ts +2 -7
  43. package/esm/components/action-popover/action-popover-item/action-popover-item.component.js +1 -1
  44. package/esm/components/action-popover/action-popover-menu/action-popover-menu.component.d.ts +4 -23
  45. package/esm/components/action-popover/action-popover-menu/action-popover-menu.component.js +1 -1
  46. package/esm/components/action-popover/action-popover-menu-button/action-popover-menu-button.component.d.ts +23 -20
  47. package/esm/components/action-popover/action-popover-menu-button/action-popover-menu-button.component.js +1 -1
  48. package/esm/components/action-popover/action-popover.component.d.ts +17 -6
  49. package/esm/components/action-popover/action-popover.component.js +1 -1
  50. package/esm/components/action-popover/action-popover.style.d.ts +1 -21
  51. package/esm/components/action-popover/action-popover.style.js +1 -1
  52. package/esm/components/action-popover/index.js +1 -1
  53. package/esm/components/adaptive-sidebar/adaptive-sidebar.style.js +1 -1
  54. package/esm/components/advanced-color-picker/advanced-color-picker-cell.style.js +1 -1
  55. package/esm/components/advanced-color-picker/advanced-color-picker.style.js +1 -1
  56. package/esm/components/anchor-navigation/anchor-navigation-item/anchor-navigation-item.style.js +1 -1
  57. package/esm/components/anchor-navigation/anchor-navigation.style.js +1 -1
  58. package/esm/components/anchor-navigation/anchor-section-divider.component.js +1 -1
  59. package/esm/components/badge/badge.style.js +1 -1
  60. package/esm/components/batch-selection/batch-selection.style.js +1 -1
  61. package/esm/components/box/box.style.js +1 -1
  62. package/esm/components/breadcrumbs/breadcrumbs.style.js +1 -1
  63. package/esm/components/breadcrumbs/crumb/crumb.style.js +1 -1
  64. package/esm/components/button/__next__/button.style.js +1 -1
  65. package/esm/components/button/button.style.js +1 -1
  66. package/esm/components/button-bar/button-bar.style.js +1 -1
  67. package/esm/components/button-minor/button-minor.style.js +1 -1
  68. package/esm/components/button-toggle/button-toggle-group/button-toggle-group.style.js +1 -1
  69. package/esm/components/button-toggle/button-toggle.style.js +1 -1
  70. package/esm/components/card/card-column/card-column.style.js +1 -1
  71. package/esm/components/card/card-footer/card-footer.style.js +1 -1
  72. package/esm/components/card/card-row/card-row.style.js +1 -1
  73. package/esm/components/card/card.style.js +1 -1
  74. package/esm/components/checkbox/checkbox-group/checkbox-group.style.js +1 -1
  75. package/esm/components/checkbox/checkbox.style.js +1 -1
  76. package/esm/components/confirm/confirm.style.js +1 -1
  77. package/esm/components/content/content.style.js +1 -1
  78. package/esm/components/date/__internal__/calendar/calendar-close-button.style.js +1 -1
  79. package/esm/components/date/__internal__/calendar/calendar-navigation.style.js +1 -1
  80. package/esm/components/date/__internal__/calendar/calendar-select/calendar-select.style.js +1 -1
  81. package/esm/components/date/__internal__/calendar/calendar-weekday.style.js +1 -1
  82. package/esm/components/date/__internal__/date-picker/date-picker.style.js +1 -1
  83. package/esm/components/date/__internal__/date-picker-trigger/date-picker-trigger.style.js +1 -1
  84. package/esm/components/date/date.style.js +1 -1
  85. package/esm/components/date-range/date-range.style.js +1 -1
  86. package/esm/components/decimal/__internal__/decimal-popover-button.style.js +1 -1
  87. package/esm/components/decimal/decimal.style.js +1 -1
  88. package/esm/components/definition-list/definition-list.style.d.ts +1 -1
  89. package/esm/components/definition-list/definition-list.style.js +1 -1
  90. package/esm/components/detail/detail.style.js +1 -1
  91. package/esm/components/dialog/__internal__/__next__/dialog.style.js +1 -1
  92. package/esm/components/dismissible-box/dismissible-box.style.js +1 -1
  93. package/esm/components/divider/divider.style.js +1 -1
  94. package/esm/components/draggable/draggable-item/draggable-item.style.js +1 -1
  95. package/esm/components/drawer/drawer.style.js +1 -1
  96. package/esm/components/duelling-picklist/duelling-picklist.style.js +1 -1
  97. package/esm/components/duelling-picklist/picklist/picklist.style.js +1 -1
  98. package/esm/components/duelling-picklist/picklist-divider/picklist-divider.style.js +1 -1
  99. package/esm/components/duelling-picklist/picklist-group/picklist-group.style.js +1 -1
  100. package/esm/components/duelling-picklist/picklist-item/picklist-item.style.js +1 -1
  101. package/esm/components/fieldset/fieldset.style.js +1 -1
  102. package/esm/components/file-input/__internal__/file-upload-status/file-upload-status.style.js +1 -1
  103. package/esm/components/file-input/file-input.style.js +1 -1
  104. package/esm/components/flat-table/flat-table-body-draggable/flat-table-body-draggable.style.js +1 -1
  105. package/esm/components/flat-table/flat-table-cell/flat-table-cell.style.js +1 -1
  106. package/esm/components/flat-table/flat-table-checkbox/flat-table-checkbox.style.js +1 -1
  107. package/esm/components/flat-table/flat-table-head/flat-table-head.style.js +1 -1
  108. package/esm/components/flat-table/flat-table-header/flat-table-header.style.js +1 -1
  109. package/esm/components/flat-table/flat-table-row/flat-table-row.component.js +1 -1
  110. package/esm/components/flat-table/flat-table-row/flat-table-row.style.js +1 -1
  111. package/esm/components/flat-table/flat-table-row-header/flat-table-row-header.style.js +1 -1
  112. package/esm/components/flat-table/flat-table.style.js +1 -1
  113. package/esm/components/flat-table/sort/sort.style.js +1 -1
  114. package/esm/components/form/__internal__/form-summary.style.js +1 -1
  115. package/esm/components/form/form.style.js +1 -1
  116. package/esm/components/form/required-fields-indicator/required-fields-indicator.component.js +1 -1
  117. package/esm/components/global-header/global-header.component.js +1 -1
  118. package/esm/components/grid/grid-container/grid-container.style.js +1 -1
  119. package/esm/components/grid/grid-item/grid-item.style.js +1 -1
  120. package/esm/components/heading/heading.style.js +1 -1
  121. package/esm/components/help/help.style.js +1 -1
  122. package/esm/components/hr/hr.style.js +1 -1
  123. package/esm/components/icon/icon.style.js +1 -1
  124. package/esm/components/icon-button/icon-button.style.js +1 -1
  125. package/esm/components/image/image.style.js +1 -1
  126. package/esm/components/inline-inputs/inline-inputs.style.js +1 -1
  127. package/esm/components/link/link.style.js +1 -1
  128. package/esm/components/link-preview/__internal__/placeholder.component.js +1 -1
  129. package/esm/components/link-preview/link-preview.style.js +1 -1
  130. package/esm/components/loader/__next__/internal/star.style.js +1 -1
  131. package/esm/components/loader/__next__/loader.style.js +1 -1
  132. package/esm/components/loader/loader-square.style.js +1 -1
  133. package/esm/components/loader/loader.style.js +1 -1
  134. package/esm/components/loader-bar/loader-bar.style.js +1 -1
  135. package/esm/components/loader-spinner/loader-spinner.style.js +1 -1
  136. package/esm/components/loader-star/internal/star.style.js +1 -1
  137. package/esm/components/loader-star/loader-star.style.js +1 -1
  138. package/esm/components/menu/__internal__/submenu/submenu.style.js +1 -1
  139. package/esm/components/menu/menu-divider/menu-divider.style.js +1 -1
  140. package/esm/components/menu/menu-full-screen/menu-full-screen.style.js +1 -1
  141. package/esm/components/menu/menu-item/menu-item.style.js +1 -1
  142. package/esm/components/menu/menu-segment-title/menu-segment-title.style.js +1 -1
  143. package/esm/components/menu/menu.style.js +1 -1
  144. package/esm/components/menu/scrollable-block/scrollable-block.style.js +1 -1
  145. package/esm/components/message/message.style.js +1 -1
  146. package/esm/components/multi-action-button/multi-action-button.style.js +1 -1
  147. package/esm/components/navigation-bar/navigation-bar.style.js +1 -1
  148. package/esm/components/note/note.style.js +1 -1
  149. package/esm/components/numeral-date/numeral-date.style.js +1 -1
  150. package/esm/components/option-tile/option-tile.style.js +1 -1
  151. package/esm/components/pager/__internal__/pagination-navigation.style.js +1 -1
  152. package/esm/components/pager/pager.style.js +1 -1
  153. package/esm/components/pages/page/page.style.js +1 -1
  154. package/esm/components/pages/pages.style.js +1 -1
  155. package/esm/components/password/password.style.js +1 -1
  156. package/esm/components/pill/pill.style.js +1 -1
  157. package/esm/components/pod/pod.style.js +1 -1
  158. package/esm/components/popover-container/popover-container.style.js +1 -1
  159. package/esm/components/portal/portal.js +1 -1
  160. package/esm/components/portal/portal.style.js +1 -1
  161. package/esm/components/portrait/portrait.style.js +1 -1
  162. package/esm/components/preview/preview.style.js +1 -1
  163. package/esm/components/profile/profile.style.js +1 -1
  164. package/esm/components/progress-tracker/progress-tracker.style.js +1 -1
  165. package/esm/components/radio-button/radio-button-group/radio-button-group.style.js +1 -1
  166. package/esm/components/radio-button/radio-button.style.js +1 -1
  167. package/esm/components/search/__internal__/results-announcement.component.js +1 -1
  168. package/esm/components/search/search.component.js +1 -1
  169. package/esm/components/select/__internal__/list-action-button/list-action-button.style.js +1 -1
  170. package/esm/components/select/__internal__/select-list/select-list.style.js +1 -1
  171. package/esm/components/select/__internal__/select-textbox/select-textbox.style.js +1 -1
  172. package/esm/components/select/__internal__/utils/matching-text.style.js +1 -1
  173. package/esm/components/select/multi-select/multi-select.style.js +1 -1
  174. package/esm/components/select/option/option.style.js +1 -1
  175. package/esm/components/select/option-group-header/option-group-header.style.js +1 -1
  176. package/esm/components/select/option-row/option-row.style.js +1 -1
  177. package/esm/components/select/select.style.js +1 -1
  178. package/esm/components/settings-row/settings-row.style.js +1 -1
  179. package/esm/components/sidebar/__internal__/sidebar-content/sidebar-content.style.js +1 -1
  180. package/esm/components/sidebar/__internal__/sidebar-footer/sidebar-footer.style.js +1 -1
  181. package/esm/components/sidebar/__internal__/sidebar-header/sidebar-header.style.js +1 -1
  182. package/esm/components/sidebar/sidebar.style.js +1 -1
  183. package/esm/components/simple-color-picker/simple-color/simple-color.style.js +1 -1
  184. package/esm/components/simple-color-picker/simple-color-picker.style.js +1 -1
  185. package/esm/components/split-button/split-button-toggle.style.js +1 -1
  186. package/esm/components/split-button/split-button.style.js +1 -1
  187. package/esm/components/step-flow/step-flow.style.js +1 -1
  188. package/esm/components/step-sequence/step-sequence-item/step-sequence-item.style.js +1 -1
  189. package/esm/components/step-sequence/step-sequence.style.js +1 -1
  190. package/esm/components/switch/switch.style.js +1 -1
  191. package/esm/components/table/table-body/table-body.component.js +1 -1
  192. package/esm/components/table/table-cell/table-cell.style.js +1 -1
  193. package/esm/components/table/table-foot/table-foot.component.js +1 -1
  194. package/esm/components/table/table-head/table-head.component.js +1 -1
  195. package/esm/components/table/table-header/__internal__/sort/sort.style.js +1 -1
  196. package/esm/components/table/table-header/table-header.style.js +1 -1
  197. package/esm/components/table/table-row/table-row.style.js +1 -1
  198. package/esm/components/table/table.style.js +1 -1
  199. package/esm/components/tabs/__next__/tabs.style.js +1 -1
  200. package/esm/components/text-editor/__internal__/__ui__/CharacterCounter/character-counter.style.js +1 -1
  201. package/esm/components/text-editor/__internal__/__ui__/ContentEditor/content-editor.style.js +1 -1
  202. package/esm/components/text-editor/__internal__/__ui__/Mentions/mentions.style.js +1 -1
  203. package/esm/components/text-editor/__internal__/__ui__/Placeholder/placeholder.style.js +1 -1
  204. package/esm/components/text-editor/__internal__/__ui__/Toolbar/button-group/button-group.style.js +1 -1
  205. package/esm/components/text-editor/__internal__/__ui__/Toolbar/buttons/typography-dropdown/dropdown.style.js +1 -1
  206. package/esm/components/text-editor/__internal__/__ui__/Toolbar/toolbar.style.js +1 -1
  207. package/esm/components/text-editor/text-editor.style.js +1 -1
  208. package/esm/components/textarea/textarea.style.js +1 -1
  209. package/esm/components/textbox/__internal__/__next__/text-input.style.js +1 -1
  210. package/esm/components/tile/tile-footer/tile-footer.style.js +1 -1
  211. package/esm/components/tile/tile.style.js +1 -1
  212. package/esm/components/tile-select/__internal__/accordion/accordion.style.js +1 -1
  213. package/esm/components/tile-select/tile-select.style.js +1 -1
  214. package/esm/components/time/time.style.js +1 -1
  215. package/esm/components/toast/toast.style.js +1 -1
  216. package/esm/components/tokens-wrapper/tokens-wrapper.component.js +1 -1
  217. package/esm/components/tooltip/tooltip-pointer.style.js +1 -1
  218. package/esm/components/tooltip/tooltip.style.js +1 -1
  219. package/esm/components/typography/__internal__/__next__/typography.style.js +1 -1
  220. package/esm/components/typography/typography.style.js +1 -1
  221. package/esm/components/vertical-divider/vertical-divider.style.js +1 -1
  222. package/esm/components/vertical-menu/responsive-vertical-menu/responsive-vertical-menu-divider/responsive-vertical-menu-divider.style.js +1 -1
  223. package/esm/components/vertical-menu/responsive-vertical-menu/responsive-vertical-menu-item/responsive-vertical-menu-item.style.js +1 -1
  224. package/esm/components/vertical-menu/responsive-vertical-menu/responsive-vertical-menu.style.js +1 -1
  225. package/esm/components/vertical-menu/vertical-menu.style.js +1 -1
  226. package/esm/hooks/__internal__/useFloating/useFloating.js +1 -1
  227. package/esm/index.d.ts +2 -0
  228. package/esm/index.js +1 -1
  229. package/esm/locales/en-gb.js +1 -1
  230. package/esm/locales/locale.d.ts +1 -0
  231. package/esm/style/design-tokens/carbon-scoped-tokens-provider/carbon-scoped-tokens-provider.component.js +1 -1
  232. package/lib/__internal__/character-count/character-count.style.js +1 -1
  233. package/lib/__internal__/checkable-input/checkable-input.style.js +1 -1
  234. package/lib/__internal__/checkable-input/hidden-checkable-input.style.js +1 -1
  235. package/lib/__internal__/error-border/error-border.style.js +1 -1
  236. package/lib/__internal__/field-help/field-help.style.js +1 -1
  237. package/lib/__internal__/fieldset/__next__/fieldset.style.js +1 -1
  238. package/lib/__internal__/fieldset/fieldset.style.js +1 -1
  239. package/lib/__internal__/form-field/form-field.style.js +1 -1
  240. package/lib/__internal__/full-screen-heading/full-screen-heading.style.js +1 -1
  241. package/lib/__internal__/hint-text/hint-text.style.js +1 -1
  242. package/lib/__internal__/input/input.style.js +1 -1
  243. package/lib/__internal__/input-icon-toggle/input-icon-toggle.style.js +1 -1
  244. package/lib/__internal__/label/label.style.js +1 -1
  245. package/lib/__internal__/legacy-error-border/error-border.style.js +1 -1
  246. package/lib/__internal__/legacy-hint-text/hint-text.style.js +1 -1
  247. package/lib/__internal__/legacy-input/input-presentation.style.js +1 -1
  248. package/lib/__internal__/legacy-input/input.style.js +1 -1
  249. package/lib/__internal__/legacy-label/icon-wrapper.style.js +1 -1
  250. package/lib/__internal__/legacy-label/label.style.js +1 -1
  251. package/lib/__internal__/modal/modal.style.js +1 -1
  252. package/lib/__internal__/popover/popover.style.js +1 -1
  253. package/lib/__internal__/popover-menu/hooks/index.d.ts +1 -0
  254. package/lib/__internal__/popover-menu/hooks/useHandleDropdownMenuKeyDown.d.ts +7 -1
  255. package/lib/__internal__/popover-menu/hooks/useHandleDropdownMenuKeyDown.js +1 -1
  256. package/lib/__internal__/popover-menu/menu-item/menu-item-content/menu-item-label.component.js +1 -1
  257. package/lib/__internal__/popover-menu/menu-item/menu-item-content/menu-item-leading.component.js +1 -1
  258. package/lib/__internal__/popover-menu/menu-item/menu-item-content/menu-item-subtext.component.js +1 -1
  259. package/lib/__internal__/popover-menu/menu-item/menu-item-divider/menu-item-divider.component.js +1 -1
  260. package/lib/__internal__/popover-menu/menu-item/menu-item-heading/menu-item-heading.component.js +1 -1
  261. package/lib/__internal__/popover-menu/menu-item/menu-item.component.js +1 -1
  262. package/lib/__internal__/popover-menu/popover-menu.component.d.ts +6 -1
  263. package/lib/__internal__/popover-menu/popover-menu.component.js +1 -1
  264. package/lib/__internal__/validation-message/__next__/validation-message.style.js +1 -1
  265. package/lib/__internal__/validation-message/validation-message.style.js +1 -1
  266. package/lib/__internal__/validations/validation-icon.style.js +1 -1
  267. package/lib/components/accordion/accordion.style.js +1 -1
  268. package/lib/components/action-popover/__internal__/action-popover.context.d.ts +0 -4
  269. package/lib/components/action-popover/__internal__/action-popover.utils.d.ts +2 -7
  270. package/lib/components/action-popover/__internal__/action-popover.utils.js +1 -1
  271. package/lib/components/action-popover/action-popover-divider/action-popover-divider.component.d.ts +1 -1
  272. package/lib/components/action-popover/action-popover-divider/action-popover-divider.component.js +1 -1
  273. package/lib/components/action-popover/action-popover-item/action-popover-item.component.d.ts +2 -7
  274. package/lib/components/action-popover/action-popover-item/action-popover-item.component.js +1 -1
  275. package/lib/components/action-popover/action-popover-menu/action-popover-menu.component.d.ts +4 -23
  276. package/lib/components/action-popover/action-popover-menu/action-popover-menu.component.js +1 -1
  277. package/lib/components/action-popover/action-popover-menu-button/action-popover-menu-button.component.d.ts +23 -20
  278. package/lib/components/action-popover/action-popover-menu-button/action-popover-menu-button.component.js +1 -1
  279. package/lib/components/action-popover/action-popover.component.d.ts +17 -6
  280. package/lib/components/action-popover/action-popover.component.js +1 -1
  281. package/lib/components/action-popover/action-popover.style.d.ts +1 -21
  282. package/lib/components/action-popover/action-popover.style.js +1 -1
  283. package/lib/components/action-popover/index.js +1 -1
  284. package/lib/components/adaptive-sidebar/adaptive-sidebar.style.js +1 -1
  285. package/lib/components/advanced-color-picker/advanced-color-picker-cell.style.js +1 -1
  286. package/lib/components/advanced-color-picker/advanced-color-picker.style.js +1 -1
  287. package/lib/components/anchor-navigation/anchor-navigation-item/anchor-navigation-item.style.js +1 -1
  288. package/lib/components/anchor-navigation/anchor-navigation.style.js +1 -1
  289. package/lib/components/anchor-navigation/anchor-section-divider.component.js +1 -1
  290. package/lib/components/badge/badge.style.js +1 -1
  291. package/lib/components/batch-selection/batch-selection.style.js +1 -1
  292. package/lib/components/box/box.style.js +1 -1
  293. package/lib/components/breadcrumbs/breadcrumbs.style.js +1 -1
  294. package/lib/components/breadcrumbs/crumb/crumb.style.js +1 -1
  295. package/lib/components/button/__next__/button.style.js +1 -1
  296. package/lib/components/button/button.style.js +1 -1
  297. package/lib/components/button-bar/button-bar.style.js +1 -1
  298. package/lib/components/button-minor/button-minor.style.js +1 -1
  299. package/lib/components/button-toggle/button-toggle-group/button-toggle-group.style.js +1 -1
  300. package/lib/components/button-toggle/button-toggle.style.js +1 -1
  301. package/lib/components/card/card-column/card-column.style.js +1 -1
  302. package/lib/components/card/card-footer/card-footer.style.js +1 -1
  303. package/lib/components/card/card-row/card-row.style.js +1 -1
  304. package/lib/components/card/card.style.js +1 -1
  305. package/lib/components/checkbox/checkbox-group/checkbox-group.style.js +1 -1
  306. package/lib/components/checkbox/checkbox.style.js +1 -1
  307. package/lib/components/confirm/confirm.style.js +1 -1
  308. package/lib/components/content/content.style.js +1 -1
  309. package/lib/components/date/__internal__/calendar/calendar-close-button.style.js +1 -1
  310. package/lib/components/date/__internal__/calendar/calendar-navigation.style.js +1 -1
  311. package/lib/components/date/__internal__/calendar/calendar-select/calendar-select.style.js +1 -1
  312. package/lib/components/date/__internal__/calendar/calendar-weekday.style.js +1 -1
  313. package/lib/components/date/__internal__/date-picker/date-picker.style.js +1 -1
  314. package/lib/components/date/__internal__/date-picker-trigger/date-picker-trigger.style.js +1 -1
  315. package/lib/components/date/date.style.js +1 -1
  316. package/lib/components/date-range/date-range.style.js +1 -1
  317. package/lib/components/decimal/__internal__/decimal-popover-button.style.js +1 -1
  318. package/lib/components/decimal/decimal.style.js +1 -1
  319. package/lib/components/definition-list/definition-list.style.d.ts +1 -1
  320. package/lib/components/definition-list/definition-list.style.js +1 -1
  321. package/lib/components/detail/detail.style.js +1 -1
  322. package/lib/components/dialog/__internal__/__next__/dialog.style.js +1 -1
  323. package/lib/components/dismissible-box/dismissible-box.style.js +1 -1
  324. package/lib/components/divider/divider.style.js +1 -1
  325. package/lib/components/draggable/draggable-item/draggable-item.style.js +1 -1
  326. package/lib/components/drawer/drawer.style.js +1 -1
  327. package/lib/components/duelling-picklist/duelling-picklist.style.js +1 -1
  328. package/lib/components/duelling-picklist/picklist/picklist.style.js +1 -1
  329. package/lib/components/duelling-picklist/picklist-divider/picklist-divider.style.js +1 -1
  330. package/lib/components/duelling-picklist/picklist-group/picklist-group.style.js +1 -1
  331. package/lib/components/duelling-picklist/picklist-item/picklist-item.style.js +1 -1
  332. package/lib/components/fieldset/fieldset.style.js +1 -1
  333. package/lib/components/file-input/__internal__/file-upload-status/file-upload-status.style.js +1 -1
  334. package/lib/components/file-input/file-input.style.js +1 -1
  335. package/lib/components/flat-table/flat-table-body-draggable/flat-table-body-draggable.style.js +1 -1
  336. package/lib/components/flat-table/flat-table-cell/flat-table-cell.style.js +1 -1
  337. package/lib/components/flat-table/flat-table-checkbox/flat-table-checkbox.style.js +1 -1
  338. package/lib/components/flat-table/flat-table-head/flat-table-head.style.js +1 -1
  339. package/lib/components/flat-table/flat-table-header/flat-table-header.style.js +1 -1
  340. package/lib/components/flat-table/flat-table-row/flat-table-row.component.js +1 -1
  341. package/lib/components/flat-table/flat-table-row/flat-table-row.style.js +1 -1
  342. package/lib/components/flat-table/flat-table-row-header/flat-table-row-header.style.js +1 -1
  343. package/lib/components/flat-table/flat-table.style.js +1 -1
  344. package/lib/components/flat-table/sort/sort.style.js +1 -1
  345. package/lib/components/form/__internal__/form-summary.style.js +1 -1
  346. package/lib/components/form/form.style.js +1 -1
  347. package/lib/components/form/required-fields-indicator/required-fields-indicator.component.js +1 -1
  348. package/lib/components/global-header/global-header.component.js +1 -1
  349. package/lib/components/grid/grid-container/grid-container.style.js +1 -1
  350. package/lib/components/grid/grid-item/grid-item.style.js +1 -1
  351. package/lib/components/heading/heading.style.js +1 -1
  352. package/lib/components/help/help.style.js +1 -1
  353. package/lib/components/hr/hr.style.js +1 -1
  354. package/lib/components/icon/icon.style.js +1 -1
  355. package/lib/components/icon-button/icon-button.style.js +1 -1
  356. package/lib/components/image/image.style.js +1 -1
  357. package/lib/components/inline-inputs/inline-inputs.style.js +1 -1
  358. package/lib/components/link/link.style.js +1 -1
  359. package/lib/components/link-preview/__internal__/placeholder.component.js +1 -1
  360. package/lib/components/link-preview/link-preview.style.js +1 -1
  361. package/lib/components/loader/__next__/internal/star.style.js +1 -1
  362. package/lib/components/loader/__next__/loader.style.js +1 -1
  363. package/lib/components/loader/loader-square.style.js +1 -1
  364. package/lib/components/loader/loader.style.js +1 -1
  365. package/lib/components/loader-bar/loader-bar.style.js +1 -1
  366. package/lib/components/loader-spinner/loader-spinner.style.js +1 -1
  367. package/lib/components/loader-star/internal/star.style.js +1 -1
  368. package/lib/components/loader-star/loader-star.style.js +1 -1
  369. package/lib/components/menu/__internal__/submenu/submenu.style.js +1 -1
  370. package/lib/components/menu/menu-divider/menu-divider.style.js +1 -1
  371. package/lib/components/menu/menu-full-screen/menu-full-screen.style.js +1 -1
  372. package/lib/components/menu/menu-item/menu-item.style.js +1 -1
  373. package/lib/components/menu/menu-segment-title/menu-segment-title.style.js +1 -1
  374. package/lib/components/menu/menu.style.js +1 -1
  375. package/lib/components/menu/scrollable-block/scrollable-block.style.js +1 -1
  376. package/lib/components/message/message.style.js +1 -1
  377. package/lib/components/multi-action-button/multi-action-button.style.js +1 -1
  378. package/lib/components/navigation-bar/navigation-bar.style.js +1 -1
  379. package/lib/components/note/note.style.js +1 -1
  380. package/lib/components/numeral-date/numeral-date.style.js +1 -1
  381. package/lib/components/option-tile/option-tile.style.js +1 -1
  382. package/lib/components/pager/__internal__/pagination-navigation.style.js +1 -1
  383. package/lib/components/pager/pager.style.js +1 -1
  384. package/lib/components/pages/page/page.style.js +1 -1
  385. package/lib/components/pages/pages.style.js +1 -1
  386. package/lib/components/password/password.style.js +1 -1
  387. package/lib/components/pill/pill.style.js +1 -1
  388. package/lib/components/pod/pod.style.js +1 -1
  389. package/lib/components/popover-container/popover-container.style.js +1 -1
  390. package/lib/components/portal/portal.js +1 -1
  391. package/lib/components/portal/portal.style.js +1 -1
  392. package/lib/components/portrait/portrait.style.js +1 -1
  393. package/lib/components/preview/preview.style.js +1 -1
  394. package/lib/components/profile/profile.style.js +1 -1
  395. package/lib/components/progress-tracker/progress-tracker.style.js +1 -1
  396. package/lib/components/radio-button/radio-button-group/radio-button-group.style.js +1 -1
  397. package/lib/components/radio-button/radio-button.style.js +1 -1
  398. package/lib/components/search/__internal__/results-announcement.component.js +1 -1
  399. package/lib/components/search/search.component.js +1 -1
  400. package/lib/components/select/__internal__/list-action-button/list-action-button.style.js +1 -1
  401. package/lib/components/select/__internal__/select-list/select-list.style.js +1 -1
  402. package/lib/components/select/__internal__/select-textbox/select-textbox.style.js +1 -1
  403. package/lib/components/select/__internal__/utils/matching-text.style.js +1 -1
  404. package/lib/components/select/multi-select/multi-select.style.js +1 -1
  405. package/lib/components/select/option/option.style.js +1 -1
  406. package/lib/components/select/option-group-header/option-group-header.style.js +1 -1
  407. package/lib/components/select/option-row/option-row.style.js +1 -1
  408. package/lib/components/select/select.style.js +1 -1
  409. package/lib/components/settings-row/settings-row.style.js +1 -1
  410. package/lib/components/sidebar/__internal__/sidebar-content/sidebar-content.style.js +1 -1
  411. package/lib/components/sidebar/__internal__/sidebar-footer/sidebar-footer.style.js +1 -1
  412. package/lib/components/sidebar/__internal__/sidebar-header/sidebar-header.style.js +1 -1
  413. package/lib/components/sidebar/sidebar.style.js +1 -1
  414. package/lib/components/simple-color-picker/simple-color/simple-color.style.js +1 -1
  415. package/lib/components/simple-color-picker/simple-color-picker.style.js +1 -1
  416. package/lib/components/split-button/split-button-toggle.style.js +1 -1
  417. package/lib/components/split-button/split-button.style.js +1 -1
  418. package/lib/components/step-flow/step-flow.style.js +1 -1
  419. package/lib/components/step-sequence/step-sequence-item/step-sequence-item.style.js +1 -1
  420. package/lib/components/step-sequence/step-sequence.style.js +1 -1
  421. package/lib/components/switch/switch.style.js +1 -1
  422. package/lib/components/table/table-body/table-body.component.js +1 -1
  423. package/lib/components/table/table-cell/table-cell.style.js +1 -1
  424. package/lib/components/table/table-foot/table-foot.component.js +1 -1
  425. package/lib/components/table/table-head/table-head.component.js +1 -1
  426. package/lib/components/table/table-header/__internal__/sort/sort.style.js +1 -1
  427. package/lib/components/table/table-header/table-header.style.js +1 -1
  428. package/lib/components/table/table-row/table-row.style.js +1 -1
  429. package/lib/components/table/table.style.js +1 -1
  430. package/lib/components/tabs/__next__/tabs.style.js +1 -1
  431. package/lib/components/text-editor/__internal__/__ui__/CharacterCounter/character-counter.style.js +1 -1
  432. package/lib/components/text-editor/__internal__/__ui__/ContentEditor/content-editor.style.js +1 -1
  433. package/lib/components/text-editor/__internal__/__ui__/Mentions/mentions.style.js +1 -1
  434. package/lib/components/text-editor/__internal__/__ui__/Placeholder/placeholder.style.js +1 -1
  435. package/lib/components/text-editor/__internal__/__ui__/Toolbar/button-group/button-group.style.js +1 -1
  436. package/lib/components/text-editor/__internal__/__ui__/Toolbar/buttons/typography-dropdown/dropdown.style.js +1 -1
  437. package/lib/components/text-editor/__internal__/__ui__/Toolbar/toolbar.style.js +1 -1
  438. package/lib/components/text-editor/text-editor.style.js +1 -1
  439. package/lib/components/textarea/textarea.style.js +1 -1
  440. package/lib/components/textbox/__internal__/__next__/text-input.style.js +1 -1
  441. package/lib/components/tile/tile-footer/tile-footer.style.js +1 -1
  442. package/lib/components/tile/tile.style.js +1 -1
  443. package/lib/components/tile-select/__internal__/accordion/accordion.style.js +1 -1
  444. package/lib/components/tile-select/tile-select.style.js +1 -1
  445. package/lib/components/time/time.style.js +1 -1
  446. package/lib/components/toast/toast.style.js +1 -1
  447. package/lib/components/tokens-wrapper/tokens-wrapper.component.js +1 -1
  448. package/lib/components/tooltip/tooltip-pointer.style.js +1 -1
  449. package/lib/components/tooltip/tooltip.style.js +1 -1
  450. package/lib/components/typography/__internal__/__next__/typography.style.js +1 -1
  451. package/lib/components/typography/typography.style.js +1 -1
  452. package/lib/components/vertical-divider/vertical-divider.style.js +1 -1
  453. package/lib/components/vertical-menu/responsive-vertical-menu/responsive-vertical-menu-divider/responsive-vertical-menu-divider.style.js +1 -1
  454. package/lib/components/vertical-menu/responsive-vertical-menu/responsive-vertical-menu-item/responsive-vertical-menu-item.style.js +1 -1
  455. package/lib/components/vertical-menu/responsive-vertical-menu/responsive-vertical-menu.style.js +1 -1
  456. package/lib/components/vertical-menu/vertical-menu.style.js +1 -1
  457. package/lib/hooks/__internal__/useFloating/useFloating.js +1 -1
  458. package/lib/index.d.ts +2 -0
  459. package/lib/index.js +1 -1
  460. package/lib/locales/en-gb.js +1 -1
  461. package/lib/locales/locale.d.ts +1 -0
  462. package/lib/style/design-tokens/carbon-scoped-tokens-provider/carbon-scoped-tokens-provider.component.js +1 -1
  463. package/package.json +2 -2
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components");function t(e){return e&&e.__esModule?e:{default:e}}var a=t(e);const i=a.default.label.withConfig({displayName:"label.style__StyledLabel",componentId:"carbon_v162_20_2__sc-1af3965d-0"})([""," display:block;font-weight:var(--fontWeights500);"," "," ",""],(({isDarkBackground:t})=>e.css(["color:",";"],t?"var(--colorsUtilityYang100)":"var(--colorsUtilityYin090)")),(({isLarge:t})=>t&&e.css(["font-size:var(--fontSizes200);"])),(({isRequired:t})=>t&&e.css(['::after{content:"*";color:var(--colorsSemanticNegative500);font-weight:var(--fontWeights500);margin-left:var(--spacing050);}'])),(({disabled:t})=>t&&e.css(["color:var(--input-labelset-label-disabled);"]))),s=a.default.div.withConfig({displayName:"label.style__StyledLabelContainer",componentId:"carbon_v162_20_2__sc-1af3965d-1"})(["display:flex;align-items:center;margin-bottom:8px;.fieldset-content &{margin-bottom:var(--global-space-comp-xs);}"," ",""],(({align:t})=>e.css(["justify-content:",";"],"right"!==t?"flex-start":"flex-end")),(({inline:t,pr:a,width:i})=>t&&e.css(["box-sizing:border-box;margin-bottom:0;",";width:","%;"],a&&e.css(["padding-right:var(",");"],1===a?"--spacing100":"--spacing200"),i)));exports.StyledLabelContainer=s,exports.default=i;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components");function t(e){return e&&e.__esModule?e:{default:e}}var a=t(e);const i=a.default.label.withConfig({displayName:"label.style__StyledLabel",componentId:"carbon_v162_21_0__sc-1af3965d-0"})([""," display:block;font-weight:var(--fontWeights500);"," "," ",""],(({isDarkBackground:t})=>e.css(["color:",";"],t?"var(--colorsUtilityYang100)":"var(--colorsUtilityYin090)")),(({isLarge:t})=>t&&e.css(["font-size:var(--fontSizes200);"])),(({isRequired:t})=>t&&e.css(['::after{content:"*";color:var(--colorsSemanticNegative500);font-weight:var(--fontWeights500);margin-left:var(--spacing050);}'])),(({disabled:t})=>t&&e.css(["color:var(--input-labelset-label-disabled);"]))),s=a.default.div.withConfig({displayName:"label.style__StyledLabelContainer",componentId:"carbon_v162_21_0__sc-1af3965d-1"})(["display:flex;align-items:center;margin-bottom:8px;.fieldset-content &{margin-bottom:var(--global-space-comp-xs);}"," ",""],(({align:t})=>e.css(["justify-content:",";"],"right"!==t?"flex-start":"flex-end")),(({inline:t,pr:a,width:i})=>t&&e.css(["box-sizing:border-box;margin-bottom:0;",";width:","%;"],a&&e.css(["padding-right:var(",");"],1===a?"--spacing100":"--spacing200"),i)));exports.StyledLabelContainer=s,exports.default=i;
@@ -1 +1 @@
1
- "use strict";var t=require("styled-components"),e=require("../../style/themes/apply-base-theme.js");function a(t){return t&&t.__esModule?t:{default:t}}var i=a(t);const o=i.default.div.withConfig({displayName:"modal.style__StyledModalBackground",componentId:"carbon_v162_20_2__sc-1ca46940-0"})(["background-color:var(--container-standard-dimmer);bottom:0;left:0;position:fixed;right:0;top:0;",";"],(({transitionName:e,transitionTime:a})=>t.css(["&.","-enter,.","-appear{opacity:0;}&.","-enter.","-enter-active,&.","-appear.","-appear-active{opacity:1;transition:opacity ","ms ease-out;}&.","-exit.","-exit-active{opacity:0;transition:opacity ","ms 100ms ease-out;}"],e,e,e,e,e,e,a,e,e,a))),n=i.default.div.attrs(e.default).withConfig({displayName:"modal.style__StyledModal",componentId:"carbon_v162_20_2__sc-1ca46940-1"})(["position:absolute;z-index:",";",""],(({theme:t,topModalOverride:e})=>`${e?t.zIndex.notification:t.zIndex.modal}`),(({transitionName:e,transitionTime:a})=>t.css([".","-enter,.","-appear{opacity:0;}.","-enter.","-enter-active,.","-appear.","-appear-active{opacity:1;transition:all ","ms 100ms ease-out;}.","-exit.","-exit-active{opacity:0;transition:all ","ms ease-out;}"],e,e,e,e,e,e,a,e,e,a)));exports.StyledModal=n,exports.StyledModalBackground=o;
1
+ "use strict";var t=require("styled-components"),e=require("../../style/themes/apply-base-theme.js");function a(t){return t&&t.__esModule?t:{default:t}}var i=a(t);const o=i.default.div.withConfig({displayName:"modal.style__StyledModalBackground",componentId:"carbon_v162_21_0__sc-1ca46940-0"})(["background-color:var(--container-standard-dimmer);bottom:0;left:0;position:fixed;right:0;top:0;",";"],(({transitionName:e,transitionTime:a})=>t.css(["&.","-enter,.","-appear{opacity:0;}&.","-enter.","-enter-active,&.","-appear.","-appear-active{opacity:1;transition:opacity ","ms ease-out;}&.","-exit.","-exit-active{opacity:0;transition:opacity ","ms 100ms ease-out;}"],e,e,e,e,e,e,a,e,e,a))),n=i.default.div.attrs(e.default).withConfig({displayName:"modal.style__StyledModal",componentId:"carbon_v162_21_0__sc-1ca46940-1"})(["position:absolute;z-index:",";",""],(({theme:t,topModalOverride:e})=>`${e?t.zIndex.notification:t.zIndex.modal}`),(({transitionName:e,transitionTime:a})=>t.css([".","-enter,.","-appear{opacity:0;}.","-enter.","-enter-active,.","-appear.","-appear-active{opacity:1;transition:all ","ms 100ms ease-out;}.","-exit.","-exit-active{opacity:0;transition:all ","ms ease-out;}"],e,e,e,e,e,e,a,e,e,a)));exports.StyledModal=n,exports.StyledModalBackground=o;
@@ -1 +1 @@
1
- "use strict";var e=require("styled-components"),t=require("../../style/themes/apply-base-theme.js");function o(e){return e&&e.__esModule?e:{default:e}}var d=o(e);const r=d.default.div.attrs(t.default).withConfig({displayName:"popover.style__StyledBackdrop",componentId:"carbon_v162_20_2__sc-fb4df9e5-0"})(["bottom:0;left:0;position:fixed;right:0;top:0;z-index:var( --adaptiveSidebarModalBackdrop,"," );background:transparent;"],(({theme:e})=>e.zIndex.popover)),a=d.default.div.withConfig({displayName:"popover.style__StyledPopoverContent",componentId:"carbon_v162_20_2__sc-fb4df9e5-1"})(["",""],(({hide:e})=>e&&"display: none;"));exports.StyledBackdrop=r,exports.StyledPopoverContent=a;
1
+ "use strict";var e=require("styled-components"),t=require("../../style/themes/apply-base-theme.js");function o(e){return e&&e.__esModule?e:{default:e}}var d=o(e);const r=d.default.div.attrs(t.default).withConfig({displayName:"popover.style__StyledBackdrop",componentId:"carbon_v162_21_0__sc-fb4df9e5-0"})(["bottom:0;left:0;position:fixed;right:0;top:0;z-index:var( --adaptiveSidebarModalBackdrop,"," );background:transparent;"],(({theme:e})=>e.zIndex.popover)),a=d.default.div.withConfig({displayName:"popover.style__StyledPopoverContent",componentId:"carbon_v162_21_0__sc-fb4df9e5-1"})(["",""],(({hide:e})=>e&&"display: none;"));exports.StyledBackdrop=r,exports.StyledPopoverContent=a;
@@ -1 +1,2 @@
1
1
  export { useHandleDropdownMenuKeyDown, setFocus, } from "./useHandleDropdownMenuKeyDown";
2
+ export type { TypeaheadHandler } from "./useHandleDropdownMenuKeyDown";
@@ -1,7 +1,13 @@
1
1
  import { MutableRefObject } from "react";
2
2
  export declare const setFocus: (el?: HTMLElement, highlightedItem?: HTMLElement, isButtonMenu?: boolean) => void;
3
+ export interface TypeaheadHandler {
4
+ ev: React.KeyboardEvent<HTMLElement>;
5
+ items: HTMLElement[];
6
+ setAriaActivedescendant: React.Dispatch<React.SetStateAction<string>>;
7
+ focus: typeof setFocus;
8
+ }
3
9
  export declare const useHandleDropdownMenuKeyDown: (ref: MutableRefObject<HTMLUListElement | null>, setAriaActivedescendant: React.Dispatch<React.SetStateAction<string>>, onClose: (e?: Event) => void, submenuOptions: {
4
10
  isButtonMenu?: boolean;
5
11
  isSubmenu?: boolean;
6
12
  controlReference?: React.RefObject<HTMLLIElement>;
7
- }) => (ev: React.KeyboardEvent<HTMLElement>) => void;
13
+ }, typeahead?: (args: TypeaheadHandler) => void) => (ev: React.KeyboardEvent<HTMLElement>) => void;
@@ -1 +1 @@
1
- "use strict";var e=require("react"),t=require("../utils/index.js");const n=(e,t,n)=>{var l;n?null==e||e.focus():(null==t||t.setAttribute("data-has-focus","false"),null==e||e.setAttribute("data-has-focus","true"),null==e||null===(l=e.scrollIntoView)||void 0===l||l.call(e,{block:"nearest",inline:"nearest"}))};exports.setFocus=n,exports.useHandleDropdownMenuKeyDown=(l,o,i,r)=>e.useCallback((e=>{var u,d;const a=null===(u=document.activeElement)||void 0===u?void 0:u.closest('[data-component="scroll-wrapper"]');if(a&&!a.contains(l.current))return;const{isButtonMenu:v,isSubmenu:s}=r,c=Array.from((null===(d=l.current)||void 0===d?void 0:d.querySelectorAll(v?t.buttonMenuItemQuerySelector(s):t.itemQuerySelector(s)))||[]),f=c[0],p=c[c.length-1],m=v?c.find((e=>e.contains(document.activeElement))):c.find((e=>"true"===e.getAttribute("data-has-focus"))),y=c.find((e=>"true"===e.getAttribute("aria-selected")));if("ArrowDown"===e.key){if(e.preventDefault(),e.stopPropagation(),!m){const e=null!=y?y:f;var g;return o(null!==(g=null==e?void 0:e.id)&&void 0!==g?g:""),void n(e,m,v)}var h;if(!v&&p===m)return o(null!==(h=null==f?void 0:f.id)&&void 0!==h?h:""),void n(f,m,v);const t=c.indexOf(m),l=c[v?Math.min(t+1,c.length-1):(t+1)%c.length];var b;return o(null!==(b=null==l?void 0:l.id)&&void 0!==b?b:""),void n(l,m,v)}if("ArrowUp"===e.key){if(e.preventDefault(),e.stopPropagation(),!m){const e=null!=y?y:p;var k;return o(null!==(k=null==e?void 0:e.id)&&void 0!==k?k:""),void n(e,m,v)}var A;if(!v&&f===m)return o(null!==(A=null==p?void 0:p.id)&&void 0!==A?A:""),void n(p,m,v);const t=c.indexOf(m),l=c[v?Math.max(t-1,0):(t-1+c.length)%c.length];var D;return o(null!==(D=null==l?void 0:l.id)&&void 0!==D?D:""),void n(l,m,v)}var w,x;return"Home"===e.key?(e.preventDefault(),o(null!==(w=null==f?void 0:f.id)&&void 0!==w?w:""),void n(f,m,v)):"End"===e.key?(e.preventDefault(),o(null!==(x=null==p?void 0:p.id)&&void 0!==x?x:""),void n(p,m,v)):("Enter"!==e.key||v||m&&(e.preventDefault(),e.stopPropagation(),m.click()),void("Tab"!==e.key||i(e.nativeEvent)))}),[l,o,i,r]);
1
+ "use strict";var e=require("react"),t=require("../utils/index.js");const n=(e,t,n)=>{var l;n?null==e||e.focus():(null==t||t.setAttribute("data-has-focus","false"),null==e||e.setAttribute("data-has-focus","true"),null==e||null===(l=e.scrollIntoView)||void 0===l||l.call(e,{block:"nearest",inline:"nearest"}))};exports.setFocus=n,exports.useHandleDropdownMenuKeyDown=(l,i,o,r,u)=>e.useCallback((e=>{var d,a;const v=null===(d=document.activeElement)||void 0===d?void 0:d.closest('[data-component="scroll-wrapper"]');if(v&&!v.contains(l.current))return;const{isButtonMenu:s,isSubmenu:c}=r,f=Array.from((null===(a=l.current)||void 0===a?void 0:a.querySelectorAll(s?t.buttonMenuItemQuerySelector(c):t.itemQuerySelector(c)))||[]),p=f[0],m=f[f.length-1],y=s?f.find((e=>e.contains(document.activeElement))):f.find((e=>"true"===e.getAttribute("data-has-focus"))),g=f.find((e=>"true"===e.getAttribute("aria-selected")));if(u&&u({ev:e,items:f,setAriaActivedescendant:i,focus:n}),"ArrowDown"===e.key){if(e.preventDefault(),e.stopPropagation(),!y){const e=null!=g?g:p;var h;return i(null!==(h=null==e?void 0:e.id)&&void 0!==h?h:""),void n(e,y,s)}var A;if(!s&&m===y)return i(null!==(A=null==p?void 0:p.id)&&void 0!==A?A:""),void n(p,y,s);const t=f.indexOf(y),l=f[s?Math.min(t+1,f.length-1):(t+1)%f.length];var b;return i(null!==(b=null==l?void 0:l.id)&&void 0!==b?b:""),void n(l,y,s)}if("ArrowUp"===e.key){if(e.preventDefault(),e.stopPropagation(),!y){const e=null!=g?g:m;var k;return i(null!==(k=null==e?void 0:e.id)&&void 0!==k?k:""),void n(e,y,s)}var D;if(!s&&p===y)return i(null!==(D=null==m?void 0:m.id)&&void 0!==D?D:""),void n(m,y,s);const t=f.indexOf(y),l=f[s?Math.max(t-1,0):(t-1+f.length)%f.length];var w;return i(null!==(w=null==l?void 0:l.id)&&void 0!==w?w:""),void n(l,y,s)}var x,E;return"Home"===e.key?(e.preventDefault(),i(null!==(x=null==p?void 0:p.id)&&void 0!==x?x:""),void n(p,y,s)):"End"===e.key?(e.preventDefault(),i(null!==(E=null==m?void 0:m.id)&&void 0!==E?E:""),void n(m,y,s)):("Enter"!==e.key||s||y&&(e.preventDefault(),e.stopPropagation(),y.click()),void("Tab"!==e.key||o(e.nativeEvent)))}),[l,i,o,r,u]);
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("styled-components"),r=require("../../contexts/popover-menu.context.js");function o(e){return e&&e.__esModule?e:{default:e}}require("../../contexts/menu-heading.context.js"),require("../../contexts/menu-item.context.js");const i=o(n).default.span.withConfig({displayName:"menu-item-label.component__StyledMenuItemLabel",componentId:"carbon_v162_20_2__sc-3e81ec8-0"})(["grid-column:-2 / -1;grid-row:1;",""],(({$size:e})=>n.css(["span.menu-item-label-prefix{font:var(--global-font-static-comp-medium-",");}"],e.charAt(0)))),s=({children:n,prefix:o})=>{const{size:s}=t.useContext(r.PopoverMenuContext);return e.jsxs(i,{"data-element":"menu-item-label",$size:s,children:[o&&e.jsx("span",{"data-element":"menu-item-label-prefix",className:"menu-item-label-prefix",children:o}),n]})};s.displayName="PopoverMenuItemLabel",exports.default=s;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("styled-components"),r=require("../../contexts/popover-menu.context.js");function o(e){return e&&e.__esModule?e:{default:e}}require("../../contexts/menu-heading.context.js"),require("../../contexts/menu-item.context.js");const i=o(n).default.span.withConfig({displayName:"menu-item-label.component__StyledMenuItemLabel",componentId:"carbon_v162_21_0__sc-3e81ec8-0"})(["grid-column:-2 / -1;grid-row:1;",""],(({$size:e})=>n.css(["span.menu-item-label-prefix{font:var(--global-font-static-comp-medium-",");}"],e.charAt(0)))),s=({children:n,prefix:o})=>{const{size:s}=t.useContext(r.PopoverMenuContext);return e.jsxs(i,{"data-element":"menu-item-label",$size:s,children:[o&&e.jsx("span",{"data-element":"menu-item-label-prefix",className:"menu-item-label-prefix",children:o}),n]})};s.displayName="PopoverMenuItemLabel",exports.default=s;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react"),t=require("styled-components"),o=require("../../contexts/popover-menu.context.js");require("../../contexts/menu-heading.context.js"),require("../../contexts/menu-item.context.js");var i=require("../../../../components/icon/icon.component.js");function c(e){return e&&e.__esModule?e:{default:e}}require("../../../../components/icon/icon.style.js");var r=c(t);const a=r.default.span.withConfig({displayName:"menu-item-leading.component__StyledMenuItemLeading",componentId:"carbon_v162_20_2__sc-38bfc3f-0"})(['display:flex;grid-row:1;[data-component="icon"]{width:20px;height:20px;}']),s=r.default.span.withConfig({displayName:"menu-item-leading.component__StyledSelectedIconWrapper",componentId:"carbon_v162_20_2__sc-38bfc3f-1"})(["",""],(({$hasIcon:e})=>`\n padding: 0 var(--global-space-comp-2-xs);\n visibility: ${e?"visible":"hidden"};\n `)),d=({children:t,selectedIcon:c=!1})=>{const{isButtonMenu:r}=n.useContext(o.PopoverMenuContext);return e.jsxs(a,{className:"menu-item-leading","data-element":"leading",children:[!r&&e.jsx(s,{"data-role":"selected-icon-wrapper",$hasIcon:c,children:e.jsx(i.default,{type:"tick_thick","data-role":"selected-icon"})}),t]})};d.displayName="PopoverMenuItemLeading",exports.default=d;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react"),t=require("styled-components"),o=require("../../contexts/popover-menu.context.js");require("../../contexts/menu-heading.context.js"),require("../../contexts/menu-item.context.js");var i=require("../../../../components/icon/icon.component.js");function c(e){return e&&e.__esModule?e:{default:e}}require("../../../../components/icon/icon.style.js");var r=c(t);const a=r.default.span.withConfig({displayName:"menu-item-leading.component__StyledMenuItemLeading",componentId:"carbon_v162_21_0__sc-38bfc3f-0"})(['display:flex;grid-row:1;[data-component="icon"]{width:20px;height:20px;}']),s=r.default.span.withConfig({displayName:"menu-item-leading.component__StyledSelectedIconWrapper",componentId:"carbon_v162_21_0__sc-38bfc3f-1"})(["",""],(({$hasIcon:e})=>`\n padding: 0 var(--global-space-comp-2-xs);\n visibility: ${e?"visible":"hidden"};\n `)),d=({children:t,selectedIcon:c=!1})=>{const{isButtonMenu:r}=n.useContext(o.PopoverMenuContext);return e.jsxs(a,{className:"menu-item-leading","data-element":"leading",children:[!r&&e.jsx(s,{"data-role":"selected-icon-wrapper",$hasIcon:c,children:e.jsx(i.default,{type:"tick_thick","data-role":"selected-icon"})}),t]})};d.displayName="PopoverMenuItemLeading",exports.default=d;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("styled-components"),o=require("../../contexts/popover-menu.context.js");function r(e){return e&&e.__esModule?e:{default:e}}require("../../contexts/menu-heading.context.js"),require("../../contexts/menu-item.context.js");const s=r(n).default.span.withConfig({displayName:"menu-item-subtext.component__StyledMenuItemSubtext",componentId:"carbon_v162_20_2__sc-8eef9447-0"})(["grid-column:-2 / -1;grid-row:2;color:var(--input-dropdown-label-subtxt);",""],(({$size:e})=>n.css([""," ",""],("small"===e||"medium"===e)&&"\n font: var(--global-font-static-comp-regular-xs);\n ","large"===e&&"\n font: var(--global-font-static-comp-regular-s);\n "))),u=({children:n})=>{const{size:r}=t.useContext(o.PopoverMenuContext);return e.jsx(s,{"data-element":"menu-item-subtext",className:"menu-item-subtext",$size:r,children:n})};u.displayName="PopoverMenuItemSubtext",exports.default=u;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("styled-components"),o=require("../../contexts/popover-menu.context.js");function r(e){return e&&e.__esModule?e:{default:e}}require("../../contexts/menu-heading.context.js"),require("../../contexts/menu-item.context.js");const s=r(n).default.span.withConfig({displayName:"menu-item-subtext.component__StyledMenuItemSubtext",componentId:"carbon_v162_21_0__sc-8eef9447-0"})(["grid-column:-2 / -1;grid-row:2;color:var(--input-dropdown-label-subtxt);",""],(({$size:e})=>n.css([""," ",""],("small"===e||"medium"===e)&&"\n font: var(--global-font-static-comp-regular-xs);\n ","large"===e&&"\n font: var(--global-font-static-comp-regular-s);\n "))),u=({children:n})=>{const{size:r}=t.useContext(o.PopoverMenuContext);return e.jsx(s,{"data-element":"menu-item-subtext",className:"menu-item-subtext",$size:r,children:n})};u.displayName="PopoverMenuItemSubtext",exports.default=u;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");require("react");var r=require("styled-components"),i=require("../../../../components/divider/divider.component.js");function o(e){return e&&e.__esModule?e:{default:e}}const t=o(r).default.li.withConfig({displayName:"menu-item-divider.component__StyledMenuItemDivider",componentId:"carbon_v162_20_2__sc-dae620b3-0"})(["margin:var(--global-space-comp-m);hr{background-color:var(--container-standard-border-default);height:var(--global-borderwidth-xs);}"]),d=()=>e.jsx(t,{"data-component":"popover-menu-divider","aria-hidden":"true",children:e.jsx(i.Divider,{m:0,type:"horizontal"})});d.displayName="PopoverMenuItemDivider",exports.default=d;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");require("react");var r=require("styled-components"),i=require("../../../../components/divider/divider.component.js");function o(e){return e&&e.__esModule?e:{default:e}}const t=o(r).default.li.withConfig({displayName:"menu-item-divider.component__StyledMenuItemDivider",componentId:"carbon_v162_21_0__sc-dae620b3-0"})(["margin:var(--global-space-comp-m);hr{background-color:var(--container-standard-border-default);height:var(--global-borderwidth-xs);}"]),d=()=>e.jsx(t,{"data-component":"popover-menu-divider","aria-hidden":"true",children:e.jsx(i.Divider,{m:0,type:"horizontal"})});d.displayName="PopoverMenuItemDivider",exports.default=d;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("styled-components"),r=require("../../contexts/popover-menu.context.js"),o=require("../../contexts/menu-heading.context.js");require("../../contexts/menu-item.context.js");var i=require("../../../utils/helpers/guid/index.js");function a(e){return e&&e.__esModule?e:{default:e}}var c=a(n);function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){l(e,t,n[t])}))}return e}function u(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}const d=c.default.div.withConfig({displayName:"menu-item-heading.component__StyledMenuHeadingWithIcon",componentId:"carbon_v162_20_2__sc-f76e7b6a-0"})(["display:flex;align-items:center;gap:",";"],(({$size:e})=>"small"===e?"var(--global-space-comp-2-xs)":"var(--global-space-comp-xs)")),p=c.default.li.withConfig({displayName:"menu-item-heading.component__StyledMenuHeading",componentId:"carbon_v162_20_2__sc-f76e7b6a-1"})(['div[data-element="text"]{'," color:var(--input-dropdown-label-alt);}ul{margin:0;padding:0;list-style:none;overflow:hidden;}"],(({$size:e})=>`\n padding: 0 var(--global-space-comp-m);\n font: var(--global-font-static-comp-medium-${e.charAt(0)});\n margin-left: calc(var(--global-space-comp-m) - 2px);\n `)),m=({children:n,text:a,icon:c})=>{const{size:l}=t.useContext(r.PopoverMenuContext),m=t.useRef(`popover-menu-heading-${i.default()}`),f={"data-element":"text",id:m.current};return e.jsxs(p,{"data-component":"popover-menu-item-heading",$size:l,role:"option",children:[c?e.jsxs(d,u(s({"data-role":"text-with-icon",$size:l},f),{children:[c,a]})):e.jsx("div",u(s({},f),{children:a})),e.jsx(o.default.Provider,{value:{headingId:m.current},children:e.jsx("ul",{role:"listbox","aria-label":a,children:n})})]})};m.displayName="PopoverMenuItemHeading",exports.default=m;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("styled-components"),r=require("../../contexts/popover-menu.context.js"),o=require("../../contexts/menu-heading.context.js");require("../../contexts/menu-item.context.js");var i=require("../../../utils/helpers/guid/index.js");function a(e){return e&&e.__esModule?e:{default:e}}var c=a(n);function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){l(e,t,n[t])}))}return e}function u(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}const d=c.default.div.withConfig({displayName:"menu-item-heading.component__StyledMenuHeadingWithIcon",componentId:"carbon_v162_21_0__sc-f76e7b6a-0"})(["display:flex;align-items:center;gap:",";"],(({$size:e})=>"small"===e?"var(--global-space-comp-2-xs)":"var(--global-space-comp-xs)")),p=c.default.li.withConfig({displayName:"menu-item-heading.component__StyledMenuHeading",componentId:"carbon_v162_21_0__sc-f76e7b6a-1"})(['div[data-element="text"]{'," color:var(--input-dropdown-label-alt);}ul{margin:0;padding:0;list-style:none;overflow:hidden;}"],(({$size:e})=>`\n padding: 0 var(--global-space-comp-m);\n font: var(--global-font-static-comp-medium-${e.charAt(0)});\n margin-left: calc(var(--global-space-comp-m) - 2px);\n `)),m=({children:n,text:a,icon:c})=>{const{size:l}=t.useContext(r.PopoverMenuContext),m=t.useRef(`popover-menu-heading-${i.default()}`),f={"data-element":"text",id:m.current};return e.jsxs(p,{"data-component":"popover-menu-item-heading",$size:l,role:"option",children:[c?e.jsxs(d,u(s({"data-role":"text-with-icon",$size:l},f),{children:[c,a]})):e.jsx("div",u(s({},f),{children:a})),e.jsx(o.default.Provider,{value:{headingId:m.current},children:e.jsx("ul",{role:"listbox","aria-label":a,children:n})})]})};m.displayName="PopoverMenuItemHeading",exports.default=m;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react"),o=require("styled-components"),t=require("../contexts/popover-menu.context.js"),r=require("../contexts/menu-heading.context.js"),a=require("../contexts/menu-item.context.js"),l=require("../../utils/helpers/guid/index.js"),u=require("../../../components/icon/icon.component.js");require("../../../components/icon/icon.style.js");var i=require("../utils/index.js");function s(e){return e&&e.__esModule?e:{default:e}}var c=s(n),d=s(o);function p(e,n,o){return n in e?Object.defineProperty(e,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[n]=o,e}function b(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{},t=Object.keys(o);"function"==typeof Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(o).filter((function(e){return Object.getOwnPropertyDescriptor(o,e).enumerable})))),t.forEach((function(n){p(e,n,o[n])}))}return e}function m(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):function(e){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n.push.apply(n,o)}return n}(Object(n)).forEach((function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})),e}const v=d.default.li.withConfig({displayName:"menu-item.component__StyledMenuItem",componentId:"carbon_v162_20_2__sc-4bc50bba-0"})(["width:100%;position:relative;box-sizing:border-box;&:not(:has(button)):not(:has(a)){"," display:grid;grid-template-columns:auto 1fr;align-items:center;column-gap:var(--global-space-comp-xs);&:not(:has(.menu-item-leading)){grid-template-columns:1fr;}}"," "," ",""],(({$disabled:e})=>e?"\n * {\n color: var(--input-dropdown-label-disabled);\n }\n cursor: not-allowed;\n ":"\n color: var(--input-dropdown-label-alt);\n cursor: pointer;\n\n :hover {\n * {\n color: var(--input-dropdown-label-hover);\n }\n background-color: var(--input-dropdown-bg-hover);\n }\n "),(({$disabled:e,$isButtonMenu:n})=>e?"\n * {\n color: var(--input-dropdown-label-disabled);\n }\n\n & > button, & > a {\n background-color: transparent;\n }\n cursor: not-allowed;\n ":`\n cursor: pointer;\n\n ${n?"\n color: var(--popover-label-default);\n\n & > button:active,\n & > a:active {\n background-color: var(--popover-bg-active);\n color: var(--popover-label-active);\n }\n\n & > button:not(:active):hover,\n & > a:not(:active):hover {\n color: var(--popover-label-hover);\n background-color: var(--popover-bg-hover);\n }\n ":"\n color: var(--input-dropdown-label-alt);\n\n &:not(:active):hover {\n * {\n color: var(--input-dropdown-label-hover);\n }\n background-color: var(--popover-bg-hover);\n }\n "}\n `),(({$isButtonMenu:e})=>o.css(["",""],e?"\n &:focus {\n outline: none;\n }\n ":'\n &[data-has-focus="true"] {\n outline: var(--focus-borderalt) solid var(--global-borderwidth-s);\n outline-offset: calc(var(--global-borderwidth-s) * -1);\n }\n ')),(({$size:e,$isButtonMenu:n})=>o.css([""," "," ",""],"small"===e&&`\n &:not(:has(button)):not(:has(a)) {\n padding: var(--global-space-comp-xs) 0;\n\n &:not(:has(.menu-item-subtext)) {\n min-height: var(--global-size-s);\n }\n }\n\n button, a {\n width: 100%;\n padding: var(--global-space-comp-xs) var(--global-space-comp-m) var(--global-space-comp-xs) var(--global-space-comp-m);\n }\n\n *:not(.menu-item-subtext):not(.menu-item-label-prefix) {\n font: var(--global-font-static-comp-${n?"medium":"regular"}-s);\n }\n `,"medium"===e&&`\n &:not(:has(button)):not(:has(a)) {\n padding: var(--global-space-comp-s) 0;\n\n &:not(:has(.menu-item-subtext)) {\n min-height: var(--global-size-m);\n }\n }\n\n button, a {\n width: 100%;\n padding: var(--global-space-comp-s) var(--global-space-comp-m) var(--global-space-comp-s) var(--global-space-comp-m);\n }\n\n *:not(.menu-item-subtext):not(.menu-item-label-prefix) {\n font: var(--global-font-static-comp-${n?"medium":"regular"}-m);\n }\n `,"large"===e&&`\n &:not(:has(button)):not(:has(a)) {\n padding: var(--global-space-comp-m) 0;\n\n &:not(:has(.menu-item-subtext)) {\n min-height: var(--global-size-l);\n }\n }\n \n button, a {\n width: 100%;\n padding: var(--global-space-comp-m) var(--global-space-comp-m) var(--global-space-comp-m) var(--global-space-comp-m);\n }\n\n *:not(.menu-item-subtext):not(.menu-item-label-prefix) {\n font: var(--global-font-static-comp-${n?"medium":"regular"}-l);\n }\n `))),f=d.default.div.withConfig({displayName:"menu-item.component__SubmenuParentWrapper",componentId:"carbon_v162_20_2__sc-4bc50bba-1"})(["display:flex;align-items:center;justify-content:space-between;width:100%;gap:var(--global-space-comp-xs);"]),g=e=>{if(!c.default.isValidElement(e))return!1;const n=e.props;return!(!n.disabled&&!0!==n["aria-disabled"]&&"true"!==n["aria-disabled"])||c.default.Children.toArray(n.children).some(g)},h=e=>{var n;const o=null===(n=e.current)||void 0===n?void 0:n.querySelector(i.buttonMenuItemQuerySelector(!0));null==o||o.focus()},y=o=>{var{children:i,onClick:s,selected:d,disabled:p,submenu:y,submenuOpen:x,onSubmenuOpen:w,onSubmenuClose:O,submenuWidth:j,id:C}=o,P=function(e,n){if(null==e)return{};var o,t,r=function(e,n){if(null==e)return{};var o,t,r={},a=Object.keys(e);for(t=0;t<a.length;t++)o=a[t],n.indexOf(o)>=0||(r[o]=e[o]);return r}(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(t=0;t<a.length;t++)o=a[t],n.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}(o,["children","onClick","selected","disabled","submenu","submenuOpen","onSubmenuOpen","onSubmenuClose","submenuWidth","id"]);const _=n.useRef(null),{size:k,isButtonMenu:S,isSubmenu:$,onSubmenuCloseContext:M,focusSubmenuParent:D,renderSubmenu:q}=n.useContext(t.PopoverMenuContext),z=!!y,E=S&&g(i),I=p||E,B=n.useCallback((n=>((n,o)=>c.default.isValidElement(n)&&1===c.default.Children.count(n)?c.default.cloneElement(n,b({"data-element":"submenu-parent",children:e.jsxs(f,{"data-element":"submenu-parent-wrapper",children:[n.props.children,e.jsx(u.default,{type:"caret_right","data-element":"submenu-icon",ml:3})]})},o)):n)(i,b({},n))),[i]),N=n.useRef(null),R=n.useContext(r.default),A=null==R?void 0:R.headingId,W=n.useRef(null!=C?C:`popover-menu-item-${l.default()}`).current,K=n.useCallback((e=>{if(z&&S)return"ArrowRight"===e.key?(e.preventDefault(),void(x?h(N):null==w||w())):void 0}),[z,S,w,x]);n.useEffect((()=>{x&&h(N)}),[x]);const V=n.useCallback((e=>{var n;const{activeElement:o}=document,t="popover-submenu-item"===(null==o||null===(n=o.parentElement)||void 0===n?void 0:n.getAttribute("data-component"));if("ArrowLeft"===e.key&&(e.preventDefault(),t))return null==D||D(),void(null==M||M())}),[D,M]),L=n.useCallback((e=>{null==w||w(),null==s||s(e)}),[w,s]);return S&&z&&q?q({open:!!x,submenu:y,submenuWidth:j,size:k,onClose:()=>null==O?void 0:O(),ref:N,triggerRef:_,control:n=>e.jsx(v,{ref:_,id:W,"data-component":"popover-menu-item",className:"popover-menu-item"+(I?"-disabled":""),$size:k,onClick:I?void 0:L,onMouseDown:I?void 0:e=>e.preventDefault(),onKeyDown:I?void 0:K,$disabled:I,$isButtonMenu:S,children:B(m(b({},n),{disabled:I}))})}):e.jsx(v,m(b({ref:_,id:W,"data-component":`popover-${$?"submenu":"menu"}-item`,className:"popover-menu-item"+(I?"-disabled":""),$size:k,onClick:I?void 0:s,onMouseDown:I?void 0:e=>e.preventDefault(),onKeyDown:V,role:S?void 0:"option","aria-selected":S?void 0:d&&!I,"aria-disabled":S?void 0:I,$disabled:I,$isButtonMenu:S},P),{"aria-describedby":A,children:e.jsx(a.default.Provider,{value:{isDisabled:!!I},children:i})}))};y.displayName="PopoverMenuItem",exports.default=y;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react"),o=require("styled-components"),t=require("../contexts/popover-menu.context.js"),r=require("../contexts/menu-heading.context.js"),a=require("../contexts/menu-item.context.js"),l=require("../../utils/helpers/guid/index.js"),u=require("../../../components/icon/icon.component.js");require("../../../components/icon/icon.style.js");var i=require("../utils/index.js");function s(e){return e&&e.__esModule?e:{default:e}}var c=s(n),d=s(o);function p(e,n,o){return n in e?Object.defineProperty(e,n,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[n]=o,e}function m(e){for(var n=1;n<arguments.length;n++){var o=null!=arguments[n]?arguments[n]:{},t=Object.keys(o);"function"==typeof Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(o).filter((function(e){return Object.getOwnPropertyDescriptor(o,e).enumerable})))),t.forEach((function(n){p(e,n,o[n])}))}return e}function b(e,n){return n=null!=n?n:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):function(e){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);n.push.apply(n,o)}return n}(Object(n)).forEach((function(o){Object.defineProperty(e,o,Object.getOwnPropertyDescriptor(n,o))})),e}const v=d.default.li.withConfig({displayName:"menu-item.component__StyledMenuItem",componentId:"carbon_v162_21_0__sc-29021491-0"})(['width:100%;position:relative;box-sizing:border-box;& > [data-element="submenu-parent"] > [data-role="button-child-container"]{flex:1;}&:not(:has(button)):not(:has(a)){'," display:grid;grid-template-columns:auto 1fr;align-items:center;column-gap:var(--global-space-comp-xs);&:not(:has(.menu-item-leading)){grid-template-columns:1fr;}}"," "," ",""],(({$disabled:e})=>e?"\n * {\n color: var(--input-dropdown-label-disabled);\n }\n cursor: not-allowed;\n ":"\n color: var(--input-dropdown-label-alt);\n cursor: pointer;\n\n :hover {\n * {\n color: var(--input-dropdown-label-hover);\n }\n background-color: var(--input-dropdown-bg-hover);\n }\n "),(({$disabled:e,$isButtonMenu:n})=>e?`\n * {\n color: var(--${n?"popover-label-disabled":"input-dropdown-label-disabled"});\n }\n\n & > button, & > a {\n background-color: transparent;\n }\n cursor: not-allowed;\n `:`\n cursor: pointer;\n\n ${n?"\n color: var(--popover-label-default);\n\n & > button:active,\n & > a:active {\n background-color: var(--popover-bg-active);\n color: var(--popover-label-active);\n }\n\n & > button:not(:active):hover,\n & > a:not(:active):hover {\n color: var(--popover-label-hover);\n background-color: var(--popover-bg-hover);\n }\n ":"\n color: var(--input-dropdown-label-alt);\n\n &:not(:active):hover {\n * {\n color: var(--input-dropdown-label-hover);\n }\n background-color: var(--popover-bg-hover);\n }\n "}\n `),(({$isButtonMenu:e})=>o.css(["",""],e?"\n &:focus {\n outline: none;\n }\n ":'\n &[data-has-focus="true"] {\n outline: var(--focus-borderalt) solid var(--global-borderwidth-s);\n outline-offset: calc(var(--global-borderwidth-s) * -1);\n }\n ')),(({$size:e,$isButtonMenu:n})=>o.css([""," "," ",""],"small"===e&&`\n &:not(:has(button)):not(:has(a)) {\n padding: var(--global-space-comp-xs) 0;\n\n &:not(:has(.menu-item-subtext)) {\n min-height: var(--global-size-s);\n }\n }\n\n button, a {\n width: 100%;\n padding: var(--global-space-comp-xs) var(--global-space-comp-m) var(--global-space-comp-xs) var(--global-space-comp-m);\n }\n\n *:not(.menu-item-subtext):not(.menu-item-label-prefix) {\n font: var(--global-font-static-comp-${n?"medium":"regular"}-s);\n }\n `,"medium"===e&&`\n &:not(:has(button)):not(:has(a)) {\n padding: var(--global-space-comp-s) 0;\n\n &:not(:has(.menu-item-subtext)) {\n min-height: var(--global-size-m);\n }\n }\n\n button, a {\n width: 100%;\n padding: var(--global-space-comp-s) var(--global-space-comp-m) var(--global-space-comp-s) var(--global-space-comp-m);\n }\n\n *:not(.menu-item-subtext):not(.menu-item-label-prefix) {\n font: var(--global-font-static-comp-${n?"medium":"regular"}-m);\n }\n `,"large"===e&&`\n &:not(:has(button)):not(:has(a)) {\n padding: var(--global-space-comp-m) 0;\n\n &:not(:has(.menu-item-subtext)) {\n min-height: var(--global-size-l);\n }\n }\n \n button, a {\n width: 100%;\n padding: var(--global-space-comp-m) var(--global-space-comp-m) var(--global-space-comp-m) var(--global-space-comp-m);\n }\n\n *:not(.menu-item-subtext):not(.menu-item-label-prefix) {\n font: var(--global-font-static-comp-${n?"medium":"regular"}-l);\n }\n `))),f=d.default.div.withConfig({displayName:"menu-item.component__SubmenuParentWrapper",componentId:"carbon_v162_21_0__sc-29021491-1"})(["display:flex;align-items:center;justify-content:flex-start;width:100%;gap:var(--global-space-comp-s);"]),g=e=>{if(!c.default.isValidElement(e))return!1;const n=e.props;return!(!n.disabled&&!0!==n["aria-disabled"]&&"true"!==n["aria-disabled"])||c.default.Children.toArray(n.children).some(g)},h=e=>{var n;const o=null===(n=e.current)||void 0===n?void 0:n.querySelector(i.buttonMenuItemQuerySelector(!0));null==o||o.focus()},y=o=>{var{children:i,onClick:s,selected:d,disabled:p,submenu:y,submenuOpen:x,onSubmenuOpen:w,onSubmenuClose:O,submenuWidth:j,id:C}=o,P=function(e,n){if(null==e)return{};var o,t,r=function(e,n){if(null==e)return{};var o,t,r={},a=Object.keys(e);for(t=0;t<a.length;t++)o=a[t],n.indexOf(o)>=0||(r[o]=e[o]);return r}(e,n);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(t=0;t<a.length;t++)o=a[t],n.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}(o,["children","onClick","selected","disabled","submenu","submenuOpen","onSubmenuOpen","onSubmenuClose","submenuWidth","id"]);const $=n.useRef(null),{size:_,isButtonMenu:k,isSubmenu:S,onSubmenuCloseContext:M,focusSubmenuParent:D,renderSubmenu:q}=n.useContext(t.PopoverMenuContext),z=!!y,E=k&&g(i),I=p||E,B=n.useCallback((n=>((n,o)=>c.default.isValidElement(n)&&1===c.default.Children.count(n)?c.default.cloneElement(n,m({"data-element":"submenu-parent",children:e.jsxs(f,{"data-element":"submenu-parent-wrapper",children:[n.props.children,e.jsx(u.default,{type:"caret_right","data-element":"submenu-icon",ml:"auto"})]})},o)):n)(i,m({},n))),[i]),N=n.useRef(null),R=n.useContext(r.default),A=null==R?void 0:R.headingId,W=n.useRef(null!=C?C:`popover-menu-item-${l.default()}`).current,K=n.useCallback((e=>{if(z&&k)return"ArrowRight"===e.key?(e.preventDefault(),void(x?h(N):null==w||w())):void 0}),[z,k,w,x]);n.useEffect((()=>{x&&h(N)}),[x]);const V=n.useCallback((e=>{var n;const{activeElement:o}=document,t="popover-submenu-item"===(null==o||null===(n=o.parentElement)||void 0===n?void 0:n.getAttribute("data-component"));if("ArrowLeft"===e.key&&(e.preventDefault(),t))return null==D||D(),void(null==M||M())}),[D,M]),L=n.useCallback((e=>{null==w||w(),null==s||s(e)}),[w,s]);return k&&z&&q?q({open:!!x,submenu:y,submenuWidth:j,size:_,onClose:()=>null==O?void 0:O(),ref:N,triggerRef:$,control:n=>e.jsx(v,{ref:$,id:W,"data-component":"popover-menu-item",className:"popover-menu-item"+(I?"-disabled":""),$size:_,onClick:I?void 0:L,onMouseDown:I?void 0:e=>e.preventDefault(),onKeyDown:I?void 0:K,$disabled:I,$isButtonMenu:k,children:B(b(m({},n),{disabled:I}))})}):e.jsx(v,b(m({ref:$,id:W,"data-component":`popover-${S?"submenu":"menu"}-item`,className:"popover-menu-item"+(I?"-disabled":""),$size:_,onClick:I?void 0:s,onMouseDown:I?void 0:e=>e.preventDefault(),onKeyDown:V,role:k?void 0:"option","aria-selected":k?void 0:d&&!I,"aria-disabled":k?void 0:I,$disabled:I,$isButtonMenu:k},P),{"aria-describedby":A,children:e.jsx(a.default.Provider,{value:{isDisabled:!!I},children:i})}))};y.displayName="PopoverMenuItem",exports.default=y;
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
2
  import type { CSSObject } from "styled-components";
3
3
  import { PopoverProps } from "../popover";
4
+ import { type TypeaheadHandler } from "./hooks";
4
5
  import { PopoverMenuContextProps, PopoverControlProps } from "./contexts";
5
6
  import { TagProps } from "../utils/helpers/tags";
6
7
  interface ListProps {
@@ -36,6 +37,8 @@ export interface PopoverMenuProps<TRef extends FocusableHandle = HTMLElement> ex
36
37
  width?: string;
37
38
  /** Whether the menu width should match the control reference width */
38
39
  matchReferenceWidth?: boolean;
40
+ /** Hide the menu when its control is fully clipped. Defaults to false. */
41
+ hideWhenReferenceHidden?: boolean;
39
42
  /** Strategy used to position the popover */
40
43
  popoverStrategy?: PopoverProps["popoverStrategy"];
41
44
  /** Override default control reference for popover */
@@ -54,8 +57,10 @@ export interface PopoverMenuProps<TRef extends FocusableHandle = HTMLElement> ex
54
57
  isSubmenu?: boolean;
55
58
  /** Ref to the listbox/menu element */
56
59
  listRef?: React.Ref<HTMLUListElement>;
60
+ /** Callback for handling typeahead keyboard navigation */
61
+ typeahead?: (args: TypeaheadHandler) => void;
57
62
  }
58
- declare const menuPopoverMiddleware: (width?: string, isButtonMenu?: boolean, isSubmenu?: boolean, matchReferenceWidth?: boolean) => {
63
+ declare const menuPopoverMiddleware: (width?: string, isButtonMenu?: boolean, isSubmenu?: boolean, matchReferenceWidth?: boolean, hideWhenReferenceHidden?: boolean) => {
59
64
  name: string;
60
65
  options?: any;
61
66
  fn: (state: import("@floating-ui/dom").MiddlewareState) => import("@floating-ui/core").MiddlewareReturn | Promise<import("@floating-ui/core").MiddlewareReturn>;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),n=require("styled-components"),o=require("../popover/popover.component.js"),t=require("@floating-ui/dom"),l=require("./utils/index.js"),i=require("../../hooks/__internal__/useClickAwayListener/useClickAwayListener.js"),a=require("./hooks/useHandleDropdownMenuKeyDown.js"),u=require("../utils/helpers/guid/index.js"),s=require("./contexts/popover-menu.context.js");require("./contexts/menu-heading.context.js"),require("./contexts/menu-item.context.js");var c=require("../utils/helpers/combine-refs/index.js");function p(e){return e&&e.__esModule?e:{default:e}}var d=p(n);function v(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}const b=d.default.div.withConfig({displayName:"popover-menu.component__PopoverControlWrapper",componentId:"carbon_v162_20_2__sc-b31ae1b1-0"})(["display:inline-block;",""],(({$controlWrapperStyle:e})=>e)),m=d.default.ul.withConfig({displayName:"popover-menu.component__List",componentId:"carbon_v162_20_2__sc-b31ae1b1-1"})(["margin:var(--global-space-none);padding:var(--global-space-none);background-color:var(--popover-bg-default);display:flex;flex-direction:column;max-height:",';list-style-type:"";list-style:none;',""],(({$maxHeight:e,$size:r})=>null!=e?e:`calc(5 * var(--global-size-${r.charAt(0)}))`),(({$isButtonMenu:e,$size:r,$maxHeight:o})=>!e&&n.css(["overflow:hidden auto;-webkit-overflow-scrolling:touch;max-height:",";"],null!=o?o:`calc(5 * var(--global-size-${r.charAt(0)}))`))),f={small:"var(--global-space-comp-xs)",medium:"var(--global-space-comp-s)",large:"var(--global-space-comp-m)"},y=d.default.div.withConfig({displayName:"popover-menu.component__MenuWrapper",componentId:"carbon_v162_20_2__sc-b31ae1b1-2"})(["box-shadow:var(--global-depth-lvl1);border-radius:var(--global-radius-container-m);background-color:var(--popover-bg-default);width:max-content;max-width:100%;position:relative;z-index:var(--carbon-zindex-small-overlay);padding:",";",""],(({$size:e})=>n.css([""," var(--global-space-none)"],f[e])),(({$isButtonMenu:e})=>!e&&n.css(["overflow:hidden;max-height:100%;"]))),g=d.default.div.withConfig({displayName:"popover-menu.component__ScrollWrapper",componentId:"carbon_v162_20_2__sc-b31ae1b1-3"})(["max-height:100%;width:100%;"]),h=e=>{null==e||e.focus()},x=({open:r,placement:n,controlWrapperRef:t,size:l,listRef:i,listboxAriaLabelledBy:a,listboxAriaLabel:u,isButtonMenu:s,children:c,onKeyDown:p,middleware:d,scrollRef:v,listId:b,disablePortal:f,portalTarget:h,maxHeight:x,popoverStrategy:w})=>e.jsx(o.default,{placement:n,reference:t,isOpen:r,"data-component":"popover-menu",middleware:d,disablePortal:f,portalTarget:h,popoverStrategy:w,children:e.jsx(y,{$size:l,onKeyDown:p,"data-role":"menu-wrapper",onMouseDown:e=>e.preventDefault(),$isButtonMenu:s,children:e.jsx(g,{ref:v,"data-component":"scroll-wrapper",children:e.jsx(m,{$size:l,ref:i,role:s?"list":"listbox",id:b,"aria-labelledby":a,$isButtonMenu:s,"aria-label":u,$maxHeight:x,children:c})})})}),w=({open:r,isButtonMenu:n,isSubmenu:o,popoverControl:t,controlRef:l,controlWrapperRef:i,onKeyDown:a,listId:u,"aria-activedescendant":s,controlWrapperStyle:c})=>o?t(l,{"aria-haspopup":"true","aria-controls":r?u:void 0,"aria-expanded":r}):e.jsx(b,{ref:i,onKeyDown:a,"data-component":"popover-menu-control",$controlWrapperStyle:c,children:t(l,{"aria-haspopup":n?"true":"listbox","aria-controls":r?u:void 0,"aria-expanded":r,"aria-activedescendant":n?void 0:s,role:n?void 0:"combobox"})}),j=(n,o)=>{var{children:p,open:d,popoverControl:b,size:m="medium",placement:f="bottom-end",onOpen:y,onClose:g,width:j,matchReferenceWidth:O=!1,popoverStrategy:S="absolute",listboxAriaLabelledBy:k,listboxAriaLabel:R,isButtonMenu:C=!1,isSubmenu:P=!1,id:M,controlReference:D,listRef:L,controlWrapperStyle:$,maxHeight:z}=n,A=function(e,r){if(null==e)return{};var n,o,t=function(e,r){if(null==e)return{};var n,o,t={},l=Object.keys(e);for(o=0;o<l.length;o++)n=l[o],r.indexOf(n)>=0||(t[n]=e[n]);return t}(e,r);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(o=0;o<l.length;o++)n=l[o],r.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(t[n]=e[n])}return t}(n,["children","open","popoverControl","size","placement","onOpen","onClose","width","matchReferenceWidth","popoverStrategy","listboxAriaLabelledBy","listboxAriaLabel","isButtonMenu","isSubmenu","id","controlReference","listRef","controlWrapperStyle","maxHeight"]);const B=r.useRef(null),q=null!=D?D:B,W=r.useRef(null),E=r.useRef(null),I=c.default(L,E),H=r.useRef(null!=M?M:`popover-menu-wrapper-${u.default()}`),K=r.useRef(null),F=c.default(K,o),N=l.wrapChildrenInItem(p),T=r.useRef(null),Q=i.default(g),[U,G]=r.useState(""),J=((e,r,n,o)=>[t.offset(n?0:8),t.flip({fallbackStrategy:"initialPlacement"}),t.size({apply({rects:n,elements:t}){(!r||o||e)&&(t.floating.style.width=e||`${n.reference.width}px`)}})])(j,C,P,O),V=r.useRef(null),X=r.useCallback((()=>{if(P){var e;const r=null==D||null===(e=D.current)||void 0===e?void 0:e.querySelector("button, a");r&&h(r)}}),[P,D]),Y=r.useCallback((e=>{d&&"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),g(),P?X():h(T.current))}),[d,g,P,X]);r.useEffect((()=>{const e=P?W.current:K.current;null==e||e.addEventListener("click",Q,{passive:!0}),null==e||e.addEventListener("keydown",Y);const r=P?null==D?void 0:D.current:null;return null==r||r.addEventListener("click",Q,{passive:!0}),()=>{null==e||e.removeEventListener("click",Q),null==e||e.removeEventListener("keydown",Y),null==r||r.removeEventListener("click",Q)}}),[P,Q,Y,D]);const Z=a.useHandleDropdownMenuKeyDown(E,C?()=>{}:G,g,{isButtonMenu:C,isSubmenu:P}),ee=r.useCallback((e=>{var r;if(d&&(null===(r=B.current)||void 0===r?void 0:r.contains(document.activeElement)))Z(e);else if(!d&&C&&!P){if("ArrowDown"===e.key)return e.preventDefault(),null==y||y(),void(V.current="down");if("ArrowUp"===e.key)return e.preventDefault(),null==y||y(),void(V.current="up")}}),[d,Z,C,y,P]);r.useEffect((()=>{let e;return d&&C&&!P&&(e=requestAnimationFrame((()=>{var e;const r=null===(e=W.current)||void 0===e?void 0:e.querySelectorAll(l.buttonMenuItemQuerySelector(!1)),n="up"===V.current?null==r?void 0:r[r.length-1]:null==r?void 0:r[0];V.current=null,n&&(G(n.id),a.setFocus(n,void 0,C))}))),()=>cancelAnimationFrame(e)}),[d,C,P]);const re=r.useCallback((r=>e.jsx(_,{open:r.open,onClose:e=>{var n;r.onClose(),("click"===(null==e?void 0:e.type)&&!(null===(n=K.current)||void 0===n?void 0:n.contains(null==e?void 0:e.target))||"Tab"===(null==e?void 0:e.key))&&g(e)},size:r.size,isButtonMenu:!0,isSubmenu:!0,width:r.submenuWidth,listRef:r.ref,popoverControl:(e,n)=>r.control(n),placement:"right-start",controlReference:r.triggerRef,children:r.submenu})),[g]),ne=e.jsxs(e.Fragment,{children:[e.jsx(w,{open:d,isButtonMenu:C,isSubmenu:P,popoverControl:b,controlRef:T,controlWrapperRef:B,controlWrapperStyle:$,onKeyDown:ee,listId:H.current,"aria-activedescendant":d&&U?U:void 0}),e.jsx(s.PopoverMenuContext.Provider,{value:{size:m,isButtonMenu:C,isSubmenu:P,onSubmenuCloseContext:P?g:void 0,focusSubmenuParent:P?X:void 0,renderSubmenu:C&&!P?re:void 0},children:d&&e.jsx(x,{open:d,placement:f,controlWrapperRef:q,size:m,listRef:I,listboxAriaLabelledBy:k,listboxAriaLabel:R,isButtonMenu:C,onKeyDown:Z,middleware:J,scrollRef:W,listId:H.current,disablePortal:!P,portalTarget:P?null==D?void 0:D.current:void 0,maxHeight:z,popoverStrategy:S,children:N})})]});return P?ne:e.jsx("div",(oe=function(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),o.forEach((function(r){v(e,r,n[r])}))}return e}({ref:F,"data-component":"popover-menu"},A),te=null!=(te={children:ne})?te:{},Object.getOwnPropertyDescriptors?Object.defineProperties(oe,Object.getOwnPropertyDescriptors(te)):function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r.push.apply(r,n)}return r}(Object(te)).forEach((function(e){Object.defineProperty(oe,e,Object.getOwnPropertyDescriptor(te,e))})),oe));var oe,te},_=r.forwardRef(j);exports.List=m,exports.default=_;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react"),t=require("styled-components"),r=require("../popover/popover.component.js"),o=require("@floating-ui/dom"),l=require("./utils/index.js"),i=require("../../hooks/__internal__/useClickAwayListener/useClickAwayListener.js"),a=require("./hooks/useHandleDropdownMenuKeyDown.js"),s=require("../utils/helpers/guid/index.js"),u=require("./contexts/popover-menu.context.js");require("./contexts/menu-heading.context.js"),require("./contexts/menu-item.context.js");var c=require("../utils/helpers/combine-refs/index.js");require("../../components/table/__internal__/contexts/table.context.js"),require("../../components/table/__internal__/contexts/table-row.context.js"),require("../../components/table/__internal__/contexts/table-footer.context.js"),require("../../components/table/__internal__/contexts/sub-row.context.js"),require("../../components/table/__internal__/contexts/table-header.context.js");var p=require("../../components/table/__internal__/contexts/table-body.context.js");function d(e){return e&&e.__esModule?e:{default:e}}var f=d(t);function v(e,n,t){return n in e?Object.defineProperty(e,n,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[n]=t,e}const b=f.default.div.withConfig({displayName:"popover-menu.component__PopoverControlWrapper",componentId:"carbon_v162_21_0__sc-6c9f2311-0"})(["display:inline-block;",""],(({$controlWrapperStyle:e})=>e)),m=f.default.ul.withConfig({displayName:"popover-menu.component__List",componentId:"carbon_v162_21_0__sc-6c9f2311-1"})(['margin:var(--global-space-none);padding:var(--global-space-none);background-color:var(--popover-bg-default);display:flex;flex-direction:column;list-style-type:"";list-style:none;',""],(({$isButtonMenu:e,$size:n,$maxHeight:r})=>!e&&t.css(["overflow:hidden auto;-webkit-overflow-scrolling:touch;max-height:",";"],null!=r?r:`calc(5 * var(--global-size-${n.charAt(0)}))`))),y={small:"var(--global-space-comp-xs)",medium:"var(--global-space-comp-s)",large:"var(--global-space-comp-m)"},h=f.default.div.withConfig({displayName:"popover-menu.component__MenuWrapper",componentId:"carbon_v162_21_0__sc-6c9f2311-2"})(["box-shadow:var(--global-depth-lvl1);border-radius:var(--global-radius-container-m);background-color:var(--popover-bg-default);width:max-content;position:relative;z-index:calc(var(--carbon-zindex-overlay) + 2);padding:",";",""],(({$size:e})=>t.css([""," var(--global-space-none)"],y[e])),(({$isButtonMenu:e})=>!e&&t.css(["overflow:hidden;max-width:100%;max-height:100%;"]))),x=f.default.div.withConfig({displayName:"popover-menu.component__ScrollWrapper",componentId:"carbon_v162_21_0__sc-6c9f2311-3"})(["max-height:100%;width:100%;"]),g=e=>{null==e||e.focus()},_=({open:n,placement:t,controlWrapperRef:o,size:l,listRef:i,listboxAriaLabelledBy:a,listboxAriaLabel:s,isButtonMenu:u,children:c,onKeyDown:p,middleware:d,scrollRef:f,listId:v,disablePortal:b,portalTarget:y,maxHeight:g,popoverStrategy:_})=>e.jsx(r.default,{placement:t,reference:o,isOpen:n,"data-component":"popover-menu",middleware:d,disablePortal:b,portalTarget:y,popoverStrategy:_,children:e.jsx(h,{$size:l,onKeyDown:p,"data-role":"menu-wrapper",onMouseDown:e=>e.preventDefault(),$isButtonMenu:u,children:e.jsx(x,{ref:f,"data-component":"scroll-wrapper",children:e.jsx(m,{$size:l,ref:i,role:u?"list":"listbox",id:v,"aria-labelledby":a,$isButtonMenu:u,"aria-label":s,$maxHeight:g,children:c})})})}),w=({open:n,isButtonMenu:t,isSubmenu:r,popoverControl:o,controlRef:l,controlWrapperRef:i,onKeyDown:a,listId:s,"aria-activedescendant":u,controlWrapperStyle:c})=>r?o(l,{"aria-haspopup":"true","aria-controls":n?s:void 0,"aria-expanded":n}):e.jsx(b,{ref:i,onKeyDown:a,"data-component":"popover-menu-control",$controlWrapperStyle:c,children:o(l,{"aria-haspopup":t?"true":"listbox","aria-controls":n?s:void 0,"aria-expanded":n,"aria-activedescendant":t?void 0:u,role:t?void 0:"combobox"})}),j=(t,r)=>{var{children:d,open:f,popoverControl:b,size:m="medium",placement:y="bottom-end",onOpen:h,onClose:x,width:j,matchReferenceWidth:S=!1,hideWhenReferenceHidden:R=!1,popoverStrategy:k="absolute",listboxAriaLabelledBy:C,listboxAriaLabel:P,isButtonMenu:q=!1,isSubmenu:M=!1,id:D,controlReference:W,listRef:L,controlWrapperStyle:B,maxHeight:A,typeahead:z}=t,$=function(e,n){if(null==e)return{};var t,r,o=function(e,n){if(null==e)return{};var t,r,o={},l=Object.keys(e);for(r=0;r<l.length;r++)t=l[r],n.indexOf(t)>=0||(o[t]=e[t]);return o}(e,n);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)t=l[r],n.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}(t,["children","open","popoverControl","size","placement","onOpen","onClose","width","matchReferenceWidth","hideWhenReferenceHidden","popoverStrategy","listboxAriaLabelledBy","listboxAriaLabel","isButtonMenu","isSubmenu","id","controlReference","listRef","controlWrapperStyle","maxHeight","typeahead"]);const E=n.useRef(null),I=null!=W?W:E,H=n.useRef(null),K=n.useRef(null),T=c.default(L,K),F=n.useRef(null!=D?D:`popover-menu-wrapper-${s.default()}`),N=n.useRef(null),Q=c.default(N,r),U=l.wrapChildrenInItem(d),G=n.useRef(null),J=n.useRef(null),V=n.useCallback((e=>{f&&J.current!==e&&(J.current=e,x(e))}),[f,x]),X=i.default(V),[Y,Z]=n.useState(""),ee=((e,n,t,r,l)=>[o.offset(t?0:8),o.flip({fallbackStrategy:"initialPlacement"}),o.size({apply({rects:t,elements:o}){(!n||r||e)&&(o.floating.style.width=e||`${t.reference.width}px`)}}),...l?[o.hide({strategy:"referenceHidden"})]:[]])(j,q,M,S,R),ne=n.useRef(null),te=n.useCallback((()=>{if(M){var e;const n=null==W||null===(e=W.current)||void 0===e?void 0:e.querySelector("button, a");n&&g(n)}}),[M,W]),re=n.useCallback((e=>{f&&"Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),M&&te(),x(e),M||g(G.current))}),[f,x,M,te]);n.useEffect((()=>{const e=M?H.current:N.current;null==e||e.addEventListener("click",X,{passive:!0}),null==e||e.addEventListener("keydown",re);const n=M?null==W?void 0:W.current:null;return null==n||n.addEventListener("click",X,{passive:!0}),()=>{null==e||e.removeEventListener("click",X),null==e||e.removeEventListener("keydown",re),null==n||n.removeEventListener("click",X)}}),[M,X,re,W]);const oe=a.useHandleDropdownMenuKeyDown(K,q?()=>{}:Z,x,{isButtonMenu:q,isSubmenu:M},z),{isInTable:le}=n.useContext(p.default),ie=n.useCallback((e=>{var n;if(f&&(null===(n=E.current)||void 0===n?void 0:n.contains(document.activeElement)))oe(e);else if(!f&&q&&!le&&!M){if("ArrowDown"===e.key)return e.preventDefault(),null==h||h(),void(ne.current="down");if("ArrowUp"===e.key)return e.preventDefault(),null==h||h(),void(ne.current="up")}}),[f,oe,q,le,h,M]);n.useEffect((()=>{let e;return f&&q&&!M&&(e=requestAnimationFrame((()=>{var e;const n=null===(e=H.current)||void 0===e?void 0:e.querySelectorAll(l.buttonMenuItemQuerySelector(!1)),t="up"===ne.current?null==n?void 0:n[n.length-1]:null==n?void 0:n[0];ne.current=null,t&&(Z(t.id),a.setFocus(t,void 0,q))}))),()=>cancelAnimationFrame(e)}),[f,q,M]);const ae=n.useCallback((n=>e.jsx(O,{open:n.open,onClose:e=>{var t;n.onClose(),"click"!==(null==e?void 0:e.type)||(null===(t=N.current)||void 0===t?void 0:t.contains(e.target))?"Tab"===(null==e?void 0:e.key)&&x(e):V(e)},size:n.size,isButtonMenu:!0,isSubmenu:!0,hideWhenReferenceHidden:R,width:n.submenuWidth,listRef:n.ref,popoverControl:(e,t)=>n.control(t),placement:"right-start",controlReference:n.triggerRef,typeahead:z,children:n.submenu})),[x,V,z,R]),se=e.jsxs(e.Fragment,{children:[e.jsx(w,{open:f,isButtonMenu:q,isSubmenu:M,popoverControl:b,controlRef:G,controlWrapperRef:E,controlWrapperStyle:B,onKeyDown:ie,listId:F.current,"aria-activedescendant":f&&Y?Y:void 0}),e.jsx(u.PopoverMenuContext.Provider,{value:{size:m,isButtonMenu:q,isSubmenu:M,onSubmenuCloseContext:M?x:void 0,focusSubmenuParent:M?te:void 0,renderSubmenu:q&&!M?ae:void 0},children:f&&e.jsx(_,{open:f,placement:y,controlWrapperRef:I,size:m,listRef:T,listboxAriaLabelledBy:C,listboxAriaLabel:P,isButtonMenu:q,onKeyDown:oe,middleware:ee,scrollRef:H,listId:F.current,disablePortal:!M,portalTarget:M?null==W?void 0:W.current:void 0,maxHeight:A,popoverStrategy:k,children:U})})]});return M?se:e.jsx("div",(ue=function(e){for(var n=1;n<arguments.length;n++){var t=null!=arguments[n]?arguments[n]:{},r=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),r.forEach((function(n){v(e,n,t[n])}))}return e}({ref:Q,"data-component":"popover-menu"},$),ce=null!=(ce={children:se})?ce:{},Object.getOwnPropertyDescriptors?Object.defineProperties(ue,Object.getOwnPropertyDescriptors(ce)):function(e){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);n.push.apply(n,t)}return n}(Object(ce)).forEach((function(e){Object.defineProperty(ue,e,Object.getOwnPropertyDescriptor(ce,e))})),ue));var ue,ce},O=n.forwardRef(j);exports.List=m,exports.default=O;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),a=require("./validation-message-style-overrides.style.js");function t(e){return e&&e.__esModule?e:{default:e}}const l=t(e).default.span.withConfig({displayName:"validation-message.style__StyledValidationMessage",componentId:"carbon_v162_20_2__sc-ade67d83-0"})(["",""],(({$isError:t,$size:l})=>e.css(["display:flex;align-items:center;align-content:center;align-self:stretch;flex-wrap:wrap;margin:0px;color:",";"," "," "," ",""],t?"var(--input-validation-label-error)":"var(--input-validation-label-warn)","large"===l&&e.css(["font:",";"],t?"var(--global-font-static-comp-medium-l)":"var(--global-font-static-comp-regular-l)"),"medium"===l&&e.css(["font:",";"],t?"var(--global-font-static-comp-medium-m)":"var(--global-font-static-comp-regular-m)"),"small"===l&&e.css(["font:",";"],t?"var(--global-font-static-comp-medium-s)":"var(--global-font-static-comp-regular-s)"),a.default)));exports.default=l;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),a=require("./validation-message-style-overrides.style.js");function t(e){return e&&e.__esModule?e:{default:e}}const l=t(e).default.span.withConfig({displayName:"validation-message.style__StyledValidationMessage",componentId:"carbon_v162_21_0__sc-ade67d83-0"})(["",""],(({$isError:t,$size:l})=>e.css(["display:flex;align-items:center;align-content:center;align-self:stretch;flex-wrap:wrap;margin:0px;color:",";"," "," "," ",""],t?"var(--input-validation-label-error)":"var(--input-validation-label-warn)","large"===l&&e.css(["font:",";"],t?"var(--global-font-static-comp-medium-l)":"var(--global-font-static-comp-regular-l)"),"medium"===l&&e.css(["font:",";"],t?"var(--global-font-static-comp-medium-m)":"var(--global-font-static-comp-regular-m)"),"small"===l&&e.css(["font:",";"],t?"var(--global-font-static-comp-medium-s)":"var(--global-font-static-comp-regular-s)"),a.default)));exports.default=l;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components");function t(e){return e&&e.__esModule?e:{default:e}}const o=t(e).default.p.withConfig({displayName:"validation-message.style__StyledValidationMessage",componentId:"carbon_v162_20_2__sc-3359a809-0"})(["",""],(({isWarning:t,isDarkBackground:o,validationMessagePositionTop:a,isLarge:i})=>{const n=o?"var(--colorsSemanticNegative450)":"var(--colorsSemanticNegative500)";return e.css(["color:",";font-weight:",";font-size:",";margin:0px;margin-",":8px;"],t?"var(--tempColorsSemanticCaution600)":n,t?"normal":"500",i?"var(--fontSizes200)":"var(--fontSizes100)",a?"bottom":"top")}));exports.default=o;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components");function t(e){return e&&e.__esModule?e:{default:e}}const o=t(e).default.p.withConfig({displayName:"validation-message.style__StyledValidationMessage",componentId:"carbon_v162_21_0__sc-3359a809-0"})(["",""],(({isWarning:t,isDarkBackground:o,validationMessagePositionTop:a,isLarge:i})=>{const n=o?"var(--colorsSemanticNegative450)":"var(--colorsSemanticNegative500)";return e.css(["color:",";font-weight:",";font-size:",";margin:0px;margin-",":8px;"],t?"var(--tempColorsSemanticCaution600)":n,t?"normal":"500",i?"var(--fontSizes200)":"var(--fontSizes100)",a?"bottom":"top")}));exports.default=o;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),t=require("styled-system"),o=require("../../style/themes/apply-base-theme.js"),r=require("../../components/icon/icon.style.js"),n=require("../../style/utils/add-focus-styling.js");function a(e){return e&&e.__esModule?e:{default:e}}const s={error:"var(--colorsSemanticNegative500)",info:"var(--colorsSemanticInfo500)",warning:"var(--colorsSemanticCaution500)"},i=a(e).default.span.attrs(o.default).withConfig({displayName:"validation-icon.style__ValidationIconStyle",componentId:"carbon_v162_20_2__sc-91300c1b-0"})(["background:none;cursor:default;display:flex;align-items:center;margin-top:0;margin-bottom:0;border:0;outline:none;"," ",":before{color:",";}",":focus{","}",""],(({isPartOfInput:t})=>t&&e.css(["cursor:pointer;"])),r.default,(({validationType:e})=>s[e]),r.default,n.default(),t.margin);exports.default=i;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),t=require("styled-system"),o=require("../../style/themes/apply-base-theme.js"),r=require("../../components/icon/icon.style.js"),n=require("../../style/utils/add-focus-styling.js");function a(e){return e&&e.__esModule?e:{default:e}}const s={error:"var(--colorsSemanticNegative500)",info:"var(--colorsSemanticInfo500)",warning:"var(--colorsSemanticCaution500)"},i=a(e).default.span.attrs(o.default).withConfig({displayName:"validation-icon.style__ValidationIconStyle",componentId:"carbon_v162_21_0__sc-91300c1b-0"})(["background:none;cursor:default;display:flex;align-items:center;margin-top:0;margin-bottom:0;border:0;outline:none;"," ",":before{color:",";}",":focus{","}",""],(({isPartOfInput:t})=>t&&e.css(["cursor:pointer;"])),r.default,(({validationType:e})=>s[e]),r.default,n.default(),t.margin);exports.default=i;
@@ -1 +1 @@
1
- "use strict";var o=require("styled-components"),e=require("styled-system"),t=require("../icon/icon.component.js");require("../icon/icon.style.js");var i=require("../../style/themes/apply-base-theme.js"),n=require("../../style/utils/add-focus-styling.js");function a(o){return o&&o.__esModule?o:{default:o}}var c=a(o);const r={small:{titleFont:"var(--global-font-static-section-heading-s)",subtitleFont:"var(--global-font-static-comp-medium-s)",headingPadding:"var(--global-space-comp-l)"},medium:{titleFont:"var(--global-font-static-section-heading-m)",subtitleFont:"var(--global-font-static-comp-medium-l)",headingPadding:"var(--global-space-comp-xl)"}},s=c.default.div.attrs(i.default).withConfig({displayName:"accordion.style__StyledAccordionGroup",componentId:"carbon_v162_20_2__sc-5e39e462-0"})(["",""],e.margin),l=c.default.div.attrs(i.default).withConfig({displayName:"accordion.style__StyledAccordionContainer",componentId:"carbon_v162_20_2__sc-5e39e462-1"})(["display:flex;align-items:stretch;justify-content:center;flex-direction:column;box-sizing:border-box;width:",";"," &&{","}"],(({$width:o})=>o||"100%"),(({$variant:e,$borders:t,$isExpanded:i,$allowMotion:n})=>o.css([""," ",""],"standard"===e&&o.css(["& + &{margin-top:-1px;}border:1px solid var(--container-action-border-default);",";",";"],"default"===t&&o.css(["border-left:none;border-right:none;"]),"none"===t&&o.css(["border:none;"])),"simple"===e&&o.css(["gap:",";",""],i?"var(--global-space-comp-l)":"0px",n&&o.css(["transition:gap 0.4s;"])))),e.space),d=c.default.h3.withConfig({displayName:"accordion.style__StyledAccordionTitle",componentId:"carbon_v162_20_2__sc-5e39e462-2"})([""," color:var(--container-action-txt-default);margin:0;"],(({$size:e})=>e&&o.css(["font:",";"],r[e].titleFont))),p=c.default.span.withConfig({displayName:"accordion.style__StyledAccordionSubTitle",componentId:"carbon_v162_20_2__sc-5e39e462-3"})([""," color:var(--container-action-txt-alt-default);"],(({$size:e})=>e&&o.css(["font:",";"],r[e].subtitleFont))),_=c.default(t.default).withConfig({displayName:"accordion.style__StyledAccordionIcon",componentId:"carbon_v162_20_2__sc-5e39e462-4"})(["width:var(--global-size-2-xs);height:var(--global-size-2-xs);color:var(--container-action-icon-default);",";"],(({$isExpanded:e,$allowMotion:t})=>o.css(["transform:rotate(0deg);"," ",""],e&&o.css(["transform:rotate(-180deg);"]),t&&o.css(["transition:transform 0.4s;"])))),g=c.default.div.withConfig({displayName:"accordion.style__StyledAccordionTitleWrapper",componentId:"carbon_v162_20_2__sc-5e39e462-5"})(["display:flex;flex-direction:column;align-items:flex-start;gap:var(--global-space-comp-xs);flex:1 0 0;"]),f=c.default.div.attrs(i.default).withConfig({displayName:"accordion.style__StyledAccordionTitleContainer",componentId:"carbon_v162_20_2__sc-5e39e462-6"})(["",""],(({$size:t,$iconAlign:i})=>t&&o.css(["display:flex;flex:1 0 0;align-items:center;align-self:stretch;background-color:transparent;border:none;text-align:left;gap:var(--global-space-comp-l);padding:",";"," "," &:hover{cursor:pointer;background-color:var(--container-action-bg-hover);}&:focus{"," z-index:1;}"],r[t].headingPadding,"right"===i&&o.css(["flex-direction:row-reverse;"]),e.space,n.default()))),y=c.default.div.withConfig({displayName:"accordion.style__StyledAccordionLine",componentId:"carbon_v162_20_2__sc-5e39e462-7"})(["position:absolute;width:2px;background-color:var(--input-typical-border-alt);border-radius:var(--global-radius-action-xs);height:100%;"]),m=c.default.div.withConfig({displayName:"accordion.style__StyledAccordionContentContainer",componentId:"carbon_v162_20_2__sc-5e39e462-8"})(["position:relative;overflow:hidden;height:0;opacity:0;",""],(({$height:e,$isExpanded:t,$allowMotion:i})=>o.css([""," ",""],i&&o.css(["transition:height 0.4s,opacity 0.2s;"]),t&&o.css(["height:","px;opacity:1;"],e)))),u=c.default.div.withConfig({displayName:"accordion.style__StyledAccordionContent",componentId:"carbon_v162_20_2__sc-5e39e462-9"})(["",""],(({$variant:e})=>o.css(["overflow:hidden;",""],"simple"===e&&o.css(["margin-left:var(--global-space-comp-l);"]))));exports.StyledAccordionContainer=l,exports.StyledAccordionContent=u,exports.StyledAccordionContentContainer=m,exports.StyledAccordionGroup=s,exports.StyledAccordionIcon=_,exports.StyledAccordionLine=y,exports.StyledAccordionSubTitle=p,exports.StyledAccordionTitle=d,exports.StyledAccordionTitleContainer=f,exports.StyledAccordionTitleWrapper=g;
1
+ "use strict";var o=require("styled-components"),e=require("styled-system"),t=require("../icon/icon.component.js");require("../icon/icon.style.js");var i=require("../../style/themes/apply-base-theme.js"),n=require("../../style/utils/add-focus-styling.js");function a(o){return o&&o.__esModule?o:{default:o}}var c=a(o);const r={small:{titleFont:"var(--global-font-static-section-heading-s)",subtitleFont:"var(--global-font-static-comp-medium-s)",headingPadding:"var(--global-space-comp-l)"},medium:{titleFont:"var(--global-font-static-section-heading-m)",subtitleFont:"var(--global-font-static-comp-medium-l)",headingPadding:"var(--global-space-comp-xl)"}},s=c.default.div.attrs(i.default).withConfig({displayName:"accordion.style__StyledAccordionGroup",componentId:"carbon_v162_21_0__sc-5e39e462-0"})(["",""],e.margin),l=c.default.div.attrs(i.default).withConfig({displayName:"accordion.style__StyledAccordionContainer",componentId:"carbon_v162_21_0__sc-5e39e462-1"})(["display:flex;align-items:stretch;justify-content:center;flex-direction:column;box-sizing:border-box;width:",";"," &&{","}"],(({$width:o})=>o||"100%"),(({$variant:e,$borders:t,$isExpanded:i,$allowMotion:n})=>o.css([""," ",""],"standard"===e&&o.css(["& + &{margin-top:-1px;}border:1px solid var(--container-action-border-default);",";",";"],"default"===t&&o.css(["border-left:none;border-right:none;"]),"none"===t&&o.css(["border:none;"])),"simple"===e&&o.css(["gap:",";",""],i?"var(--global-space-comp-l)":"0px",n&&o.css(["transition:gap 0.4s;"])))),e.space),d=c.default.h3.withConfig({displayName:"accordion.style__StyledAccordionTitle",componentId:"carbon_v162_21_0__sc-5e39e462-2"})([""," color:var(--container-action-txt-default);margin:0;"],(({$size:e})=>e&&o.css(["font:",";"],r[e].titleFont))),p=c.default.span.withConfig({displayName:"accordion.style__StyledAccordionSubTitle",componentId:"carbon_v162_21_0__sc-5e39e462-3"})([""," color:var(--container-action-txt-alt-default);"],(({$size:e})=>e&&o.css(["font:",";"],r[e].subtitleFont))),_=c.default(t.default).withConfig({displayName:"accordion.style__StyledAccordionIcon",componentId:"carbon_v162_21_0__sc-5e39e462-4"})(["width:var(--global-size-2-xs);height:var(--global-size-2-xs);color:var(--container-action-icon-default);",";"],(({$isExpanded:e,$allowMotion:t})=>o.css(["transform:rotate(0deg);"," ",""],e&&o.css(["transform:rotate(-180deg);"]),t&&o.css(["transition:transform 0.4s;"])))),g=c.default.div.withConfig({displayName:"accordion.style__StyledAccordionTitleWrapper",componentId:"carbon_v162_21_0__sc-5e39e462-5"})(["display:flex;flex-direction:column;align-items:flex-start;gap:var(--global-space-comp-xs);flex:1 0 0;"]),f=c.default.div.attrs(i.default).withConfig({displayName:"accordion.style__StyledAccordionTitleContainer",componentId:"carbon_v162_21_0__sc-5e39e462-6"})(["",""],(({$size:t,$iconAlign:i})=>t&&o.css(["display:flex;flex:1 0 0;align-items:center;align-self:stretch;background-color:transparent;border:none;text-align:left;gap:var(--global-space-comp-l);padding:",";"," "," &:hover{cursor:pointer;background-color:var(--container-action-bg-hover);}&:focus{"," z-index:1;}"],r[t].headingPadding,"right"===i&&o.css(["flex-direction:row-reverse;"]),e.space,n.default()))),y=c.default.div.withConfig({displayName:"accordion.style__StyledAccordionLine",componentId:"carbon_v162_21_0__sc-5e39e462-7"})(["position:absolute;width:2px;background-color:var(--input-typical-border-alt);border-radius:var(--global-radius-action-xs);height:100%;"]),m=c.default.div.withConfig({displayName:"accordion.style__StyledAccordionContentContainer",componentId:"carbon_v162_21_0__sc-5e39e462-8"})(["position:relative;overflow:hidden;height:0;opacity:0;",""],(({$height:e,$isExpanded:t,$allowMotion:i})=>o.css([""," ",""],i&&o.css(["transition:height 0.4s,opacity 0.2s;"]),t&&o.css(["height:","px;opacity:1;"],e)))),u=c.default.div.withConfig({displayName:"accordion.style__StyledAccordionContent",componentId:"carbon_v162_21_0__sc-5e39e462-9"})(["",""],(({$variant:e})=>o.css(["overflow:hidden;",""],"simple"===e&&o.css(["margin-left:var(--global-space-comp-l);"]))));exports.StyledAccordionContainer=l,exports.StyledAccordionContent=u,exports.StyledAccordionContentContainer=m,exports.StyledAccordionGroup=s,exports.StyledAccordionIcon=_,exports.StyledAccordionLine=y,exports.StyledAccordionSubTitle=p,exports.StyledAccordionTitle=d,exports.StyledAccordionTitleContainer=f,exports.StyledAccordionTitleWrapper=g;
@@ -2,10 +2,6 @@ export type Alignment = "left" | "right";
2
2
  type ActionPopoverContextType = {
3
3
  setOpenPopover: (isOpen: boolean) => void;
4
4
  focusButton: () => void;
5
- horizontalAlignment: Alignment;
6
- submenuPosition: Alignment;
7
- selectedSubmenuRef: HTMLUListElement | null;
8
- setSelectedSubmenuRef: (ref: HTMLUListElement | null) => void;
9
5
  };
10
6
  export declare const ActionPopoverProvider: import("react").Provider<ActionPopoverContextType | null>;
11
7
  export declare const useActionPopoverContext: () => ActionPopoverContextType;
@@ -1,8 +1,3 @@
1
1
  import React from "react";
2
- type ReactItem = React.ReactChild | React.ReactFragment | React.ReactPortal;
3
- export declare const getItems: (children: React.ReactNode | React.ReactNode[]) => ReactItem[];
4
- export declare const isItemDisabled: (item: ReactItem) => boolean;
5
- export declare const findFirstFocusableItem: (items: ReactItem[]) => number;
6
- export declare const findLastFocusableItem: (items: ReactItem[]) => number;
7
- export declare const checkChildrenForString: (children: React.ReactNode) => boolean;
8
- export {};
2
+ declare const checkChildrenForString: (children: React.ReactNode) => boolean;
3
+ export default checkChildrenForString;
@@ -1 +1 @@
1
- "use strict";var e=require("react"),t=require("../action-popover-item/action-popover-item.component.js");function r(e){return e&&e.__esModule?e:{default:e}}var i=r(e);const o=e=>{var t;return i.default.isValidElement(e)&&!!(null===(t=e.props)||void 0===t?void 0:t.disabled)},n=e=>i.default.Children.toArray(e).some((e=>"string"==typeof e||!!i.default.isValidElement(e)&&n(e.props.children)));exports.checkChildrenForString=n,exports.findFirstFocusableItem=e=>e.findIndex(((t,r)=>!o(e[r]))),exports.findLastFocusableItem=e=>{for(let t=e.length-1;t>=0;t--)if(!o(e[t]))return t;return-1},exports.getItems=e=>i.default.Children.toArray(e).filter((e=>i.default.isValidElement(e)&&e.type===t.ActionPopoverItem)),exports.isItemDisabled=o;
1
+ "use strict";function e(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("react"));const r=e=>t.default.Children.toArray(e).some((e=>"string"==typeof e||!!t.default.isValidElement(e)&&r(e.props.children)));exports.default=r;
@@ -1,2 +1,2 @@
1
- import { MenuItemDivider as ActionPopoverDivider } from "../action-popover.style";
1
+ import { MenuItemDivider as ActionPopoverDivider } from "../../../__internal__/popover-menu";
2
2
  export default ActionPopoverDivider;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("../action-popover.style.js");e.MenuItemDivider.displayName="ActionPopoverDivider",exports.default=e.MenuItemDivider;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0}),require("../../../__internal__/popover-menu/popover-menu.component.js"),require("../../../__internal__/popover-menu/menu-item/menu-item.component.js"),require("../../../__internal__/popover-menu/menu-item/menu-item-content/menu-item-leading.component.js"),require("../../../__internal__/popover-menu/menu-item/menu-item-content/menu-item-label.component.js"),require("../../../__internal__/popover-menu/menu-item/menu-item-content/menu-item-subtext.component.js");var e=require("../../../__internal__/popover-menu/menu-item/menu-item-divider/menu-item-divider.component.js");require("../../../__internal__/popover-menu/menu-item/menu-item-heading/menu-item-heading.component.js"),e.default.displayName="ActionPopoverDivider",exports.default=e.default;
@@ -1,5 +1,4 @@
1
1
  import React from "react";
2
- import { Alignment } from "../__internal__/action-popover.context";
3
2
  import { IconType } from "../../icon";
4
3
  export interface ActionPopoverItemProps {
5
4
  /** The text label to display for this Item */
@@ -17,14 +16,10 @@ export interface ActionPopoverItemProps {
17
16
  /** Submenu component for item */
18
17
  submenu?: React.ReactNode;
19
18
  /** @ignore @private */
20
- focusItem?: boolean;
21
- /** @ignore @private */
22
- currentSubmenuPosition?: Alignment;
23
- /** @ignore @private */
24
- setCurrentSubmenuPosition?: (value: Alignment) => void;
19
+ __isSubmenuParent?: boolean;
25
20
  }
26
21
  export declare const ActionPopoverItem: {
27
- ({ children, icon, disabled, onClick: onClickProp, submenu, focusItem, download, href, currentSubmenuPosition, setCurrentSubmenuPosition, ...rest }: ActionPopoverItemProps): React.JSX.Element;
22
+ ({ children, icon, disabled, onClick, download, href, __isSubmenuParent, ...rest }: ActionPopoverItemProps): React.JSX.Element;
28
23
  displayName: string;
29
24
  };
30
25
  export default ActionPopoverItem;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("invariant"),r=require("../action-popover.style.js"),o=require("../../../__internal__/utils/helpers/events/events.js"),u=require("../../../__internal__/utils/helpers/guid/index.js"),i=require("../__internal__/action-popover.context.js"),c=require("../action-popover-menu/action-popover-menu.component.js");function a(e){return e&&e.__esModule?e:{default:e}}var l=a(t),s=a(n);function f(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),r.forEach((function(t){f(e,t,n[t])}))}return e}function d(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t}(Object(t)).forEach((function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))})),e}function m(e){return Boolean(e&&e.current)}const v=n=>{var{children:a,icon:f,disabled:v=!1,onClick:b,submenu:y,focusItem:P,download:h,href:g,currentSubmenuPosition:O,setCurrentSubmenuPosition:j}=n,_=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},u=Object.keys(e);for(r=0;r<u.length;r++)n=u[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(r=0;r<u.length;r++)n=u[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(n,["children","icon","disabled","onClick","submenu","focusItem","download","href","currentSubmenuPosition","setCurrentSubmenuPosition"]);s.default(!l.default.isValidElement(y)||y.type===c.default,"ActionPopoverItem only accepts submenu of type `ActionPopoverMenu`");const{setOpenPopover:S,focusButton:x,submenuPosition:I,selectedSubmenuRef:w,setSelectedSubmenuRef:E}=i.useActionPopoverContext(),[D,k]=t.useState(void 0),[M]=t.useState(u.default()),[C,K]=t.useState(!1),[R,q]=t.useState(0),A=t.useRef(null),T=t.useRef(null),L=t.useRef(null),W=t.useRef(null),B=t.useCallback((()=>{const e=function(e,t,n,r){if(!e.current||!t.current)return r||n;const{left:o,right:u}=e.current.getBoundingClientRect(),{offsetWidth:i}=t.current,c=document.body.clientWidth;return"left"===n?o>=i?"left":"right":c>=u+i?"right":"left"}(T,A,I,O);return null==j||j(e),m(T)&&m(A)&&y}),[y,j,I,O]);t.useEffect((()=>{!v&&A.current&&K(w===A.current)}),[v,w]),t.useEffect((()=>{k((()=>{if(!T.current||!A.current)return;const{offsetWidth:e}=A.current,t="left"===O;return{left:t?-e:"auto",right:t?"auto":-e}}))}),[y,O]),t.useEffect((()=>{y&&B()}),[B,y]),t.useEffect((()=>{P&&setTimeout((()=>{var e;null===(e=T.current)||void 0===e||e.focus()}),0)}),[P]),t.useEffect((()=>function(){L.current&&clearTimeout(L.current),W.current&&clearTimeout(W.current)}),[]),t.useEffect((()=>{const e="resize";return window.addEventListener(e,B),function(){window.removeEventListener(e,B)}}),[B]);const $=t.useCallback((e=>{var t;e.stopPropagation(),v?(null===(t=T.current)||void 0===t||t.focus(),e.preventDefault()):(S(!1),x(),b&&b(e))}),[v,x,b,S]),V=t.useCallback((e=>{if(o.default.isSpaceKey(e))e.preventDefault(),e.stopPropagation();else if(v)o.default.isEnterKey(e)&&e.stopPropagation();else if(y){var t;if("left"===O){if(o.default.isLeftKey(e)||o.default.isEnterKey(e))E(A.current),K(!0),q(0),e.stopPropagation();else if(o.default.isRightKey(e)){var n;K(!1),null===(n=T.current)||void 0===n||n.focus(),e.stopPropagation()}}else(o.default.isRightKey(e)||o.default.isEnterKey(e))&&(K(!0),q(0),e.stopPropagation()),o.default.isLeftKey(e)&&(K(!1),null===(t=T.current)||void 0===t||t.focus(),e.stopPropagation());e.preventDefault()}else o.default.isEnterKey(e)&&(g||(e.preventDefault(),$(e)))}),[v,y,O,E,$,g]),z=d(p({},!v&&{onClick:e=>{var t;E(A.current),K(!0),null===(t=T.current)||void 0===t||t.focus(),e.preventDefault(),e.stopPropagation()}}),{"aria-haspopup":"true","aria-controls":`ActionPopoverMenu_${M}`,"aria-expanded":C}),F=p({},!v&&{onMouseEnter:e=>{L.current&&clearTimeout(L.current),q(-1),L.current=setTimeout((()=>{K(!0),E(A.current)}),150),e.stopPropagation()},onMouseLeave:e=>{W.current&&clearTimeout(W.current),W.current=setTimeout((()=>{K(!1)}),150),e.stopPropagation()}});return e.jsxs(r.StyledMenuItemWrapper,d(p({onKeyDown:V},y&&F),{children:[e.jsxs(r.StyledMenuItem,d(p(d(p({},_),{ref:T,onClick:$,type:"button",tabIndex:0,isDisabled:v}),v&&{"aria-disabled":!0},!!g&&{as:"a",download:h,href:g},y&&z),{children:[y&&m(T)&&e.jsx(r.SubMenuItemIcon,{"aria-hidden":!0,"data-element":"action-popover-menu-item-chevron","data-role":"chevron-icon",type:"left"===O?"chevron_left_thick":"chevron_right_thick"}),f&&e.jsx(r.MenuItemIcon,{"aria-hidden":!0,type:f,"data-element":"action-popover-menu-item-icon","data-role":"item-icon"}),e.jsx(r.StyledMenuItemInnerText,{"data-element":"action-popover-menu-item-inner-text",children:a})]})),l.default.isValidElement(y)?l.default.cloneElement(y,{parentID:`ActionPopoverItem_${M}`,menuID:`ActionPopoverMenu_${M}`,"data-element":"action-popover-submenu",isOpen:C,ref:A,style:D,setOpen:K,setFocusIndex:q,focusIndex:R}):null]}))};v.displayName="ActionPopoverItem",exports.ActionPopoverItem=v,exports.default=v;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("../../button/__next__/button.component.js"),n=require("../__internal__/action-popover.context.js");function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){o(e,t,r[t])}))}return e}function i(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t}(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))})),e}const u=o=>{var{children:u,icon:l,disabled:s=!1,onClick:b,download:p,href:a,__isSubmenuParent:f}=o,O=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},c=Object.keys(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(n=0;n<c.length;n++)r=c[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(o,["children","icon","disabled","onClick","download","href","__isSubmenuParent"]);const{setOpenPopover:y,focusButton:d}=n.useActionPopoverContext(),j=t.useCallback((e=>{f||(y(!1),d(),null==b||b(e))}),[f,d,b,y]);return e.jsx(r.Button,i(c(i(c({},O),{disabled:s,href:a,iconType:l,iconPosition:"before",onClick:j}),a&&p?{download:!0}:{}),{children:u}))};u.displayName="ActionPopoverItem",exports.ActionPopoverItem=u,exports.default=u;
@@ -2,41 +2,22 @@ import React from "react";
2
2
  export interface ActionPopoverMenuBaseProps {
3
3
  /** Children for the menu */
4
4
  children?: React.ReactNode;
5
- /**
6
- * @ignore
7
- * @private
8
- * @internal
9
- * Index to control which item is focused */
10
- focusIndex?: number;
11
5
  /** Flag to indicate whether a menu should open */
12
6
  isOpen?: boolean;
13
7
  /** A unique ID for the menu */
14
8
  menuID?: string;
15
- /**
16
- * @ignore
17
- * @private
18
- * @internal
19
- * Callback to set the index of the focused item */
20
- setFocusIndex?: (args: number) => void;
21
9
  /** Callback to set the isOpen flag */
22
10
  setOpen?: (args: boolean) => void;
23
11
  /** Unique ID for the menu's parent */
24
12
  parentID?: string;
25
13
  /** Set whether the menu should open above or below the button */
26
14
  placement?: "bottom" | "top";
27
- /** @ignore @private */
28
- role?: string;
29
- /** @ignore @private */
30
- "data-element"?: string;
31
- /** @ignore @private */
32
- style?: {
33
- left: string | number;
34
- top?: string;
35
- bottom?: string;
36
- right: string | number;
37
- };
38
15
  }
39
16
  export interface ActionPopoverMenuProps extends ActionPopoverMenuBaseProps, React.RefAttributes<HTMLUListElement> {
40
17
  }
18
+ /**
19
+ * @deprecated This has been kept for backward compatibility.
20
+ * Wrap ActionPopoverItems in a fragment and pass to `submenu` directly
21
+ * */
41
22
  declare const ActionPopoverMenu: React.ForwardRefExoticComponent<ActionPopoverMenuBaseProps & React.RefAttributes<HTMLUListElement>>;
42
23
  export default ActionPopoverMenu;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),o=require("invariant"),n=require("../action-popover.style.js"),r=require("../../../__internal__/utils/helpers/events/events.js"),i=require("../action-popover-item/action-popover-item.component.js");require("../action-popover-divider/action-popover-divider.component.js");var a=require("../__internal__/action-popover.context.js"),l=require("../__internal__/action-popover.utils.js");function s(e){return e&&e.__esModule?e:{default:e}}var u=s(t),p=s(o);function c(e,t,o){return t in e?Object.defineProperty(e,t,{value:o,enumerable:!0,configurable:!0,writable:!0}):e[t]=o,e}const f=u.default.forwardRef(((o,s)=>{var{children:f,parentID:d,focusIndex:m,isOpen:v,menuID:y,setOpen:b,setFocusIndex:O,placement:P="bottom"}=o,j=function(e,t){if(null==e)return{};var o,n,r=function(e,t){if(null==e)return{};var o,n,r={},i=Object.keys(e);for(n=0;n<i.length;n++)o=i[n],t.indexOf(o)>=0||(r[o]=e[o]);return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)o=i[n],t.indexOf(o)>=0||Object.prototype.propertyIsEnumerable.call(e,o)&&(r[o]=e[o])}return r}(o,["children","parentID","focusIndex","isOpen","menuID","setOpen","setFocusIndex","placement"]);const{focusButton:g,submenuPosition:h,horizontalAlignment:I}=a.useActionPopoverContext();p.default(b&&O&&void 0!==m,"ActionPopoverMenu must be used within an ActionPopover or ActionPopoverItem component");const D=t.useMemo((()=>!u.default.Children.toArray(f).find((e=>!u.default.isValidElement(e)||"ActionPopoverItem"!==e.type.displayName&&"ActionPopoverDivider"!==e.type.displayName))),[f]);p.default(D,`ActionPopoverMenu only accepts children of type \`${i.ActionPopoverItem.displayName}\` and \`${n.MenuItemDivider.displayName}\`.`);const w=t.useMemo((()=>l.getItems(f)),[f]),_=t.useCallback((e=>l.isItemDisabled(w[e])),[w]),x=l.findFirstFocusableItem(w),A=l.findLastFocusableItem(w),M=t.useCallback((e=>{if(r.default.isTabKey(e))e.preventDefault(),g(),b(!1);else if(r.default.isDownKey(e)){e.preventDefault(),e.stopPropagation();let t=m+1;for(;t<w.length&&_(t);)t+=1;t>=w.length&&(t=x),O(t)}else if(r.default.isUpKey(e)){e.preventDefault(),e.stopPropagation();let t=m-1;for(;t>=x&&_(t);)t-=1;t<x&&(t=A),O(t)}else if(r.default.isHomeKey(e))e.preventDefault(),e.stopPropagation(),O(x);else if(r.default.isEndKey(e))e.preventDefault(),e.stopPropagation(),O(A);else if(1===e.key.length){let t,o;e.stopPropagation(),w.forEach(((n,r)=>{u.default.isValidElement(n)&&!_(r)&&n.props.children.toLowerCase().startsWith(e.key.toLowerCase())&&(void 0===t&&(t=r),r>m&&void 0===o&&(o=r))})),void 0!==o?O(o):void 0!==t&&O(t)}}),[g,b,m,w,_,O,x,A]),[q,E]=t.useState(h),S=t.useMemo((()=>{let e=0;return u.default.Children.map(f,(t=>u.default.isValidElement(t)&&t.type===i.ActionPopoverItem?(e+=1,u.default.cloneElement(t,{focusItem:v&&m===e-1,currentSubmenuPosition:q,setCurrentSubmenuPosition:E})):t))}),[f,m,v,q]);return e.jsx(n.Menu,(C=function(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{},n=Object.keys(o);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(o).filter((function(e){return Object.getOwnPropertyDescriptor(o,e).enumerable})))),n.forEach((function(t){c(e,t,o[t])}))}return e}({"data-component":"action-popover","data-submenu-placement":P,isOpen:!!v,onKeyDown:M,id:y,"aria-labelledby":d,ref:s,role:"list",submenuLeft:"left"===q,iconLeft:"left"===I},j),k=null!=(k={children:S})?k:{},Object.getOwnPropertyDescriptors?Object.defineProperties(C,Object.getOwnPropertyDescriptors(k)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t.push.apply(t,o)}return t}(Object(k)).forEach((function(e){Object.defineProperty(C,e,Object.getOwnPropertyDescriptor(k,e))})),C));var C,k}));f.displayName="ActionPopoverMenu",exports.default=f;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");function r(e){return e&&e.__esModule?e:{default:e}}const t=r(require("react")).default.forwardRef(((r,t)=>{var{children:n}=r;return function(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t,n,o={},u=Object.keys(e);for(n=0;n<u.length;n++)t=u[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var u=Object.getOwnPropertySymbols(e);for(n=0;n<u.length;n++)t=u[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}}(r,["children"]),e.jsx(e.Fragment,{children:n})}));t.displayName="ActionPopoverMenu",exports.default=t;
@@ -1,34 +1,37 @@
1
1
  import React from "react";
2
- import { ButtonIconPosition, ButtonTypes, SizeOptions } from "../../button/button.component";
2
+ import { ButtonProps } from "../../button/__next__/";
3
3
  import { IconType } from "../../icon";
4
- export type ActionPopoverMenuButtonAria = {
5
- "aria-haspopup": string;
6
- "aria-label"?: string;
7
- "aria-labelledby"?: string;
8
- "aria-describedby"?: string;
9
- "aria-controls": string;
10
- "aria-expanded": string;
11
- };
4
+ import { RenderButtonProps } from "../action-popover.component";
5
+ export type ActionPopoverMenuButtonAria = RenderButtonProps["ariaAttributes"];
12
6
  export interface ActionPopoverMenuButtonProps {
13
7
  /** ARIA attributes to be applied to the button HTML element */
14
8
  ariaAttributes: ActionPopoverMenuButtonAria;
15
- /** Variant of the menu button */
16
- buttonType?: ButtonTypes;
9
+ /**
10
+ * Variant of the menu button
11
+ */
12
+ buttonType?: Extract<ButtonProps["variantType"], "primary" | "secondary" | "tertiary">;
17
13
  /** Identifier used for testing purposes, applied to the root element of the component. */
18
14
  "data-element": string;
19
15
  /** Content of the button */
20
16
  children?: string;
21
- /** Defines an Icon position related to the children: "before" | "after" */
22
- iconPosition?: ButtonIconPosition;
23
- /** Defines an Icon type within the button */
17
+ /**
18
+ * Defines an Icon position related to the children: "before" | "after"
19
+ */
20
+ iconPosition?: ButtonProps["iconPosition"];
21
+ /**
22
+ * Defines an Icon type within the button
23
+ */
24
24
  iconType?: IconType;
25
25
  /** Assigns a size to the button: "small" | "medium" | "large" */
26
- size?: SizeOptions;
27
- /** Overrides the default tabindex of the component */
26
+ size?: ButtonProps["size"];
27
+ /**
28
+ * Overrides the default tabindex of the component
29
+ */
28
30
  tabIndex: number;
29
31
  }
30
- export declare const ActionPopoverMenuButton: {
31
- ({ buttonType, iconType, iconPosition, size, children, ariaAttributes, ...props }: ActionPopoverMenuButtonProps): React.JSX.Element;
32
- displayName: string;
33
- };
32
+ /**
33
+ * @deprecated This component is kept for backward compatibility.
34
+ * Use `Button` component directly instead.
35
+ * */
36
+ export declare const ActionPopoverMenuButton: React.ForwardRefExoticComponent<ActionPopoverMenuButtonProps & React.RefAttributes<HTMLElement>>;
34
37
  export default ActionPopoverMenuButton;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime");require("react");var t=require("../action-popover.style.js"),r=require("../../button/button.component.js");function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),o.forEach((function(t){n(e,t,r[t])}))}return e}const i=n=>{var i,c,{buttonType:u,iconType:p,iconPosition:s,size:b,children:l,ariaAttributes:a}=n,y=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(n,["buttonType","iconType","iconPosition","size","children","ariaAttributes"]);return e.jsx(t.MenuButtonOverrideWrapper,{children:e.jsx(r.default,(i=o({buttonType:u,iconType:p,iconPosition:s,size:b},a,y),c={children:l},c=null!=c?c:{},Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(c)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t}(Object(c)).forEach((function(e){Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(c,e))})),i))})};i.displayName="ActionPopoverMenuButton",exports.ActionPopoverMenuButton=i,exports.default=i;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("../../button/__next__/button.component.js");function n(e){return e&&e.__esModule?e:{default:e}}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const i=n(t).default.forwardRef(((t,n)=>{var i,c,{buttonType:u,iconType:p,iconPosition:s,size:l,children:b,ariaAttributes:a}=t,f=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(t,["buttonType","iconType","iconPosition","size","children","ariaAttributes"]);return e.jsx(r.Button,(i=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),n.forEach((function(t){o(e,t,r[t])}))}return e}({variantType:u,iconType:p,iconPosition:s,size:l},a,f),c=null!=(c={ref:n,children:b})?c:{},Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(c)):function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t}(Object(c)).forEach((function(e){Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(c,e))})),i))}));i.displayName="ActionPopoverMenuButton",exports.ActionPopoverMenuButton=i,exports.default=i;