carbon-react 162.10.0 → 162.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (483) 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-overrides.style.d.ts +0 -1
  12. package/esm/__internal__/input/input-style-overrides.style.js +1 -1
  13. package/esm/__internal__/input/input.style.js +1 -1
  14. package/esm/__internal__/input-icon-toggle/input-icon-toggle.style.js +1 -1
  15. package/esm/__internal__/label/label.style.js +1 -1
  16. package/esm/__internal__/legacy-error-border/error-border.style.js +1 -1
  17. package/esm/__internal__/legacy-hint-text/hint-text.style.js +1 -1
  18. package/esm/__internal__/legacy-input/input-presentation.style.js +1 -1
  19. package/esm/__internal__/legacy-input/input.style.js +1 -1
  20. package/esm/__internal__/legacy-label/icon-wrapper.style.js +1 -1
  21. package/esm/__internal__/legacy-label/label.style.js +1 -1
  22. package/esm/__internal__/modal/modal.style.js +1 -1
  23. package/esm/__internal__/popover/popover.style.js +1 -1
  24. package/esm/__internal__/popover-menu/menu-item/menu-item-content/menu-item-label.component.js +1 -1
  25. package/esm/__internal__/popover-menu/menu-item/menu-item-content/menu-item-leading.component.js +1 -1
  26. package/esm/__internal__/popover-menu/menu-item/menu-item-content/menu-item-subtext.component.js +1 -1
  27. package/esm/__internal__/popover-menu/menu-item/menu-item-divider/menu-item-divider.component.js +1 -1
  28. package/esm/__internal__/popover-menu/menu-item/menu-item-heading/menu-item-heading.component.js +1 -1
  29. package/esm/__internal__/popover-menu/menu-item/menu-item.component.js +1 -1
  30. package/esm/__internal__/popover-menu/popover-menu.component.js +1 -1
  31. package/esm/__internal__/validation-message/__next__/validation-message.style.js +1 -1
  32. package/esm/__internal__/validation-message/validation-message.style.js +1 -1
  33. package/esm/__internal__/validations/validation-icon.style.js +1 -1
  34. package/esm/components/accordion/accordion.style.js +1 -1
  35. package/esm/components/action-popover/action-popover.style.js +1 -1
  36. package/esm/components/adaptive-sidebar/adaptive-sidebar.style.js +1 -1
  37. package/esm/components/advanced-color-picker/advanced-color-picker-cell.style.js +1 -1
  38. package/esm/components/advanced-color-picker/advanced-color-picker.style.js +1 -1
  39. package/esm/components/anchor-navigation/anchor-navigation-item/anchor-navigation-item.style.js +1 -1
  40. package/esm/components/anchor-navigation/anchor-navigation.style.js +1 -1
  41. package/esm/components/anchor-navigation/anchor-section-divider.component.js +1 -1
  42. package/esm/components/badge/badge.style.js +1 -1
  43. package/esm/components/batch-selection/batch-selection.style.js +1 -1
  44. package/esm/components/box/box.style.js +1 -1
  45. package/esm/components/breadcrumbs/breadcrumbs.style.js +1 -1
  46. package/esm/components/breadcrumbs/crumb/crumb.style.js +1 -1
  47. package/esm/components/button/__next__/button.style.js +1 -1
  48. package/esm/components/button/button.style.js +1 -1
  49. package/esm/components/button-bar/button-bar.style.js +1 -1
  50. package/esm/components/button-minor/button-minor.style.js +1 -1
  51. package/esm/components/button-toggle/button-toggle-group/button-toggle-group.style.js +1 -1
  52. package/esm/components/button-toggle/button-toggle.style.js +1 -1
  53. package/esm/components/card/card-column/card-column.style.js +1 -1
  54. package/esm/components/card/card-footer/card-footer.style.js +1 -1
  55. package/esm/components/card/card-row/card-row.style.js +1 -1
  56. package/esm/components/card/card.style.js +1 -1
  57. package/esm/components/checkbox/checkbox-group/checkbox-group.style.js +1 -1
  58. package/esm/components/checkbox/checkbox.style.js +1 -1
  59. package/esm/components/confirm/confirm.style.js +1 -1
  60. package/esm/components/content/content.style.js +1 -1
  61. package/esm/components/date/__internal__/date-picker/day-picker.style.js +1 -1
  62. package/esm/components/date/__internal__/navbar/button.style.js +1 -1
  63. package/esm/components/date/__internal__/navbar/navbar.style.js +1 -1
  64. package/esm/components/date/__internal__/weekday/abbr.style.js +1 -1
  65. package/esm/components/date/__internal__/weekday/weekday.style.js +1 -1
  66. package/esm/components/date/date.style.js +1 -1
  67. package/esm/components/date-range/date-range.style.js +1 -1
  68. package/esm/components/decimal/__internal__/decimal-popover-button.style.js +1 -1
  69. package/esm/components/decimal/decimal.style.js +1 -1
  70. package/esm/components/definition-list/definition-list.style.js +1 -1
  71. package/esm/components/detail/detail.style.js +1 -1
  72. package/esm/components/dialog/__internal__/__next__/dialog.style.js +1 -1
  73. package/esm/components/dismissible-box/dismissible-box.style.js +1 -1
  74. package/esm/components/divider/divider.component.d.ts +4 -1
  75. package/esm/components/divider/divider.component.js +1 -1
  76. package/esm/components/divider/divider.style.js +1 -1
  77. package/esm/components/draggable/draggable-item/draggable-item.style.js +1 -1
  78. package/esm/components/drawer/drawer.style.js +1 -1
  79. package/esm/components/duelling-picklist/duelling-picklist.style.js +1 -1
  80. package/esm/components/duelling-picklist/picklist/picklist.style.js +1 -1
  81. package/esm/components/duelling-picklist/picklist-divider/picklist-divider.style.js +1 -1
  82. package/esm/components/duelling-picklist/picklist-group/picklist-group.style.js +1 -1
  83. package/esm/components/duelling-picklist/picklist-item/picklist-item.style.js +1 -1
  84. package/esm/components/fieldset/fieldset.style.js +1 -1
  85. package/esm/components/file-input/__internal__/file-upload-status/file-upload-status.style.js +1 -1
  86. package/esm/components/file-input/file-input.style.js +1 -1
  87. package/esm/components/flat-table/flat-table-body-draggable/flat-table-body-draggable.style.js +1 -1
  88. package/esm/components/flat-table/flat-table-cell/flat-table-cell.style.js +1 -1
  89. package/esm/components/flat-table/flat-table-checkbox/flat-table-checkbox.style.js +1 -1
  90. package/esm/components/flat-table/flat-table-head/flat-table-head.style.js +1 -1
  91. package/esm/components/flat-table/flat-table-header/flat-table-header.style.js +1 -1
  92. package/esm/components/flat-table/flat-table-row/flat-table-row.style.js +1 -1
  93. package/esm/components/flat-table/flat-table-row-header/flat-table-row-header.style.js +1 -1
  94. package/esm/components/flat-table/flat-table.style.js +1 -1
  95. package/esm/components/flat-table/sort/sort.style.js +1 -1
  96. package/esm/components/form/__internal__/form-summary.style.js +1 -1
  97. package/esm/components/form/form.style.js +1 -1
  98. package/esm/components/form/required-fields-indicator/required-fields-indicator.component.js +1 -1
  99. package/esm/components/global-header/global-header.component.js +1 -1
  100. package/esm/components/grid/grid-container/grid-container.style.js +1 -1
  101. package/esm/components/grid/grid-item/grid-item.style.js +1 -1
  102. package/esm/components/heading/heading.style.js +1 -1
  103. package/esm/components/help/help.style.js +1 -1
  104. package/esm/components/hr/hr.style.js +1 -1
  105. package/esm/components/icon/icon.style.js +1 -1
  106. package/esm/components/icon-button/icon-button.style.js +1 -1
  107. package/esm/components/image/image.style.js +1 -1
  108. package/esm/components/inline-inputs/inline-inputs.style.js +1 -1
  109. package/esm/components/link/link.component.d.ts +0 -2
  110. package/esm/components/link/link.component.js +1 -1
  111. package/esm/components/link/link.style.d.ts +0 -1
  112. package/esm/components/link/link.style.js +1 -1
  113. package/esm/components/link-preview/__internal__/placeholder.component.js +1 -1
  114. package/esm/components/link-preview/link-preview.style.js +1 -1
  115. package/esm/components/loader/__next__/internal/star.style.js +1 -1
  116. package/esm/components/loader/__next__/loader.style.js +1 -1
  117. package/esm/components/loader/loader-square.style.js +1 -1
  118. package/esm/components/loader/loader.style.js +1 -1
  119. package/esm/components/loader-bar/loader-bar.style.js +1 -1
  120. package/esm/components/loader-spinner/loader-spinner.style.js +1 -1
  121. package/esm/components/loader-star/internal/star.style.js +1 -1
  122. package/esm/components/loader-star/loader-star.style.js +1 -1
  123. package/esm/components/menu/__internal__/menu-item-variant.context.d.ts +6 -0
  124. package/esm/components/menu/__internal__/menu-item-variant.context.js +1 -0
  125. package/esm/components/menu/__internal__/strict-menu.context.d.ts +2 -2
  126. package/esm/components/menu/__internal__/strict-menu.context.js +1 -1
  127. package/esm/components/menu/__internal__/submenu/submenu.component.d.ts +3 -11
  128. package/esm/components/menu/__internal__/submenu/submenu.component.js +1 -1
  129. package/esm/components/menu/__internal__/submenu/submenu.context.d.ts +1 -1
  130. package/esm/components/menu/__internal__/submenu/submenu.style.d.ts +15 -18
  131. package/esm/components/menu/__internal__/submenu/submenu.style.js +1 -1
  132. package/esm/components/menu/index.d.ts +1 -1
  133. package/esm/components/menu/menu-divider/menu-divider.component.js +1 -1
  134. package/esm/components/menu/menu-divider/menu-divider.style.d.ts +6 -4
  135. package/esm/components/menu/menu-divider/menu-divider.style.js +1 -1
  136. package/esm/components/menu/menu-full-screen/menu-full-screen.component.js +1 -1
  137. package/esm/components/menu/menu-full-screen/menu-full-screen.style.d.ts +14 -14
  138. package/esm/components/menu/menu-full-screen/menu-full-screen.style.js +1 -1
  139. package/esm/components/menu/menu-item/menu-item.component.d.ts +10 -10
  140. package/esm/components/menu/menu-item/menu-item.component.js +1 -1
  141. package/esm/components/menu/menu-item/menu-item.style.d.ts +30 -21
  142. package/esm/components/menu/menu-item/menu-item.style.js +1 -1
  143. package/esm/components/menu/menu-segment-title/menu-segment-title.component.d.ts +4 -3
  144. package/esm/components/menu/menu-segment-title/menu-segment-title.component.js +1 -1
  145. package/esm/components/menu/menu-segment-title/menu-segment-title.style.d.ts +6 -8
  146. package/esm/components/menu/menu-segment-title/menu-segment-title.style.js +1 -1
  147. package/esm/components/menu/menu.component.d.ts +16 -2
  148. package/esm/components/menu/menu.component.js +1 -1
  149. package/esm/components/menu/menu.config.d.ts +10 -50
  150. package/esm/components/menu/menu.config.js +1 -1
  151. package/esm/components/menu/menu.style.d.ts +4 -13
  152. package/esm/components/menu/menu.style.js +1 -1
  153. package/esm/components/menu/scrollable-block/scrollable-block.component.d.ts +1 -1
  154. package/esm/components/menu/scrollable-block/scrollable-block.component.js +1 -1
  155. package/esm/components/menu/scrollable-block/scrollable-block.style.d.ts +5 -7
  156. package/esm/components/menu/scrollable-block/scrollable-block.style.js +1 -1
  157. package/esm/components/message/message.style.js +1 -1
  158. package/esm/components/multi-action-button/multi-action-button.style.js +1 -1
  159. package/esm/components/navigation-bar/navigation-bar.style.js +1 -1
  160. package/esm/components/note/note.style.js +1 -1
  161. package/esm/components/numeral-date/numeral-date.style.js +1 -1
  162. package/esm/components/option-tile/option-tile.style.js +1 -1
  163. package/esm/components/pager/__internal__/pagination-navigation.style.js +1 -1
  164. package/esm/components/pager/pager.style.js +1 -1
  165. package/esm/components/pages/page/page.style.js +1 -1
  166. package/esm/components/pages/pages.style.js +1 -1
  167. package/esm/components/password/password.style.js +1 -1
  168. package/esm/components/pill/pill.style.js +1 -1
  169. package/esm/components/pod/pod.style.js +1 -1
  170. package/esm/components/popover-container/popover-container.component.js +1 -1
  171. package/esm/components/popover-container/popover-container.style.js +1 -1
  172. package/esm/components/portal/portal.js +1 -1
  173. package/esm/components/portal/portal.style.js +1 -1
  174. package/esm/components/portrait/portrait.style.js +1 -1
  175. package/esm/components/preview/preview.style.js +1 -1
  176. package/esm/components/profile/profile.style.js +1 -1
  177. package/esm/components/progress-tracker/progress-tracker.style.js +1 -1
  178. package/esm/components/radio-button/radio-button-group/radio-button-group.style.js +1 -1
  179. package/esm/components/radio-button/radio-button.style.js +1 -1
  180. package/esm/components/search/__internal__/results-announcement.component.js +1 -1
  181. package/esm/components/search/search.component.d.ts +1 -0
  182. package/esm/components/search/search.component.js +1 -1
  183. package/esm/components/select/__internal__/list-action-button/list-action-button.style.js +1 -1
  184. package/esm/components/select/__internal__/select-list/select-list.style.js +1 -1
  185. package/esm/components/select/__internal__/select-textbox/select-textbox.style.js +1 -1
  186. package/esm/components/select/__internal__/utils/matching-text.style.js +1 -1
  187. package/esm/components/select/multi-select/multi-select.style.js +1 -1
  188. package/esm/components/select/option/option.style.js +1 -1
  189. package/esm/components/select/option-group-header/option-group-header.style.js +1 -1
  190. package/esm/components/select/option-row/option-row.style.js +1 -1
  191. package/esm/components/select/select.style.js +1 -1
  192. package/esm/components/settings-row/settings-row.style.js +1 -1
  193. package/esm/components/sidebar/__internal__/sidebar-content/sidebar-content.style.js +1 -1
  194. package/esm/components/sidebar/__internal__/sidebar-footer/sidebar-footer.style.js +1 -1
  195. package/esm/components/sidebar/__internal__/sidebar-header/sidebar-header.style.js +1 -1
  196. package/esm/components/sidebar/sidebar.style.js +1 -1
  197. package/esm/components/simple-color-picker/simple-color/simple-color.style.js +1 -1
  198. package/esm/components/simple-color-picker/simple-color-picker.style.js +1 -1
  199. package/esm/components/split-button/split-button-toggle.style.js +1 -1
  200. package/esm/components/split-button/split-button.style.js +1 -1
  201. package/esm/components/step-flow/step-flow.style.js +1 -1
  202. package/esm/components/step-sequence/step-sequence-item/step-sequence-item.style.js +1 -1
  203. package/esm/components/step-sequence/step-sequence.style.js +1 -1
  204. package/esm/components/switch/switch.style.js +1 -1
  205. package/esm/components/tabs/__next__/tabs.style.js +1 -1
  206. package/esm/components/text-editor/__internal__/__ui__/CharacterCounter/character-counter.style.js +1 -1
  207. package/esm/components/text-editor/__internal__/__ui__/ContentEditor/content-editor.style.js +1 -1
  208. package/esm/components/text-editor/__internal__/__ui__/Mentions/mentions.style.js +1 -1
  209. package/esm/components/text-editor/__internal__/__ui__/Placeholder/placeholder.style.js +1 -1
  210. package/esm/components/text-editor/__internal__/__ui__/Toolbar/button-group/button-group.style.js +1 -1
  211. package/esm/components/text-editor/__internal__/__ui__/Toolbar/buttons/typography-dropdown/dropdown.style.js +1 -1
  212. package/esm/components/text-editor/__internal__/__ui__/Toolbar/toolbar.style.js +1 -1
  213. package/esm/components/text-editor/text-editor.style.js +1 -1
  214. package/esm/components/textarea/textarea.style.js +1 -1
  215. package/esm/components/textbox/__internal__/__next__/text-input.style.js +1 -1
  216. package/esm/components/tile/tile-footer/tile-footer.style.js +1 -1
  217. package/esm/components/tile/tile.style.js +1 -1
  218. package/esm/components/tile-select/__internal__/accordion/accordion.style.js +1 -1
  219. package/esm/components/tile-select/tile-select.style.js +1 -1
  220. package/esm/components/time/time.style.js +1 -1
  221. package/esm/components/toast/toast.style.js +1 -1
  222. package/esm/components/tokens-wrapper/tokens-wrapper.component.js +1 -1
  223. package/esm/components/tooltip/tooltip-pointer.style.js +1 -1
  224. package/esm/components/tooltip/tooltip.style.js +1 -1
  225. package/esm/components/typography/__internal__/__next__/typography.style.js +1 -1
  226. package/esm/components/typography/typography.style.js +1 -1
  227. package/esm/components/vertical-divider/vertical-divider.style.js +1 -1
  228. package/esm/components/vertical-menu/responsive-vertical-menu/responsive-vertical-menu-divider/responsive-vertical-menu-divider.style.js +1 -1
  229. package/esm/components/vertical-menu/responsive-vertical-menu/responsive-vertical-menu-item/responsive-vertical-menu-item.style.js +1 -1
  230. package/esm/components/vertical-menu/responsive-vertical-menu/responsive-vertical-menu.style.js +1 -1
  231. package/esm/components/vertical-menu/vertical-menu.style.js +1 -1
  232. package/esm/style/design-tokens/carbon-scoped-tokens-provider/carbon-scoped-tokens-provider.component.js +1 -1
  233. package/lib/__internal__/character-count/character-count.style.js +1 -1
  234. package/lib/__internal__/checkable-input/checkable-input.style.js +1 -1
  235. package/lib/__internal__/checkable-input/hidden-checkable-input.style.js +1 -1
  236. package/lib/__internal__/error-border/error-border.style.js +1 -1
  237. package/lib/__internal__/field-help/field-help.style.js +1 -1
  238. package/lib/__internal__/fieldset/__next__/fieldset.style.js +1 -1
  239. package/lib/__internal__/fieldset/fieldset.style.js +1 -1
  240. package/lib/__internal__/form-field/form-field.style.js +1 -1
  241. package/lib/__internal__/full-screen-heading/full-screen-heading.style.js +1 -1
  242. package/lib/__internal__/hint-text/hint-text.style.js +1 -1
  243. package/lib/__internal__/input/input-style-overrides.style.d.ts +0 -1
  244. package/lib/__internal__/input/input-style-overrides.style.js +1 -1
  245. package/lib/__internal__/input/input.style.js +1 -1
  246. package/lib/__internal__/input-icon-toggle/input-icon-toggle.style.js +1 -1
  247. package/lib/__internal__/label/label.style.js +1 -1
  248. package/lib/__internal__/legacy-error-border/error-border.style.js +1 -1
  249. package/lib/__internal__/legacy-hint-text/hint-text.style.js +1 -1
  250. package/lib/__internal__/legacy-input/input-presentation.style.js +1 -1
  251. package/lib/__internal__/legacy-input/input.style.js +1 -1
  252. package/lib/__internal__/legacy-label/icon-wrapper.style.js +1 -1
  253. package/lib/__internal__/legacy-label/label.style.js +1 -1
  254. package/lib/__internal__/modal/modal.style.js +1 -1
  255. package/lib/__internal__/popover/popover.style.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.js +1 -1
  263. package/lib/__internal__/validation-message/__next__/validation-message.style.js +1 -1
  264. package/lib/__internal__/validation-message/validation-message.style.js +1 -1
  265. package/lib/__internal__/validations/validation-icon.style.js +1 -1
  266. package/lib/components/accordion/accordion.style.js +1 -1
  267. package/lib/components/action-popover/action-popover.style.js +1 -1
  268. package/lib/components/adaptive-sidebar/adaptive-sidebar.style.js +1 -1
  269. package/lib/components/advanced-color-picker/advanced-color-picker-cell.style.js +1 -1
  270. package/lib/components/advanced-color-picker/advanced-color-picker.style.js +1 -1
  271. package/lib/components/anchor-navigation/anchor-navigation-item/anchor-navigation-item.style.js +1 -1
  272. package/lib/components/anchor-navigation/anchor-navigation.style.js +1 -1
  273. package/lib/components/anchor-navigation/anchor-section-divider.component.js +1 -1
  274. package/lib/components/badge/badge.style.js +1 -1
  275. package/lib/components/batch-selection/batch-selection.style.js +1 -1
  276. package/lib/components/box/box.style.js +1 -1
  277. package/lib/components/breadcrumbs/breadcrumbs.style.js +1 -1
  278. package/lib/components/breadcrumbs/crumb/crumb.style.js +1 -1
  279. package/lib/components/button/__next__/button.style.js +1 -1
  280. package/lib/components/button/button.style.js +1 -1
  281. package/lib/components/button-bar/button-bar.style.js +1 -1
  282. package/lib/components/button-minor/button-minor.style.js +1 -1
  283. package/lib/components/button-toggle/button-toggle-group/button-toggle-group.style.js +1 -1
  284. package/lib/components/button-toggle/button-toggle.style.js +1 -1
  285. package/lib/components/card/card-column/card-column.style.js +1 -1
  286. package/lib/components/card/card-footer/card-footer.style.js +1 -1
  287. package/lib/components/card/card-row/card-row.style.js +1 -1
  288. package/lib/components/card/card.style.js +1 -1
  289. package/lib/components/checkbox/checkbox-group/checkbox-group.style.js +1 -1
  290. package/lib/components/checkbox/checkbox.style.js +1 -1
  291. package/lib/components/confirm/confirm.style.js +1 -1
  292. package/lib/components/content/content.style.js +1 -1
  293. package/lib/components/date/__internal__/date-picker/day-picker.style.js +1 -1
  294. package/lib/components/date/__internal__/navbar/button.style.js +1 -1
  295. package/lib/components/date/__internal__/navbar/navbar.style.js +1 -1
  296. package/lib/components/date/__internal__/weekday/abbr.style.js +1 -1
  297. package/lib/components/date/__internal__/weekday/weekday.style.js +1 -1
  298. package/lib/components/date/date.style.js +1 -1
  299. package/lib/components/date-range/date-range.style.js +1 -1
  300. package/lib/components/decimal/__internal__/decimal-popover-button.style.js +1 -1
  301. package/lib/components/decimal/decimal.style.js +1 -1
  302. package/lib/components/definition-list/definition-list.style.js +1 -1
  303. package/lib/components/detail/detail.style.js +1 -1
  304. package/lib/components/dialog/__internal__/__next__/dialog.style.js +1 -1
  305. package/lib/components/dismissible-box/dismissible-box.style.js +1 -1
  306. package/lib/components/divider/divider.component.d.ts +4 -1
  307. package/lib/components/divider/divider.component.js +1 -1
  308. package/lib/components/divider/divider.style.js +1 -1
  309. package/lib/components/draggable/draggable-item/draggable-item.style.js +1 -1
  310. package/lib/components/drawer/drawer.style.js +1 -1
  311. package/lib/components/duelling-picklist/duelling-picklist.style.js +1 -1
  312. package/lib/components/duelling-picklist/picklist/picklist.style.js +1 -1
  313. package/lib/components/duelling-picklist/picklist-divider/picklist-divider.style.js +1 -1
  314. package/lib/components/duelling-picklist/picklist-group/picklist-group.style.js +1 -1
  315. package/lib/components/duelling-picklist/picklist-item/picklist-item.style.js +1 -1
  316. package/lib/components/fieldset/fieldset.style.js +1 -1
  317. package/lib/components/file-input/__internal__/file-upload-status/file-upload-status.style.js +1 -1
  318. package/lib/components/file-input/file-input.style.js +1 -1
  319. package/lib/components/flat-table/flat-table-body-draggable/flat-table-body-draggable.style.js +1 -1
  320. package/lib/components/flat-table/flat-table-cell/flat-table-cell.style.js +1 -1
  321. package/lib/components/flat-table/flat-table-checkbox/flat-table-checkbox.style.js +1 -1
  322. package/lib/components/flat-table/flat-table-head/flat-table-head.style.js +1 -1
  323. package/lib/components/flat-table/flat-table-header/flat-table-header.style.js +1 -1
  324. package/lib/components/flat-table/flat-table-row/flat-table-row.style.js +1 -1
  325. package/lib/components/flat-table/flat-table-row-header/flat-table-row-header.style.js +1 -1
  326. package/lib/components/flat-table/flat-table.style.js +1 -1
  327. package/lib/components/flat-table/sort/sort.style.js +1 -1
  328. package/lib/components/form/__internal__/form-summary.style.js +1 -1
  329. package/lib/components/form/form.style.js +1 -1
  330. package/lib/components/form/required-fields-indicator/required-fields-indicator.component.js +1 -1
  331. package/lib/components/global-header/global-header.component.js +1 -1
  332. package/lib/components/grid/grid-container/grid-container.style.js +1 -1
  333. package/lib/components/grid/grid-item/grid-item.style.js +1 -1
  334. package/lib/components/heading/heading.style.js +1 -1
  335. package/lib/components/help/help.style.js +1 -1
  336. package/lib/components/hr/hr.style.js +1 -1
  337. package/lib/components/icon/icon.style.js +1 -1
  338. package/lib/components/icon-button/icon-button.style.js +1 -1
  339. package/lib/components/image/image.style.js +1 -1
  340. package/lib/components/inline-inputs/inline-inputs.style.js +1 -1
  341. package/lib/components/link/link.component.d.ts +0 -2
  342. package/lib/components/link/link.component.js +1 -1
  343. package/lib/components/link/link.style.d.ts +0 -1
  344. package/lib/components/link/link.style.js +1 -1
  345. package/lib/components/link-preview/__internal__/placeholder.component.js +1 -1
  346. package/lib/components/link-preview/link-preview.style.js +1 -1
  347. package/lib/components/loader/__next__/internal/star.style.js +1 -1
  348. package/lib/components/loader/__next__/loader.style.js +1 -1
  349. package/lib/components/loader/loader-square.style.js +1 -1
  350. package/lib/components/loader/loader.style.js +1 -1
  351. package/lib/components/loader-bar/loader-bar.style.js +1 -1
  352. package/lib/components/loader-spinner/loader-spinner.style.js +1 -1
  353. package/lib/components/loader-star/internal/star.style.js +1 -1
  354. package/lib/components/loader-star/loader-star.style.js +1 -1
  355. package/lib/components/menu/__internal__/menu-item-variant.context.d.ts +6 -0
  356. package/lib/components/menu/__internal__/menu-item-variant.context.js +1 -0
  357. package/lib/components/menu/__internal__/strict-menu.context.d.ts +2 -2
  358. package/lib/components/menu/__internal__/strict-menu.context.js +1 -1
  359. package/lib/components/menu/__internal__/submenu/submenu.component.d.ts +3 -11
  360. package/lib/components/menu/__internal__/submenu/submenu.component.js +1 -1
  361. package/lib/components/menu/__internal__/submenu/submenu.context.d.ts +1 -1
  362. package/lib/components/menu/__internal__/submenu/submenu.style.d.ts +15 -18
  363. package/lib/components/menu/__internal__/submenu/submenu.style.js +1 -1
  364. package/lib/components/menu/index.d.ts +1 -1
  365. package/lib/components/menu/menu-divider/menu-divider.component.js +1 -1
  366. package/lib/components/menu/menu-divider/menu-divider.style.d.ts +6 -4
  367. package/lib/components/menu/menu-divider/menu-divider.style.js +1 -1
  368. package/lib/components/menu/menu-full-screen/menu-full-screen.component.js +1 -1
  369. package/lib/components/menu/menu-full-screen/menu-full-screen.style.d.ts +14 -14
  370. package/lib/components/menu/menu-full-screen/menu-full-screen.style.js +1 -1
  371. package/lib/components/menu/menu-item/menu-item.component.d.ts +10 -10
  372. package/lib/components/menu/menu-item/menu-item.component.js +1 -1
  373. package/lib/components/menu/menu-item/menu-item.style.d.ts +30 -21
  374. package/lib/components/menu/menu-item/menu-item.style.js +1 -1
  375. package/lib/components/menu/menu-segment-title/menu-segment-title.component.d.ts +4 -3
  376. package/lib/components/menu/menu-segment-title/menu-segment-title.component.js +1 -1
  377. package/lib/components/menu/menu-segment-title/menu-segment-title.style.d.ts +6 -8
  378. package/lib/components/menu/menu-segment-title/menu-segment-title.style.js +1 -1
  379. package/lib/components/menu/menu.component.d.ts +16 -2
  380. package/lib/components/menu/menu.component.js +1 -1
  381. package/lib/components/menu/menu.config.d.ts +10 -50
  382. package/lib/components/menu/menu.config.js +1 -1
  383. package/lib/components/menu/menu.style.d.ts +4 -13
  384. package/lib/components/menu/menu.style.js +1 -1
  385. package/lib/components/menu/scrollable-block/scrollable-block.component.d.ts +1 -1
  386. package/lib/components/menu/scrollable-block/scrollable-block.component.js +1 -1
  387. package/lib/components/menu/scrollable-block/scrollable-block.style.d.ts +5 -7
  388. package/lib/components/menu/scrollable-block/scrollable-block.style.js +1 -1
  389. package/lib/components/message/message.style.js +1 -1
  390. package/lib/components/multi-action-button/multi-action-button.style.js +1 -1
  391. package/lib/components/navigation-bar/navigation-bar.style.js +1 -1
  392. package/lib/components/note/note.style.js +1 -1
  393. package/lib/components/numeral-date/numeral-date.style.js +1 -1
  394. package/lib/components/option-tile/option-tile.style.js +1 -1
  395. package/lib/components/pager/__internal__/pagination-navigation.style.js +1 -1
  396. package/lib/components/pager/pager.style.js +1 -1
  397. package/lib/components/pages/page/page.style.js +1 -1
  398. package/lib/components/pages/pages.style.js +1 -1
  399. package/lib/components/password/password.style.js +1 -1
  400. package/lib/components/pill/pill.style.js +1 -1
  401. package/lib/components/pod/pod.style.js +1 -1
  402. package/lib/components/popover-container/popover-container.component.js +1 -1
  403. package/lib/components/popover-container/popover-container.style.js +1 -1
  404. package/lib/components/portal/portal.js +1 -1
  405. package/lib/components/portal/portal.style.js +1 -1
  406. package/lib/components/portrait/portrait.style.js +1 -1
  407. package/lib/components/preview/preview.style.js +1 -1
  408. package/lib/components/profile/profile.style.js +1 -1
  409. package/lib/components/progress-tracker/progress-tracker.style.js +1 -1
  410. package/lib/components/radio-button/radio-button-group/radio-button-group.style.js +1 -1
  411. package/lib/components/radio-button/radio-button.style.js +1 -1
  412. package/lib/components/search/__internal__/results-announcement.component.js +1 -1
  413. package/lib/components/search/search.component.d.ts +1 -0
  414. package/lib/components/search/search.component.js +1 -1
  415. package/lib/components/select/__internal__/list-action-button/list-action-button.style.js +1 -1
  416. package/lib/components/select/__internal__/select-list/select-list.style.js +1 -1
  417. package/lib/components/select/__internal__/select-textbox/select-textbox.style.js +1 -1
  418. package/lib/components/select/__internal__/utils/matching-text.style.js +1 -1
  419. package/lib/components/select/multi-select/multi-select.style.js +1 -1
  420. package/lib/components/select/option/option.style.js +1 -1
  421. package/lib/components/select/option-group-header/option-group-header.style.js +1 -1
  422. package/lib/components/select/option-row/option-row.style.js +1 -1
  423. package/lib/components/select/select.style.js +1 -1
  424. package/lib/components/settings-row/settings-row.style.js +1 -1
  425. package/lib/components/sidebar/__internal__/sidebar-content/sidebar-content.style.js +1 -1
  426. package/lib/components/sidebar/__internal__/sidebar-footer/sidebar-footer.style.js +1 -1
  427. package/lib/components/sidebar/__internal__/sidebar-header/sidebar-header.style.js +1 -1
  428. package/lib/components/sidebar/sidebar.style.js +1 -1
  429. package/lib/components/simple-color-picker/simple-color/simple-color.style.js +1 -1
  430. package/lib/components/simple-color-picker/simple-color-picker.style.js +1 -1
  431. package/lib/components/split-button/split-button-toggle.style.js +1 -1
  432. package/lib/components/split-button/split-button.style.js +1 -1
  433. package/lib/components/step-flow/step-flow.style.js +1 -1
  434. package/lib/components/step-sequence/step-sequence-item/step-sequence-item.style.js +1 -1
  435. package/lib/components/step-sequence/step-sequence.style.js +1 -1
  436. package/lib/components/switch/switch.style.js +1 -1
  437. package/lib/components/tabs/__next__/tabs.style.js +1 -1
  438. package/lib/components/text-editor/__internal__/__ui__/CharacterCounter/character-counter.style.js +1 -1
  439. package/lib/components/text-editor/__internal__/__ui__/ContentEditor/content-editor.style.js +1 -1
  440. package/lib/components/text-editor/__internal__/__ui__/Mentions/mentions.style.js +1 -1
  441. package/lib/components/text-editor/__internal__/__ui__/Placeholder/placeholder.style.js +1 -1
  442. package/lib/components/text-editor/__internal__/__ui__/Toolbar/button-group/button-group.style.js +1 -1
  443. package/lib/components/text-editor/__internal__/__ui__/Toolbar/buttons/typography-dropdown/dropdown.style.js +1 -1
  444. package/lib/components/text-editor/__internal__/__ui__/Toolbar/toolbar.style.js +1 -1
  445. package/lib/components/text-editor/text-editor.style.js +1 -1
  446. package/lib/components/textarea/textarea.style.js +1 -1
  447. package/lib/components/textbox/__internal__/__next__/text-input.style.js +1 -1
  448. package/lib/components/tile/tile-footer/tile-footer.style.js +1 -1
  449. package/lib/components/tile/tile.style.js +1 -1
  450. package/lib/components/tile-select/__internal__/accordion/accordion.style.js +1 -1
  451. package/lib/components/tile-select/tile-select.style.js +1 -1
  452. package/lib/components/time/time.style.js +1 -1
  453. package/lib/components/toast/toast.style.js +1 -1
  454. package/lib/components/tokens-wrapper/tokens-wrapper.component.js +1 -1
  455. package/lib/components/tooltip/tooltip-pointer.style.js +1 -1
  456. package/lib/components/tooltip/tooltip.style.js +1 -1
  457. package/lib/components/typography/__internal__/__next__/typography.style.js +1 -1
  458. package/lib/components/typography/typography.style.js +1 -1
  459. package/lib/components/vertical-divider/vertical-divider.style.js +1 -1
  460. package/lib/components/vertical-menu/responsive-vertical-menu/responsive-vertical-menu-divider/responsive-vertical-menu-divider.style.js +1 -1
  461. package/lib/components/vertical-menu/responsive-vertical-menu/responsive-vertical-menu-item/responsive-vertical-menu-item.style.js +1 -1
  462. package/lib/components/vertical-menu/responsive-vertical-menu/responsive-vertical-menu.style.js +1 -1
  463. package/lib/components/vertical-menu/vertical-menu.style.js +1 -1
  464. package/lib/style/design-tokens/carbon-scoped-tokens-provider/carbon-scoped-tokens-provider.component.js +1 -1
  465. package/package.json +1 -1
  466. package/esm/components/menu/menu-segment-title/menu-segment-title.context.d.ts +0 -7
  467. package/esm/components/menu/menu-segment-title/menu-segment-title.context.js +0 -1
  468. package/esm/components/menu/menu.types.d.ts +0 -9
  469. package/esm/components/search/__internal__/legacy/search-button.style.d.ts +0 -5
  470. package/esm/components/search/__internal__/legacy/search-button.style.js +0 -1
  471. package/esm/components/search/__internal__/legacy/search.component.d.ts +0 -71
  472. package/esm/components/search/__internal__/legacy/search.component.js +0 -1
  473. package/esm/components/search/__internal__/legacy/search.style.d.ts +0 -13
  474. package/esm/components/search/__internal__/legacy/search.style.js +0 -1
  475. package/lib/components/menu/menu-segment-title/menu-segment-title.context.d.ts +0 -7
  476. package/lib/components/menu/menu-segment-title/menu-segment-title.context.js +0 -1
  477. package/lib/components/menu/menu.types.d.ts +0 -9
  478. package/lib/components/search/__internal__/legacy/search-button.style.d.ts +0 -5
  479. package/lib/components/search/__internal__/legacy/search-button.style.js +0 -1
  480. package/lib/components/search/__internal__/legacy/search.component.d.ts +0 -71
  481. package/lib/components/search/__internal__/legacy/search.component.js +0 -1
  482. package/lib/components/search/__internal__/legacy/search.style.d.ts +0 -13
  483. package/lib/components/search/__internal__/legacy/search.style.js +0 -1
@@ -6,22 +6,14 @@ export interface SubmenuProps {
6
6
  children: React.ReactNode;
7
7
  /** Custom className */
8
8
  className?: string;
9
- /**
10
- * * <a href="https://brand.sage.com/d/NdbrveWvNheA/foundations#/icons/icons" target="_blank">List of supported icons</a>
11
- *
12
- * Adds an icon to the menu item.
13
- * */
14
- icon?: string;
15
9
  /** Defines which direction the submenu will hang eg. left/right */
16
10
  submenuDirection?: string;
17
11
  /** A title for the menu item that has a submenu. */
18
12
  title?: React.ReactNode;
19
13
  /** onKeyDown handler */
20
14
  onKeyDown?: (event: React.KeyboardEvent<HTMLAnchorElement> | React.KeyboardEvent<HTMLButtonElement>) => void;
21
- /** set the colour variant for a menuType */
15
+ /** Set the variant of the Submenu */
22
16
  variant?: VariantType;
23
- /** Flag to display the dropdown arrow when an item has a submenu */
24
- showDropdownArrow?: boolean;
25
17
  /** When set the submenu opens by click instead of hover */
26
18
  clickToOpen?: boolean;
27
19
  /** The href to use for the menu item. */
@@ -36,12 +28,12 @@ export interface SubmenuProps {
36
28
  onSubmenuClose?: () => void;
37
29
  /** Callback triggered when the top-level menu item is clicked */
38
30
  onClick?: (event: React.MouseEvent<HTMLAnchorElement> | React.MouseEvent<HTMLButtonElement>) => void;
39
- /** Accessible label for when no text children are passed to menu item */
40
- ariaLabel?: string;
41
31
  /** Sets the max-width of the submenu container element */
42
32
  submenuMaxWidth?: string;
43
33
  /** Sets the min-width of the submenu container element */
44
34
  submenuMinWidth?: string;
35
+ /** Is the menu item the currently selected item. */
36
+ selected?: boolean;
45
37
  }
46
38
  declare const Submenu: React.ForwardRefExoticComponent<SubmenuProps & React.RefAttributes<HTMLAnchorElement>>;
47
39
  export default Submenu;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("../../menu-item/menu-item.style.js"),r=require("./submenu.style.js"),u=require("../../../../__internal__/utils/helpers/events/events.js"),a=require("../strict-menu.context.js"),l=require("../keyboard-navigation/index.js"),o=require("./submenu.context.js"),i=require("../../../../__internal__/utils/helpers/guid/index.js"),s=require("../locators.js"),c=require("../../../../hooks/__internal__/useStableCallback/useStableCallback.js"),d=require("../../../navigation-bar/__internal__/fixed-navigation-bar.context.js"),m=require("../../../../__internal__/focus-trap/focus-trap-utils.js");function f(e){return e&&e.__esModule?e:{default:e}}function p(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function b(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){p(e,t,n[t])}))}return e}function y(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 S=f(t).default.forwardRef(((f,p)=>{var{children:S,className:v,title:h,icon:O,submenuDirection:g="right",onKeyDown:j,variant:w="default",showDropdownArrow:x=!0,clickToOpen:_,href:C,maxWidth:E,asPassiveItem:A,onSubmenuOpen:D,onSubmenuClose:L,onClick:k,submenuMaxWidth:P,submenuMinWidth:q}=f,T=function(e,t){if(null==e)return{};var n,r,u=function(e,t){if(null==e)return{};var n,r,u={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(u[n]=e[n]);return u}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(u[n]=e[n])}return u}(f,["children","className","title","icon","submenuDirection","onKeyDown","variant","showDropdownArrow","clickToOpen","href","maxWidth","asPassiveItem","onSubmenuOpen","onSubmenuClose","onClick","submenuMaxWidth","submenuMinWidth"]);const[K,I]=t.useState(null),R=t.useRef(i.default()),{inFullscreenView:M,openSubmenuId:F,setOpenSubmenuId:W,menuType:B}=a.useStrictMenuContext(),[N,H]=t.useState(!1),[V,$]=t.useState(null),[U,X]=t.useState([]),[z,G]=t.useState(""),[J,Q]=t.useState(!1),[Y,Z]=t.useState(!1),ee=U.length,{submenuMaxHeight:te}=t.useContext(d.default),ne=c.default(D),re=t.useMemo((()=>{const e=null==K?void 0:K.querySelectorAll(s.BLOCK_INDEX_SELECTOR);if(e&&N&&ee){const t=Array.from(e),n=null==K?void 0:K.querySelector(`[data-component='${s.SCROLLABLE_BLOCK}']`),r=n?t.indexOf(n):-1;return(null==n?void 0:n.querySelector(`[data-component='${s.SCROLLABLE_BLOCK_PARENT}']`))?r+1:r}return-1}),[N,ee,K]),ue=t.useRef(null),ae=t.useCallback((()=>{ue.current=setTimeout((()=>{G("")}),1500)}),[]),le=t.useCallback((()=>{ue.current&&clearTimeout(ue.current),ae()}),[ae]);t.useEffect((()=>()=>{ue.current&&clearTimeout(ue.current)}),[]);const oe=t.useCallback((()=>{H(!0),W(R.current)}),[W]),ie=t.useRef();t.useEffect((()=>{N&&K&&(()=>{var e;if(!K)return;const t=Array.from(K.querySelectorAll("[data-component='menu-item']")||[]),n=t.length>0?t[t.length-1]:null;ie.current=null!=n?n:void 0,K.querySelectorAll("[data-last-visible-menu-item]").forEach((e=>e.removeAttribute("data-last-visible-menu-item"))),n&&n.setAttribute("data-last-visible-menu-item","true");const r=Array.from(K.querySelectorAll("ul:not([data-component='submenu'])")||[]);if(0===r.length)return Q(!1),void Z(!1);const u=r[r.length-1],a=(null==u||null===(e=u.parentElement)||void 0===e?void 0:e.dataset.component)===s.SCROLLABLE_BLOCK,l=Array.from(u.querySelectorAll("[data-component='menu-item']")||[]),o=l.length>0?l[l.length-1]:null;let i=!1;o&&u&&(i=o.getBoundingClientRect().bottom<u.getBoundingClientRect().bottom);const c=!!o&&!!n&&o===n;Q(c),Z(c&&!a||c&&a&&!i)})()}),[N,K,ee]),t.useEffect((()=>{N&&ne&&ne()}),[N,ne]);const se=t.useCallback((()=>{H(!1),$(null),L&&L(),G("")}),[L]);t.useEffect((()=>{F&&F!==R.current&&se()}),[F,se]);const ce=t.useCallback((e=>U.findIndex((t=>t===e))),[U]),de=t.useCallback((e=>{const t=u.default.isEnterKey(e)||u.default.isSpaceKey(e);if(!t&&!u.default.isDownKey(e)||N||(e.preventDefault(),oe()),N){const n=ce(V);let r=n;if(V||((t&&!C||u.default.isSpaceKey(e)&&C)&&(e.preventDefault(),se()),u.default.isShiftKey(e)&&u.default.isTabKey(e)&&se()),u.default.isDownKey(e)&&(e.preventDefault(),r<ee-1&&(r+=1)),u.default.isUpKey(e)&&(e.preventDefault(),Q(!1),r>0&&(r-=1)),u.default.isEscKey(e))return null==j||j(e),void se();u.default.isHomeKey(e)&&(e.preventDefault(),e.stopPropagation(),r=0),u.default.isEndKey(e)&&(e.preventDefault(),e.stopPropagation(),r=ee-1),1===e.key.length?(e.stopPropagation(),ue.current?le():ae(),G(`${z}${e.key.toLowerCase()}`)):G(""),u.default.composedPath(e.nativeEvent).find((e=>e instanceof HTMLElement&&("input"===e.getAttribute("data-element")||"input-icon-toggle"===e.getAttribute("data-element"))))||u.default.isEnterKey(e)&&setTimeout((()=>se()),0),r!==n&&$(U[r])}}),[U,N,C,ee,V,ce,oe,se,j,z,le,ae]);return t.useEffect((()=>{if(K&&S){const e=null==K?void 0:K.querySelectorAll(s.ALL_CHILDREN_SELECTOR);e&&X(Array.from(e).filter((e=>e.querySelector(m.defaultFocusableSelectors))).map((e=>e.getAttribute("id"))))}}),[S,N,K]),t.useEffect((()=>{const e=null==K?void 0:K.querySelectorAll(s.ALL_CHILDREN_SELECTOR);if(e&&""!==z){const t=Array.from(e),n=l.characterNavigation(z,t);n&&$(n.id)}}),[K,z,U]),M?e.jsxs(r.StyledSubmenuWrapper,{"data-component":"submenu-wrapper",inFullscreenView:M,asPassiveItem:A,menuType:B,children:[e.jsx(n.default,y(b({},T),{onClick:A?void 0:k,className:v,menuType:B,ref:p,href:C,menuItemVariant:w,inFullscreenView:M,asDiv:A,children:h})),e.jsx(r.StyledSubmenu,{"data-component":"submenu",variant:w,menuType:B,inFullscreenView:M,ref:I,applyFocusRadiusStyling:!1,applyFocusRadiusStylingToLastItem:Y,children:e.jsx(o.default.Provider,{value:{handleKeyDown:de,blockIndex:re,updateFocusId:$},children:S})})]}):e.jsxs(r.StyledSubmenuWrapper,{"data-component":"submenu-wrapper","data-role":"submenu-wrapper",onMouseOver:_?void 0:()=>oe(),onMouseLeave:()=>se(),isSubmenuOpen:N,ref:I,children:[e.jsx(n.default,y(b({},T),{className:v,menuType:B,ref:p,icon:O,tabIndex:-1,menuItemVariant:w,isOpen:N,hasSubmenu:!0,showDropdownArrow:x,onKeyDown:de,onClick:e=>{oe(),k&&k(e)},clickToOpen:_,href:C,maxWidth:E,"aria-expanded":N,"data-role":"submenu-parent-item",children:h})),N&&e.jsx(r.StyledSubmenu,{"data-component":"submenu",submenuDirection:g,variant:w,menuType:B,role:0===re?"presentation":"list",maxHeight:te,applyFocusRadiusStyling:J,applyFocusRadiusStylingToLastItem:Y,submenuMaxWidth:P,submenuMinWidth:q,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||se()},children:e.jsx(o.default.Provider,{value:{submenuFocusId:V,handleKeyDown:de,blockIndex:re,updateFocusId:$,submenuHasMaxWidth:!!P,closeSubmenu:se},children:S})})]})}));S.displayName="submenu",exports.default=S;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("../../menu-item/menu-item.style.js"),r=require("./submenu.style.js"),u=require("../../../../__internal__/utils/helpers/events/events.js"),a=require("../strict-menu.context.js"),l=require("../keyboard-navigation/index.js"),i=require("./submenu.context.js"),s=require("../../../../__internal__/utils/helpers/guid/index.js"),o=require("../locators.js"),c=require("../../../../hooks/__internal__/useStableCallback/useStableCallback.js"),d=require("../../../navigation-bar/__internal__/fixed-navigation-bar.context.js"),m=require("../../../../__internal__/focus-trap/focus-trap-utils.js");function f(e){return e&&e.__esModule?e:{default:e}}function b(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){b(e,t,n[t])}))}return e}function y(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 S=f(t).default.forwardRef(((f,b)=>{var{children:S,className:h,title:O,submenuDirection:v="right",onKeyDown:j,variant:g="default",clickToOpen:x,href:_,maxWidth:w,asPassiveItem:E,onSubmenuOpen:C,onSubmenuClose:D,onClick:$,submenuMaxWidth:k,submenuMinWidth:P,selected:L}=f,q=function(e,t){if(null==e)return{};var n,r,u=function(e,t){if(null==e)return{};var n,r,u={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(u[n]=e[n]);return u}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(u[n]=e[n])}return u}(f,["children","className","title","submenuDirection","onKeyDown","variant","clickToOpen","href","maxWidth","asPassiveItem","onSubmenuOpen","onSubmenuClose","onClick","submenuMaxWidth","submenuMinWidth","selected"]);const[K,I]=t.useState(null),A=t.useRef(s.default()),{inFullscreenView:M,openSubmenuId:T,setOpenSubmenuId:W,menuVariant:R}=a.useStrictMenuContext(),[V,N]=t.useState(!1),[F,B]=t.useState(null),[H,U]=t.useState([]),[X,z]=t.useState(""),G=H.length,{submenuMaxHeight:J}=t.useContext(d.default),Q=c.default(C),Y=t.useMemo((()=>{const e=null==K?void 0:K.querySelectorAll(o.BLOCK_INDEX_SELECTOR);if(e&&V&&G){const t=Array.from(e),n=null==K?void 0:K.querySelector(`[data-component='${o.SCROLLABLE_BLOCK}']`),r=n?t.indexOf(n):-1;return(null==n?void 0:n.querySelector(`[data-component='${o.SCROLLABLE_BLOCK_PARENT}']`))?r+1:r}return-1}),[V,G,K]),Z=t.useRef(null),ee=t.useCallback((()=>{Z.current=setTimeout((()=>{z("")}),1500)}),[]),te=t.useCallback((()=>{Z.current&&clearTimeout(Z.current),ee()}),[ee]);t.useEffect((()=>()=>{Z.current&&clearTimeout(Z.current)}),[]);const ne=t.useCallback((()=>{N(!0),W(A.current)}),[W]);t.useEffect((()=>{V&&Q&&Q()}),[V,Q]);const re=t.useCallback((()=>{N(!1),B(null),D&&D(),z("")}),[D]);t.useEffect((()=>{T&&T!==A.current&&re()}),[T,re]);const ue=t.useCallback((e=>H.findIndex((t=>t===e))),[H]),ae=t.useCallback((e=>{const t=u.default.isEnterKey(e)||u.default.isSpaceKey(e);if(!t&&!u.default.isDownKey(e)||V||(e.preventDefault(),ne()),V){const n=ue(F);let r=n;if(F||((t&&!_||u.default.isSpaceKey(e)&&_)&&(e.preventDefault(),re()),u.default.isShiftKey(e)&&u.default.isTabKey(e)&&re()),u.default.isDownKey(e)&&(e.preventDefault(),r<G-1&&(r+=1)),u.default.isUpKey(e)&&(e.preventDefault(),r>0&&(r-=1)),u.default.isEscKey(e))return null==j||j(e),void re();u.default.isHomeKey(e)&&(e.preventDefault(),e.stopPropagation(),r=0),u.default.isEndKey(e)&&(e.preventDefault(),e.stopPropagation(),r=G-1);const a=u.default.composedPath(e.nativeEvent).find((e=>e instanceof HTMLElement&&("input"===e.getAttribute("data-element")||"input-icon-toggle"===e.getAttribute("data-element"))));1!==e.key.length||a?z(""):(e.stopPropagation(),Z.current?te():ee(),z(`${X}${e.key.toLowerCase()}`)),a||u.default.isEnterKey(e)&&setTimeout((()=>re()),0),r!==n&&B(H[r])}}),[H,V,_,G,F,ue,ne,re,j,X,te,ee]);return t.useEffect((()=>{if(K&&S){const e=null==K?void 0:K.querySelectorAll(o.ALL_CHILDREN_SELECTOR);e&&U(Array.from(e).filter((e=>e.querySelector(m.defaultFocusableSelectors))).map((e=>e.getAttribute("id"))))}}),[S,V,K]),t.useEffect((()=>{const e=null==K?void 0:K.querySelectorAll(o.ALL_CHILDREN_SELECTOR);if(e&&""!==X){const t=Array.from(e),n=l.characterNavigation(X,t);n&&B(n.id)}}),[K,X,H]),t.useLayoutEffect((()=>{const e=null==K?void 0:K.querySelectorAll('[data-element="menu-item-wrapper"]');null==e||e.forEach(((t,n)=>{n===e.length-1?t.setAttribute("data-last-menu-item","true"):t.removeAttribute("data-last-menu-item")}))}),[K,V,G]),M?e.jsxs(r.StyledSubmenuWrapper,{"data-component":"submenu-wrapper",$inFullscreenView:M,children:[e.jsx(n.StyledMenuItemWrapper,y(p({},q),{as:$&&!_?"button":"a",onClick:E?void 0:$,className:h,$menuVariant:R,ref:b,href:_,$menuItemVariant:g,$inFullscreenView:M,$asDiv:E,$hasSubmenu:!0,$selected:L,children:O})),e.jsx(r.StyledSubmenu,{"data-component":"submenu",$menuVariant:R,$inFullscreenView:M,ref:I,children:e.jsx(i.default.Provider,{value:{handleKeyDown:ae,blockIndex:Y,updateFocusId:B},children:S})})]}):e.jsxs(r.StyledSubmenuWrapper,{"data-component":"submenu-wrapper","data-role":"submenu-wrapper",onMouseOver:x?void 0:()=>ne(),onMouseLeave:()=>re(),ref:I,children:[e.jsx(n.StyledMenuItemWrapper,y(p({},q),{as:_?"a":"button",className:h,$menuVariant:R,ref:b,$menuItemVariant:g,$isOpen:V,$hasSubmenu:!0,onKeyDown:ae,onClick:e=>{ne(),$&&$(e)},href:_,$maxWidth:w,$selected:L,"aria-expanded":V,"data-element":"submenu-parent-item","data-role":"submenu-parent-item",children:O})),V&&e.jsx(r.StyledSubmenu,{"data-component":"submenu","data-role":"submenu",$submenuDirection:v,$menuVariant:R,role:0===Y?"presentation":"list",$maxHeight:J,$submenuMaxWidth:k,$submenuMinWidth:P,onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||re()},children:e.jsx(i.default.Provider,{value:{submenuFocusId:F,handleKeyDown:ae,blockIndex:Y,updateFocusId:B,submenuMaxWidth:k,closeSubmenu:re},children:S})})]})}));S.displayName="submenu",exports.default=S;
@@ -4,7 +4,7 @@ export interface SubmenuContextProps {
4
4
  updateFocusId?: (id: string) => void;
5
5
  handleKeyDown?: (event: React.KeyboardEvent<HTMLAnchorElement> | React.KeyboardEvent<HTMLButtonElement>) => void;
6
6
  blockIndex?: number;
7
- submenuHasMaxWidth?: boolean;
7
+ submenuMaxWidth?: string;
8
8
  closeSubmenu?: () => void;
9
9
  }
10
10
  declare const SubmenuContext: React.Context<SubmenuContextProps>;
@@ -1,21 +1,18 @@
1
- import { SubmenuProps } from "./submenu.component";
2
- import type { MenuType } from "../../menu.types";
3
- interface SharedStyleProps {
4
- inFullscreenView?: boolean;
5
- menuType?: MenuType;
1
+ interface StyledSubmenuWrapperProps {
2
+ $inFullscreenView?: boolean;
6
3
  }
7
- interface StyledSubmenuWrapperProps extends SharedStyleProps {
8
- isSubmenuOpen?: boolean;
9
- asPassiveItem?: boolean;
10
- }
11
- interface StyledSubmenuProps extends SharedStyleProps, Pick<SubmenuProps, "variant" | "submenuMaxWidth" | "submenuMinWidth"> {
12
- submenuDirection?: string;
13
- maxHeight?: string;
14
- applyFocusRadiusStyling: boolean;
15
- applyFocusRadiusStylingToLastItem: boolean;
16
- }
17
- declare const StyledSubmenuWrapper: import("styled-components").StyledComponent<"div", any, {
4
+ export declare const StyledSubmenuWrapper: import("styled-components").StyledComponent<"div", any, {
18
5
  theme: object;
19
6
  } & StyledSubmenuWrapperProps, "theme">;
20
- declare const StyledSubmenu: import("styled-components").StyledComponent<"ul", any, StyledSubmenuProps, never>;
21
- export { StyledSubmenu, StyledSubmenuWrapper };
7
+ interface StyledSubmenuProps {
8
+ $submenuDirection?: string;
9
+ $maxHeight?: string;
10
+ $inFullscreenView?: boolean;
11
+ $menuVariant: "white" | "black";
12
+ $submenuMaxWidth?: string;
13
+ $submenuMinWidth?: string;
14
+ }
15
+ export declare const StyledSubmenu: import("styled-components").StyledComponent<"ul", any, {
16
+ theme: object;
17
+ } & StyledSubmenuProps, "theme">;
18
+ export {};
@@ -1 +1 @@
1
- "use strict";var e=require("styled-components"),t=require("../../scrollable-block/scrollable-block.style.js"),r=require("../../../../style/themes/apply-base-theme.js"),i=require("../../../link/link.style.js"),a=require("../../menu.style.js"),o=require("../../menu-item/menu-item.style.js"),d=require("../../../icon/icon.style.js"),s=require("../../menu.config.js"),u=require("../../menu-segment-title/menu-segment-title.style.js");function n(e){return e&&e.__esModule?e:{default:e}}var l=n(e);const b=l.default.div.attrs(r.default).withConfig({displayName:"submenu.style__StyledSubmenuWrapper",componentId:"carbon_v162_9_1__sc-5ce62130-0"})(["position:relative;width:fit-content;max-width:inherit;height:inherit;"," ",""],(({isSubmenuOpen:t,theme:r})=>t&&e.css(["z-index:",";"],r.zIndex.popover)),(({inFullscreenView:t,menuType:r,asPassiveItem:i})=>e.css([""," ",""],t&&e.css(["width:100%;",""],i&&r&&e.css(["","{outline:none;color:",";}"],o.default,s.default[r].title)),!t&&e.css(["display:flex;"])))),m=l.default.ul.withConfig({displayName:"submenu.style__StyledSubmenu",componentId:"carbon_v162_9_1__sc-5ce62130-1"})(["",""],(({menuType:r,submenuDirection:n,variant:l,inFullscreenView:b,maxHeight:m,applyFocusRadiusStyling:c,applyFocusRadiusStylingToLastItem:h,submenuMaxWidth:p,submenuMinWidth:g})=>e.css([""," "," "," display:block;list-style:none;margin:0;padding:0;",":after,",":hover:after{display:none;}","{display:flex;align-items:center;white-space:nowrap;"," "," "," a{text-decoration:none;}> ",'{width:16px;height:16px;margin-right:5px;}}[data-component="icon"]{line-height:20px;&:before{line-height:unset;}span{vertical-align:middle;svg{height:16px;width:16px;}}}&:before{background-color:transparent;border-radius:0 0 4px 4px;content:"";height:5px;position:absolute;top:-5px;width:100%;}',""],!b&&r&&e.css(["box-shadow:var(--boxShadow100);position:absolute;top:100%;background-color:",";min-width:",";"," a,button,"," a,"," button{width:100%;}"],"default"===l?s.default[r].submenuItemBackground:s.default[r].background,null!=g?g:"100%",p&&e.css(["width:max-content;max-width:",";li{max-width:",";}&&&{a,button,"," a,"," button{white-space:normal;height:auto;}}"],p,p,i.StyledLink,i.StyledLink),i.StyledLink,i.StyledLink),b&&e.css(["min-width:100%;","{width:100%;}"],a.StyledMenuItem),!b&&e.css(["border-bottom-right-radius:var(--borderRadius100);border-bottom-left-radius:var(--borderRadius100);overflow-y:auto;"," & "," > ",":last-of-type:not([data-last-visible-menu-item='true']){a,button,> span,> div{border-bottom-right-radius:var(--borderRadius000);border-bottom-left-radius:var(--borderRadius000);:focus{border-bottom-right-radius:var(--borderRadius000);border-bottom-left-radius:var(--borderRadius000);}}}[data-last-visible-menu-item=\"true\"]{a,button,> span,> div{border-bottom-left-radius:var(--borderRadius100);border-bottom-right-radius:var(--borderRadius100);:focus{border-bottom-right-radius:var(--borderRadius100);border-bottom-left-radius:var(--borderRadius100);}}}&&&& ",'{[data-element="scrollable-block-list"]{border-bottom-right-radius:var(--borderRadius000);border-bottom-left-radius:',";",":last-child ",",",":last-child a,",":last-child button{border-bottom-right-radius:var(--borderRadius000);border-bottom-left-radius:",";}}}"],m&&`max-height: ${m};`,u.StyledSegmentChildren,a.StyledMenuItem,t.default,c?"var(--borderRadius100)":"var(--borderRadius000)",a.StyledMenuItem,i.StyledLink,a.StyledMenuItem,a.StyledMenuItem,h?"var(--borderRadius100)":"var(--borderRadius000)"),o.default,o.default,o.default,b&&e.css(["white-space:normal;height:auto;"]),p&&e.css(["height:auto;min-height:40px;"]),!b&&r&&e.css(["background-color:",";> a:focus,> button:focus{background-color:",";}> a,> button{padding:11px 16px 12px;}"],s.default[r].submenuItemBackground,s.default[r].submenuItemBackground),d.default,"left"===n&&e.css(["right:0;"]))));exports.StyledSubmenu=m,exports.StyledSubmenuWrapper=b;
1
+ "use strict";var e=require("styled-components"),t=require("../../../../style/themes/apply-base-theme.js"),i=require("../../menu.config.js");function r(e){return e&&e.__esModule?e:{default:e}}var a=r(e);const s=a.default.div.attrs(t.default).withConfig({displayName:"submenu.style__StyledSubmenuWrapper",componentId:"carbon_v162_10_0__sc-92487cd8-0"})(["position:relative;width:fit-content;max-width:inherit;height:inherit;",""],(({$inFullscreenView:t})=>e.css([""," ",""],t&&e.css(["width:100%;"]),!t&&e.css(["display:flex;"])))),n=a.default.ul.attrs(t.default).withConfig({displayName:"submenu.style__StyledSubmenu",componentId:"carbon_v162_10_0__sc-92487cd8-1"})(["",""],(({$menuVariant:t,$submenuDirection:r,$inFullscreenView:a,$maxHeight:s,$submenuMaxWidth:n,$submenuMinWidth:o,theme:d})=>e.css(["display:block;list-style:none;margin:0;padding:0;background-color:",";"," ",""],i.default[t].submenuItemBackground,!a&&e.css(["position:absolute;top:100%;z-index:",";box-shadow:var(--global-depth-lvl1);width:max-content;min-width:100%;box-sizing:border-box;border-radius:var(--global-radius-none) var(--global-radius-none) var(--global-radius-container-m) var(--global-radius-container-m);overflow-y:auto;"," "," "," "," "," [data-last-menu-item='true']{border-bottom-left-radius:var(--global-radius-container-m);border-bottom-right-radius:var(--global-radius-container-m);}"],d.zIndex.popover,"white"===t&&e.css(["margin-top:-1px;border:var(--global-borderwidth-xs) solid var(--nav-tertiary-border-default);"]),n&&e.css(["max-width:",";"],n),o&&e.css(["min-width:",";"],o),"left"===r&&e.css(["right:0;"]),s&&`max-height: ${s};`),a&&e.css(["min-width:100%;"]))));exports.StyledSubmenu=n,exports.StyledSubmenuWrapper=s;
@@ -1,5 +1,5 @@
1
1
  export { default as Menu } from "./menu.component";
2
- export type { MenuProps } from "./menu.types";
2
+ export type { MenuProps } from "./menu.component";
3
3
  export { default as MenuItem } from "./menu-item";
4
4
  export type { MenuWithIcon, MenuWithChildren, MenuItemHandle, } from "./menu-item";
5
5
  export { default as MenuDivider } from "./menu-divider";
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("./menu-divider.style.js"),n=require("../__internal__/strict-menu.context.js"),u=require("../menu.style.js"),i=require("../../../__internal__/utils/helpers/tags/tags.js");function o(e){return e&&e.__esModule?e:{default:e}}function c(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function l(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),n.forEach((function(r){c(e,r,t[r])}))}return e}const s=o(r).default.forwardRef(((r,o)=>{var{size:c="default"}=r,s=function(e,r){if(null==e)return{};var t,n,u=function(e,r){if(null==e)return{};var t,n,u={},i=Object.keys(e);for(n=0;n<i.length;n++)t=i[n],r.indexOf(t)>=0||(u[t]=e[t]);return u}(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)t=i[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(u[t]=e[t])}return u}(r,["size"]);const{menuType:a}=n.useStrictMenuContext();return e.jsx(u.StyledMenuItem,{inSubmenu:!0,"aria-hidden":"true","data-role":"divider-container",children:e.jsx(t.default,(f=l({size:c},i.default("menu-divider",s)),p={menuType:a,ref:o},p=null!=p?p:{},Object.getOwnPropertyDescriptors?Object.defineProperties(f,Object.getOwnPropertyDescriptors(p)):function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r}(Object(p)).forEach((function(e){Object.defineProperty(f,e,Object.getOwnPropertyDescriptor(p,e))})),f))});var f,p}));s.displayName="MenuDivider",exports.default=s;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("./menu-divider.style.js"),n=require("../__internal__/strict-menu.context.js"),i=require("../menu-item/menu-item.style.js"),u=require("../../../__internal__/utils/helpers/tags/tags.js");function o(e){return e&&e.__esModule?e:{default:e}}function c(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function l(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),n.forEach((function(r){c(e,r,t[r])}))}return e}const s=o(r).default.forwardRef(((r,o)=>{var{size:c="default"}=r,s=function(e,r){if(null==e)return{};var t,n,i=function(e,r){if(null==e)return{};var t,n,i={},u=Object.keys(e);for(n=0;n<u.length;n++)t=u[n],r.indexOf(t)>=0||(i[t]=e[t]);return i}(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)&&(i[t]=e[t])}return i}(r,["size"]);const{menuVariant:a,inFullscreenView:f}=n.useStrictMenuContext();return e.jsx(i.StyledMenuItem,{$inSubmenu:!0,$removeHeight:!0,"aria-hidden":"true","data-role":"divider-container",children:e.jsx(t.default,(b=l({$size:c},u.default("menu-divider",s)),O={$menuVariant:a,$inFullscreenView:f,ref:o},O=null!=O?O:{},Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(O)):function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r}(Object(O)).forEach((function(e){Object.defineProperty(b,e,Object.getOwnPropertyDescriptor(O,e))})),b))});var b,O}));s.displayName="MenuDivider",exports.default=s;
@@ -1,6 +1,8 @@
1
1
  import { MenuDividerProps } from "./menu-divider.component";
2
- import type { MenuType } from "../menu.types";
3
- declare const StyledDivider: import("styled-components").StyledComponent<"div", any, MenuDividerProps & {
4
- menuType: MenuType;
5
- }, never>;
2
+ interface StyledDividerProps {
3
+ $menuVariant: "white" | "black";
4
+ $size: MenuDividerProps["size"];
5
+ $inFullscreenView?: boolean;
6
+ }
7
+ declare const StyledDivider: import("styled-components").StyledComponent<"div", any, StyledDividerProps, never>;
6
8
  export default StyledDivider;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),r=require("../menu.config.js");function t(e){return e&&e.__esModule?e:{default:e}}const d=t(e).default.div.withConfig({displayName:"menu-divider.style__StyledDivider",componentId:"carbon_v162_9_1__sc-ce8f3542-0"})(["cursor:default;",""],(({menuType:t,size:d})=>e.css(["margin:0px ",";height:",";background-color:",";"],"large"===d?"":"16px","large"===d?"4px":"1px",r.default[t].divider)));exports.default=d;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),a=require("../menu.config.js");function r(e){return e&&e.__esModule?e:{default:e}}const l=r(e).default.div.withConfig({displayName:"menu-divider.style__StyledDivider",componentId:"carbon_v162_10_0__sc-b48c8639-0"})(["",""],(({$menuVariant:r,$size:l,$inFullscreenView:o})=>e.css(["background-color:",";margin:var(--global-space-none) var(--global-space-comp-l);height:1px;"," ",""],a.default[r].divider,o&&e.css(["margin:var(--global-space-comp-s) var(--global-space-comp-l);"]),"large"===l&&e.css(["margin:var(--global-space-none);height:4px;"]))));exports.default=l;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),n=require("react-transition-group"),t=require("./menu-full-screen.style.js"),l=require("../menu.style.js"),o=require("../__internal__/strict-menu.context.js"),i=require("../../../__internal__/utils/helpers/events/events.js"),a=require("../../box/box.component.js"),u=require("../../icon-button/icon-button.component.js"),s=require("../../icon/icon.component.js");require("../../icon/icon.style.js");var c=require("../../portal/portal.js"),d=require("../../../__internal__/focus-trap/focus-trap.component.js"),p=require("../menu-divider/menu-divider.component.js"),m=require("../../../__internal__/dom/globals.js"),f=require("../../../hooks/__internal__/useLocale/useLocale.js"),j=require("../../../hooks/__internal__/useModalAria/useModalAria.js"),_=require("../../../hooks/__internal__/useModalManager/useModalManager.js");function x(e){return e&&e.__esModule?e:{default:e}}var b=x(r);function y(e,r,n){return r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}function h(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{},t=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable})))),t.forEach((function(r){y(e,r,n[r])}))}return e}const v=({"aria-label":c="Fullscreen menu","data-element":x,"data-role":y,children:h,isOpen:v=!1,onClose:M,startPosition:q="left",topModalOverride:g})=>{var O;const S=r.useRef(null),P=r.useRef(null),w=r.useRef(null),k=j.default(P),{menuType:C}=o.useStrictMenuContext(),F=["dark","black"].includes(C),T=f.default(),R=b.default.Children.toArray(h),A=b.default.Children.toArray(R.map(((r,n)=>n<R.length-1?e.jsxs(e.Fragment,{children:[r,e.jsx(p.default,{"data-role":"divider"})]}):r))),E=r.useCallback((e=>{M&&i.default.isEscKey(e)&&(e.stopImmediatePropagation(),M(e))}),[M]);return _.default({open:v,closeModal:E,modalRef:S,topModalOverride:g,focusCallToActionElement:null===(O=m.getDocument())||void 0===O?void 0:O.activeElement}),e.jsx(n.CSSTransition,{nodeRef:S,in:v,timeout:200,unmountOnExit:!0,children:e.jsx(t.StyledMenuFullscreen,{ref:S,startPosition:q,transitionDuration:200,children:e.jsx(d.default,{wrapperRef:P,isOpen:v,children:e.jsxs(t.StyledMenuModal,{"aria-label":c,"aria-modal":!!k||void 0,"data-component":"menu-fullscreen","data-element":x,"data-role":y,menuType:C,ref:P,role:"dialog",tabIndex:-1,children:[e.jsx(t.StyledMenuFullscreenHeader,{menuType:C,children:e.jsx(u.default,{"aria-label":T.menuFullscreen.ariaLabels.closeButton(),onClick:M,"data-element":"close",children:e.jsx(s.default,{type:"close",inverse:F})})}),e.jsx(a.Box,{overflowY:"auto",width:"100%",height:"calc(100% - 40px)",children:e.jsx(l.StyledMenuWrapper,{"data-component":"menu",menuType:C,ref:w,display:"flex",flexDirection:"column",role:"list",inFullscreenView:!0,children:e.jsx(o.StrictMenuProvider,{value:{inFullscreenView:!0,menuType:C,openSubmenuId:null,setOpenSubmenuId:()=>{}},children:A})})})]})})})})},M=r=>e.jsx("li",{children:e.jsx(c.Portal,{children:e.jsx(v,h({},r))})});exports.MenuFullscreen=M,exports.default=M;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),n=require("react"),r=require("react-transition-group"),t=require("./menu-full-screen.style.js"),l=require("../menu.style.js"),a=require("../__internal__/strict-menu.context.js"),o=require("../../../__internal__/utils/helpers/events/events.js"),i=require("../../button/__next__/button.component.js"),u=require("../../icon/icon.component.js");require("../../icon/icon.style.js");var s=require("../../portal/portal.js"),c=require("../../../__internal__/focus-trap/focus-trap.component.js"),d=require("../menu-divider/menu-divider.component.js"),m=require("../../../__internal__/dom/globals.js"),f=require("../../../hooks/__internal__/useLocale/useLocale.js"),p=require("../../../hooks/__internal__/useModalAria/useModalAria.js"),j=require("../../../hooks/__internal__/useModalManager/useModalManager.js");function _(e){return e&&e.__esModule?e:{default:e}}var b=_(n);function x(e,n,r){return n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}function v(e){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{},t=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(r).filter((function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})))),t.forEach((function(n){x(e,n,r[n])}))}return e}const h=({"aria-label":s="Fullscreen menu","data-element":_,"data-role":x,children:v,isOpen:h=!1,onClose:y,startPosition:M="left",topModalOverride:q})=>{var O;const g=n.useRef(null),S=n.useRef(null),P=n.useRef(null),C=p.default(S),{menuVariant:F}=a.useStrictMenuContext(),k=f.default(),w=b.default.Children.toArray(v),R=b.default.Children.toArray(w.map(((n,r)=>r<w.length-1?e.jsxs(e.Fragment,{children:[n,e.jsx(d.default,{"data-role":"divider"})]}):n))),V=n.useCallback((e=>{y&&o.default.isEscKey(e)&&(e.stopImmediatePropagation(),y(e))}),[y]);return j.default({open:h,closeModal:V,modalRef:g,topModalOverride:q,focusCallToActionElement:null===(O=m.getDocument())||void 0===O?void 0:O.activeElement}),e.jsx(r.CSSTransition,{nodeRef:g,in:h,timeout:200,unmountOnExit:!0,children:e.jsx(t.StyledMenuFullscreen,{ref:g,$startPosition:M,$transitionDuration:200,children:e.jsx(c.default,{wrapperRef:S,isOpen:h,children:e.jsxs(t.StyledMenuModal,{"aria-label":s,"aria-modal":!!C||void 0,"data-component":"menu-fullscreen","data-element":_,"data-role":x,$menuVariant:F,ref:S,role:"dialog",tabIndex:-1,children:[e.jsx(t.StyledMenuFullscreenHeader,{$menuVariant:F,children:e.jsx(i.Button,{variantType:"subtle",size:"small",inverse:Boolean("black"===F),"aria-label":k.menuFullscreen.ariaLabels.closeButton(),onClick:e=>y(e),"data-element":"close",children:e.jsx(u.default,{type:"close"})})}),e.jsx(t.StyledMenuFullscreenContent,{children:e.jsx(l.StyledMenuWrapper,{"data-component":"menu",ref:P,role:"list",$inFullscreenView:!0,children:e.jsx(a.StrictMenuProvider,{value:{inFullscreenView:!0,menuVariant:F,openSubmenuId:null,setOpenSubmenuId:()=>{}},children:R})})})]})})})})},y=n=>e.jsx("li",{children:e.jsx(s.Portal,{children:e.jsx(h,v({},n))})});exports.MenuFullscreen=y,exports.default=y;
@@ -1,16 +1,16 @@
1
- import type { MenuType } from "../menu.types";
2
- declare const StyledMenuFullscreen: import("styled-components").StyledComponent<"div", any, {
1
+ interface StyledMenuFullscreenProps {
2
+ $transitionDuration: number;
3
+ $startPosition: "left" | "right";
4
+ }
5
+ export declare const StyledMenuFullscreen: import("styled-components").StyledComponent<"div", any, {
3
6
  theme: object;
4
- } & {
5
- transitionDuration: number;
6
- startPosition: "left" | "right";
7
- }, "theme">;
8
- declare const StyledMenuModal: import("styled-components").StyledComponent<"div", any, {
7
+ } & StyledMenuFullscreenProps, "theme">;
8
+ interface StyledMenuModalProps {
9
+ $menuVariant: "white" | "black";
10
+ }
11
+ export declare const StyledMenuModal: import("styled-components").StyledComponent<"div", any, {
9
12
  theme: object;
10
- } & {
11
- menuType: MenuType;
12
- }, "theme">;
13
- declare const StyledMenuFullscreenHeader: import("styled-components").StyledComponent<"div", any, {
14
- menuType: MenuType;
15
- }, never>;
16
- export { StyledMenuModal, StyledMenuFullscreen, StyledMenuFullscreenHeader };
13
+ } & StyledMenuModalProps, "theme">;
14
+ export declare const StyledMenuFullscreenHeader: import("styled-components").StyledComponent<"div", any, StyledMenuModalProps, never>;
15
+ export declare const StyledMenuFullscreenContent: import("styled-components").StyledComponent<"div", any, {}, never>;
16
+ export {};
@@ -1 +1 @@
1
- "use strict";var e=require("styled-components"),t=require("../../../style/themes/apply-base-theme.js"),i=require("../../icon-button/icon-button.style.js"),l=require("../../box/box.style.js"),r=require("../../search/__internal__/legacy/search.style.js"),s=require("../../icon/icon.style.js"),o=require("../../button/button.style.js"),n=require("../menu.config.js"),a=require("../../../style/utils/add-focus-styling.js"),d=require("../../link/link.style.js");function u(e){return e&&e.__esModule?e:{default:e}}var c=u(e);const b=c.default.div.attrs(t.default).withConfig({displayName:"menu-full-screen.style__StyledMenuFullscreen",componentId:"carbon_v162_9_1__sc-f9ae5d65-0"})(["position:fixed;top:0;bottom:0;"," ",""],(({theme:t})=>e.css(["z-index:",";"],t.zIndex.fullScreenModal)),(({startPosition:t,transitionDuration:i})=>e.css(["&.enter{visibility:hidden;",":-100%;}&.enter-active{visibility:visible;",":0;transition:all ","ms ease;}&.exit{visibility:visible;",":0;}&.exit-active{visibility:hidden;",":-100%;transition:all ","ms ease;}"],t,t,i,t,t,i))),f=c.default.div.attrs(t.default).withConfig({displayName:"menu-full-screen.style__StyledMenuModal",componentId:"carbon_v162_9_1__sc-f9ae5d65-1"})(["height:100vh;width:100vw;outline:none;&&{","{max-width:100vw;}"," > a,"," > button,> div{font-size:var(--fontSizes200);}}",""],d.StyledLink,d.StyledLink,d.StyledLink,(({menuType:t})=>e.css(["background-color:",";&&&{","{","{display:inline-flex;bottom:auto;}","{display:flex;line-height:normal;padding-bottom:0;&:focus{border-bottom-right-radius:var(--borderRadius050);border-top-right-radius:var(--borderRadius050);","}}}}","{scrollbar-color:",";&::-webkit-scrollbar{width:var(--sizing150);}&::-webkit-scrollbar-thumb{background-color:",";}&::-webkit-scrollbar-track{background-color:",";}}"],n.default[t].background,r.default,s.default,o.default,a.default(),l.default,n.default[t].scrollbarColor,n.default[t].scrollbarThumb,n.default[t].scrollbarTrack))),y=c.default.div.withConfig({displayName:"menu-full-screen.style__StyledMenuFullscreenHeader",componentId:"carbon_v162_9_1__sc-f9ae5d65-2"})(["height:40px;","{position:absolute;z-index:1;right:16px;top:8px;}",""],i.default,(({menuType:t})=>e.css(["background-color:",";"],n.default[t].submenuItemBackground)));exports.StyledMenuFullscreen=b,exports.StyledMenuFullscreenHeader=y,exports.StyledMenuModal=f;
1
+ "use strict";var e=require("styled-components"),t=require("../../../style/themes/apply-base-theme.js"),l=require("../menu.config.js");function n(e){return e&&e.__esModule?e:{default:e}}var i=n(e);const a=i.default.div.attrs(t.default).withConfig({displayName:"menu-full-screen.style__StyledMenuFullscreen",componentId:"carbon_v162_10_0__sc-9603f910-0"})(["",""],(({$startPosition:t,$transitionDuration:l,theme:n})=>e.css(["position:fixed;top:0;bottom:0;z-index:",";&.enter{visibility:hidden;",":-100%;}&.enter-active{visibility:visible;",":0;transition:all ","ms ease;}&.exit{visibility:visible;",":0;}&.exit-active{visibility:hidden;",":-100%;transition:all ","ms ease;}"],n.zIndex.fullScreenModal,t,t,l,t,t,l))),s=i.default.div.attrs(t.default).withConfig({displayName:"menu-full-screen.style__StyledMenuModal",componentId:"carbon_v162_10_0__sc-9603f910-1"})(["",""],(({$menuVariant:t})=>e.css(["height:100vh;width:100vw;outline:none;background-color:",";"],l.default[t].background))),o=i.default.div.withConfig({displayName:"menu-full-screen.style__StyledMenuFullscreenHeader",componentId:"carbon_v162_10_0__sc-9603f910-2"})(["",""],(({$menuVariant:t})=>e.css(["height:var(--global-size-m);display:flex;justify-content:flex-end;align-items:center;padding:var(--global-space-none) var(--global-space-comp-l);margin-bottom:var(--global-space-comp-s);background-color:",";"],l.default[t].fullScreenHeader))),r=i.default.div.withConfig({displayName:"menu-full-screen.style__StyledMenuFullscreenContent",componentId:"carbon_v162_10_0__sc-9603f910-3"})(["overflow-y:auto;width:100%;height:calc(100% - var(--global-size-m) - var(--global-space-comp-s));"]);exports.StyledMenuFullscreen=a,exports.StyledMenuFullscreenContent=r,exports.StyledMenuFullscreenHeader=o,exports.StyledMenuModal=s;
@@ -21,7 +21,7 @@ interface MenuItemBaseProps extends TagProps, Pick<LayoutProps, "width" | "maxWi
21
21
  target?: string;
22
22
  /** The rel attribute to be used for the underlying <a> tag */
23
23
  rel?: string;
24
- /** set the colour variant for a menuType */
24
+ /** Set the variant of the MenuItem */
25
25
  variant?: VariantType;
26
26
  /** Flag to display the dropdown arrow when an item has a submenu */
27
27
  showDropdownArrow?: boolean;
@@ -33,12 +33,6 @@ interface MenuItemBaseProps extends TagProps, Pick<LayoutProps, "width" | "maxWi
33
33
  onSubmenuOpen?: () => void;
34
34
  /** Callback triggered when submenu closes. Only valid with submenu prop */
35
35
  onSubmenuClose?: () => void;
36
- /**
37
- @ignore @private
38
- private prop, used inside ScrollableBlock to ensure the MenuItem's color variant overrides the CSS
39
- for other MenuItems inside the block
40
- */
41
- overrideColor?: boolean;
42
36
  /** When set the submenu opens by click instead of hover */
43
37
  clickToOpen?: boolean;
44
38
  /**
@@ -47,7 +41,7 @@ interface MenuItemBaseProps extends TagProps, Pick<LayoutProps, "width" | "maxWi
47
41
  * */
48
42
  maxWidth?: MaxWidthProps["maxWidth"];
49
43
  /**
50
- * @private @ignore
44
+ * @private @ignore @internal
51
45
  * Renders MenuItem as a div element
52
46
  * */
53
47
  as?: "div";
@@ -67,11 +61,17 @@ interface MenuItemBaseProps extends TagProps, Pick<LayoutProps, "width" | "maxWi
67
61
  }
68
62
  export interface MenuWithChildren extends MenuItemBaseProps {
69
63
  children?: React.ReactNode;
70
- /** Either prop `icon` must be defined or this node must have children. */
64
+ /**
65
+ * @deprecated Please pass any desired icons as children instead.
66
+ * Either prop `icon` must be defined or this node must have children.
67
+ */
71
68
  icon?: IconType;
72
69
  }
73
70
  export interface MenuWithIcon extends MenuItemBaseProps {
74
- /** Either prop `icon` must be defined or this node must have children. */
71
+ /**
72
+ * @deprecated Please pass any desired icons as children instead.
73
+ * Either prop `icon` must be defined or this node must have children.
74
+ */
75
75
  icon: IconType;
76
76
  children?: React.ReactNode;
77
77
  }
@@ -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("../../../__internal__/focus-trap/focus-trap-utils.js"),u=require("../../../style/utils/filter-styled-system-padding-props.js"),i=require("./menu-item.style.js"),o=require("../../../__internal__/utils/helpers/events/events.js"),l=require("../__internal__/strict-menu.context.js"),a=require("../__internal__/submenu/submenu.component.js"),s=require("../__internal__/submenu/submenu.context.js"),c=require("../menu-segment-title/menu-segment-title.context.js"),d=require("../menu.style.js"),m=require("../../../__internal__/utils/helpers/guid/index.js");function f(e){return e&&e.__esModule?e:{default:e}}var b=f(t),p=f(n);function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y(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){h(e,t,n[t])}))}return e}function v(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 O=t.forwardRef(((n,f)=>{var{submenu:h,submenuMaxWidth:O,submenuMinWidth:g,children:j,href:w,onClick:x,target:_,submenuDirection:S="right",icon:C,selected:I,onKeyDown:P,variant:q="default",showDropdownArrow:D=!0,ariaLabel:M,ariaCurrent:k,clickToOpen:W,maxWidth:F,onSubmenuOpen:E,onSubmenuClose:L,overrideColor:T,rel:V,as:K,"data-element":A,"data-role":H}=n,R=function(e,t){if(null==e)return{};var n,r,u=function(e,t){if(null==e)return{};var n,r,u={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(u[n]=e[n]);return u}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(u[n]=e[n])}return u}(n,["submenu","submenuMaxWidth","submenuMinWidth","children","href","onClick","target","submenuDirection","icon","selected","onKeyDown","variant","showDropdownArrow","ariaLabel","ariaCurrent","clickToOpen","maxWidth","onSubmenuOpen","onSubmenuClose","overrideColor","rel","as","data-element","data-role"]);p.default(C||j,"Either prop `icon` must be defined or this node must have `children`."),p.default(j||M||h||"string"==typeof h&&h.length,"If no text or node is provided via the `submenu` prop, an `ariaLabel` should be given to facilitate accessibility."),p.default("boolean"==typeof h||void 0===h||b.default.isValidElement(h)||j&&"string"==typeof h&&h.length,"You should not pass `children` when `submenu` is an empty string");const N=t.useRef(m.default()),{isChildOfSegment:Y,overriddenVariant:z}=t.useContext(c.MenuSegmentContext),{inFullscreenView:B,registerItem:G,unregisterItem:J,focusId:Q,updateFocusId:U,menuType:X}=l.useStrictMenuContext(),Z=t.useContext(s.default),$=Object.keys(Z).length>0,{submenuFocusId:ee,updateFocusId:te,handleKeyDown:ne,submenuHasMaxWidth:re,closeSubmenu:ue}=Z,ie=Q===N.current,oe=ee?ee===N.current:void 0,[le,ae]=t.useState(null),[se,ce]=t.useState(null);t.useLayoutEffect((()=>{var e;const t=null!==(e=null==le?void 0:le.querySelector(r.defaultFocusableSelectors))&&void 0!==e?e:null;t!==se&&ce(t)}),[se,le]),t.useEffect((()=>{const e=N.current;return G&&G(e),()=>{J&&J(e)}}),[G,J]),t.useEffect((()=>{if(ie&&!oe||oe){if(se)return void se.focus();null==le||le.focus()}}),[se,ie,oe,le]),t.useImperativeHandle(f,(()=>({focus(){null==le||le.focus()}})),[le]);const de=e=>{$?(e.stopPropagation(),null==te||te(N.current)):null==U||U(N.current)},me={className:w||x?"carbon-menu-item--has-link":"",href:se?void 0:w,onClick:se||!w&&!x?void 0:e=>{null==x||x(e),null==ue||ue()},target:_,rel:V,icon:C,removeAriaLabelOnIcon:!0,selected:I,onKeyDown:B?void 0:e=>{null==P||P(e),o.default.isEscKey(e)&&(null==le||le.focus()),null==ne||ne(e)},overrideColor:T,ref:ae};"alternate"===z&&Y&&"alternate"===q&&["white","black"].includes(X)&&(me.overrideColor=!0);const fe=e=>F&&"string"==typeof e?e:void 0,be=B?void 0:F,pe=!(x||w||se);if(h)return e.jsx(d.StyledMenuItem,v(y({"data-component":"menu-item","data-element":A,"data-role":H,menuType:X,title:fe(h),maxWidth:be},R),{inFullscreenView:B,id:N.current,as:K,onFocus:de,children:e.jsx(a.default,v(y(v(y(v(y({},"boolean"!=typeof h&&{title:h}),{submenuDirection:S,showDropdownArrow:D,clickToOpen:W,maxWidth:F,asPassiveItem:pe,ariaLabel:M,onSubmenuOpen:E,onSubmenuClose:L,submenuMaxWidth:O,submenuMinWidth:g}),me),{variant:q}),R),{children:j}))}));const he=u.default(R),ye=!!(null==le?void 0:le.querySelector("[data-element='input']"));return e.jsx(d.StyledMenuItem,v(y({"data-component":"menu-item","data-element":A,"data-role":H,menuType:X,inSubmenu:$,title:fe(j),maxWidth:be},R),{inFullscreenView:B&&!Object.keys(Z).length,id:N.current,as:K,onFocus:de,children:e.jsx(i.default,v(y(v(y({menuType:X,"data-role":"menu-item-wrapper"},me),{menuItemVariant:q,ariaLabel:M,"aria-current":k,maxWidth:re?void 0:be,inFullscreenView:B,asPassiveItem:pe}),he),{asDiv:ye||"div"===K,hasFocusableChild:!!se,hasInput:ye,inSubmenu:$,children:j}))}))}));exports.MenuItem=O,exports.default=O;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),n=require("invariant"),r=require("../../../__internal__/focus-trap/focus-trap-utils.js"),u=require("../../../style/utils/filter-styled-system-padding-props.js"),i=require("./menu-item.style.js"),o=require("../../../__internal__/utils/helpers/events/events.js"),a=require("../__internal__/strict-menu.context.js"),l=require("../__internal__/submenu/submenu.component.js"),s=require("../__internal__/submenu/submenu.context.js"),c=require("../../../__internal__/utils/helpers/guid/index.js"),d=require("../../icon/icon.component.js");require("../../icon/icon.style.js");var m=require("../__internal__/menu-item-variant.context.js");function f(e){return e&&e.__esModule?e:{default:e}}var p=f(t),b=f(n);function h(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function y(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){h(e,t,n[t])}))}return e}function j(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 v=t.forwardRef(((n,f)=>{var{submenu:h,submenuMaxWidth:v,submenuMinWidth:x,children:O,href:g,onClick:_,target:w,submenuDirection:S="right",icon:I,selected:M,onKeyDown:P,variant:W="default",showDropdownArrow:q=!0,ariaLabel:$,ariaCurrent:D,clickToOpen:C,maxWidth:k,onSubmenuOpen:F,onSubmenuClose:E,rel:V,as:K,"data-element":L,"data-role":T}=n,A=function(e,t){if(null==e)return{};var n,r,u=function(e,t){if(null==e)return{};var n,r,u={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(u[n]=e[n]);return u}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(u[n]=e[n])}return u}(n,["submenu","submenuMaxWidth","submenuMinWidth","children","href","onClick","target","submenuDirection","icon","selected","onKeyDown","variant","showDropdownArrow","ariaLabel","ariaCurrent","clickToOpen","maxWidth","onSubmenuOpen","onSubmenuClose","rel","as","data-element","data-role"]);b.default(I||O,"Either prop `icon` must be defined or this node must have `children`."),b.default(O||$||h||"string"==typeof h&&h.length,"If no text or node is provided via the `submenu` prop, an `ariaLabel` should be given to facilitate accessibility."),b.default("boolean"==typeof h||void 0===h||p.default.isValidElement(h)||O&&"string"==typeof h&&h.length,"You should not pass `children` when `submenu` is an empty string");const R=t.useRef(c.default()),{inFullscreenView:H,registerItem:N,unregisterItem:Y,focusId:z,updateFocusId:B,menuVariant:G}=a.useStrictMenuContext(),J=t.useContext(s.default),Q=Object.keys(J).length>0,{submenuFocusId:U,updateFocusId:X,handleKeyDown:Z,submenuMaxWidth:ee,closeSubmenu:te}=J,{menuItemVariant:ne}=t.useContext(m.default),re=z===R.current,ue=U?U===R.current:void 0,[ie,oe]=t.useState(null),[ae,le]=t.useState(null);t.useLayoutEffect((()=>{var e;const t=null!==(e=null==ie?void 0:ie.querySelector(r.defaultFocusableSelectors))&&void 0!==e?e:null;t!==ae&&le(t)}),[ae,ie]),t.useEffect((()=>{const e=R.current;return N&&N(e),()=>{Y&&Y(e)}}),[N,Y]),t.useEffect((()=>{if(re&&!ue||ue){if(ae)return void ae.focus();null==ie||ie.focus()}}),[ae,re,ue,ie]),t.useImperativeHandle(f,(()=>({focus(){null==ie||ie.focus()}})),[ie]);const se=e=>{Q?(e.stopPropagation(),null==X||X(R.current)):null==B||B(R.current)},ce={className:g||_?"carbon-menu-item--has-link":"",href:ae?void 0:g,onClick:ae||!g&&!_?void 0:e=>{null==_||_(e),null==te||te()},target:w,rel:V,onKeyDown:H?void 0:e=>{null==P||P(e),o.default.isEscKey(e)&&(null==ie||ie.focus()),null==Z||Z(e)},ref:oe},de=e=>k&&"string"==typeof e?e:void 0,me=H?void 0:k,fe=!(_||g||ae);if(h){const t=e.jsxs(e.Fragment,{children:[e.jsxs(i.StyledMenuItemContent,{$hasMaxWidth:!!me,children:[I&&e.jsx(d.default,{type:I}),h]}),q&&!H&&e.jsx(d.default,{ml:"4px",type:"dropdown"})]});return e.jsx(i.StyledMenuItem,j(y({"data-component":"menu-item","data-element":L,"data-role":T,title:de(h),$maxWidth:me},A),{$inFullscreenView:H,id:R.current,as:K,onFocus:se,children:e.jsx(l.default,j(y(j(y({title:t,submenuDirection:S,clickToOpen:C,maxWidth:k,asPassiveItem:fe,"aria-label":$,onSubmenuOpen:F,onSubmenuClose:E,submenuMaxWidth:v,submenuMinWidth:x,selected:M},ce),{variant:W}),A),{children:O}))}))}const pe=u.default(A),be=!!(null==ie?void 0:ie.querySelector("[data-element='input']"));return e.jsx(i.StyledMenuItem,j(y({"data-component":"menu-item","data-element":L,"data-role":T,$inSubmenu:Q,title:de(O),$maxWidth:me},A),{$inFullscreenView:H,id:R.current,as:K,onFocus:se,children:e.jsx(i.StyledMenuItemWrapper,j(y(j(y({as:_&&!g?"button":"a",$menuVariant:G,"data-element":"menu-item-wrapper","data-role":"menu-item-wrapper"},ce),{$menuItemVariant:ne||W,"aria-label":$,"aria-current":D,$maxWidth:me,$submenuMaxWidth:ee,$inFullscreenView:H,$asPassiveItem:fe}),pe),{$asDiv:be||"div"===K,$inSubmenu:Q,$selected:M,children:e.jsxs(i.StyledMenuItemContent,{$hasMaxWidth:!!me,children:[I&&e.jsx(d.default,{type:I}),O]})}))}))}));exports.MenuItem=v,exports.default=v;
@@ -1,24 +1,33 @@
1
- import { PaddingProps } from "styled-system";
2
- import { MenuWithChildren } from "./menu-item.component";
3
- import type { MenuType } from "../menu.types";
4
- interface StyledMenuItemWrapperProps extends Pick<MenuWithChildren, "href" | "showDropdownArrow" | "overrideColor" | "clickToOpen" | "maxWidth" | "ariaCurrent">, PaddingProps {
5
- menuType: MenuType;
6
- selected?: boolean;
7
- hasSubmenu?: boolean;
8
- isOpen?: boolean;
9
- inFullscreenView?: boolean;
10
- asPassiveItem?: boolean;
11
- icon?: string;
12
- ariaLabel?: string;
13
- asDiv?: boolean;
14
- hasFocusableChild?: boolean;
15
- hasInput?: boolean;
16
- menuItemVariant?: Pick<MenuWithChildren, "variant">["variant"];
17
- inSubmenu?: boolean;
1
+ import { MaxWidthProps } from "styled-system";
2
+ import { MenuVariantType } from "../menu.component";
3
+ import { VariantType } from "./menu-item.component";
4
+ export interface StyledMenuItemProps {
5
+ $maxWidth?: MaxWidthProps["maxWidth"];
6
+ $inFullscreenView?: boolean;
7
+ $inSubmenu?: boolean;
8
+ $removeHeight?: boolean;
18
9
  }
19
- declare const StyledMenuItemWrapper: import("styled-components").StyledComponent<"a", any, {
10
+ export declare const StyledMenuItem: import("styled-components").StyledComponent<"li", any, {
20
11
  theme: object;
21
- } & {
22
- as: import("react").ForwardRefExoticComponent<import("../../link").LinkProps & import("react").RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
23
- } & StyledMenuItemWrapperProps, "theme" | "as">;
12
+ } & StyledMenuItemProps, "theme">;
13
+ export interface StyledMenuItemWrapperProps {
14
+ $menuVariant: MenuVariantType;
15
+ $selected?: boolean;
16
+ $hasSubmenu?: boolean;
17
+ $isOpen?: boolean;
18
+ $inFullscreenView?: boolean;
19
+ $asPassiveItem?: boolean;
20
+ $asDiv?: boolean;
21
+ $menuItemVariant?: VariantType;
22
+ $inSubmenu?: boolean;
23
+ $submenuMaxWidth?: string;
24
+ $maxWidth?: MaxWidthProps["maxWidth"];
25
+ }
26
+ export declare const StyledMenuItemWrapper: import("styled-components").StyledComponent<"a", any, {
27
+ theme: object;
28
+ } & StyledMenuItemWrapperProps, "theme">;
29
+ interface StyledMenuItemContentProps {
30
+ $hasMaxWidth?: boolean;
31
+ }
32
+ export declare const StyledMenuItemContent: import("styled-components").StyledComponent<"span", any, StyledMenuItemContentProps, never>;
24
33
  export default StyledMenuItemWrapper;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var o=require("styled-components"),n=require("styled-system"),t=require("../menu.config.js"),e=require("../../link/link.component.js"),a=require("../../button/button.style.js"),r=require("../../icon-button/icon-button.style.js"),c=require("../../icon/icon.style.js"),i=require("../../link/link.style.js"),s=require("../../../style/themes/apply-base-theme.js"),u=require("../../../style/utils/add-focus-styling.js");function d(o){return o&&o.__esModule?o:{default:o}}const l=o=>{var n,t;const{paddingRight:e}=o,a=null===(t=String(e))||void 0===t||null===(n=t.match(/\d+/))||void 0===n?void 0:n[0];if("var(--spacing000)"===e||"0"===a)return{padding:"var(--spacing200)",iconSpacing:"2px"};switch(e){case"var(--spacing100)":return{padding:"var(--spacing300)",iconSpacing:e};case"var(--spacing200)":return{padding:"var(--spacing400)",iconSpacing:e};case"var(--spacing300)":return{padding:"var(--spacing500)",iconSpacing:e};case"var(--spacing400)":return{padding:"var(--spacing600)",iconSpacing:e};case"var(--spacing500)":return{padding:"var(--spacing700)",iconSpacing:e};case"var(--spacing600)":return{padding:"var(--spacing800)",iconSpacing:e};case"var(--spacing700)":return{padding:"var(--spacing900)",iconSpacing:e};case"var(--spacing800)":return{padding:"var(--spacing1000)",iconSpacing:e};default:return a?{padding:`${16+Number(a)}px`,iconSpacing:`${a}px`}:{padding:"var(--spacing400)",iconSpacing:"var(--spacing200)"}}},p=d(o).default.a.attrs(s.default).attrs({as:e.Link}).withConfig({displayName:"menu-item.style__StyledMenuItemWrapper",componentId:"carbon_v162_9_1__sc-3770d50b-0"})([""," &&&{> a,> button{","}}"],(({menuType:e,selected:s,hasSubmenu:d,isOpen:p,menuItemVariant:g,showDropdownArrow:b,href:h,clickToOpen:f,maxWidth:m,inFullscreenView:v,overrideColor:x,asPassiveItem:k,asDiv:y,hasFocusableChild:S,hasInput:w,inSubmenu:C})=>o.css(["display:flex;align-items:center;min-height:40px;position:relative;box-shadow:none;a,button{min-height:40px;height:100%;box-sizing:border-box;font-size:14px;font-weight:500;&:not(.legacy-search-button) > ","{margin-right:var(--spacing050);}}&& a:focus,&& button:focus{",'}:has([data-element="input"]) ',"{width:100%;}"," "," "," "," "," button,"," button,a,"," a{margin:0px;text-align:left;",'}&&&{a,button,[data-component="icon"],'," a,"," button,",' [data-component="icon"]{font-weight:500;text-decoration:none;',"}","}"," "," "," "," ",""],c.default,u.default(!0),i.StyledContent,!x&&o.css(["background-color:",';&:has([data-popover-container-button="true"]){background-color:var(--colorsActionMajor500);}'],t.default[e].background),x&&!v&&o.css(["&&&&{background-color:",";}"],"alternate"===g?t.default[e].alternate:t.default[e].submenuItemBackground),!v&&o.css(["max-width:inherit;width:inherit;height:inherit;> a,> button{display:flex;align-items:center;"," width:inherit;max-width:inherit;}&&{a:focus,button:focus{background-color:",";color:",';z-index:1;position:relative;}}&:has([data-popover-container-button="true"]){&&{a:focus,button:focus{background-color:var(--colorsActionMajor500);}}}&&&{a,button{',"}a:hover,button:hover{","{border-radius:0;background-color:transparent;}"," ::before{border-top-color:var(--colorsComponentsMenuYang100);}}}"],C?"":"justify-content: center;",t.default[e].background,t.default[e].color,m&&o.css(["box-sizing:border-box;max-width:inherit;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;vertical-align:bottom;display:block;"]),a.default,!y&&!k&&o.css(['background-color:var(--colorsComponentsMenuAutumnStandard600);color:var(--colorsComponentsMenuYang100);[data-component="icon"]{color:var(--colorsComponentsMenuYang100);}'])),S&&o.css(["&& "," ",'{> span{display:inline-flex;margin-right:0;}:focus{outline:none;[data-component="icon"]{color:',";}}}"],!v&&o.css(["&& > a:not(:has(button)){padding:11px 16px;}> a:has(",":not(.legacy-search-button)){height:100%;","{height:inherit;div{height:inherit;}}","{min-height:40px;padding:10px 0px;box-sizing:border-box;height:100%;}}"],a.default,i.StyledContent,a.default),r.default,t.default[e].color),!S&&!v&&o.css(["",""],d||m?o.css(["& > a,& > button{padding:11px 16px ",";}"],d&&m?"12px":"10px"):o.css(["& > a,& > button{padding:11px 16px;}"])),i.StyledLink,i.StyledLink,v&&o.css(["height:auto;white-space:normal;","{top:-2px;}"],c.default),i.StyledLink,i.StyledLink,i.StyledLink,!w&&`color: ${t.default[e].color};`,!v&&o.css(["a > ",",button > ","{display:inline-block;height:18px;top:-2px;}"],c.default,c.default),s&&o.css(["background-color:",";a:focus,button:focus{background-color:",";}a:hover,button:hover{background-color:var(--colorsComponentsMenuAutumnStandard600);}"],t.default[e].selected,t.default[e].selected),"alternate"===g&&!v&&o.css(["&&&{background-color:",";}&&& a:focus,&&& button:focus{background-color:",";}",""],t.default[e].alternate,t.default[e].alternate,!w&&o.css(["&&& a:hover,&&& button:hover{background-color:",";}"],t.default[e].alternateHover)),p&&o.css(["a,button{background-color:",";color:",";}"],t.default[e].submenuItemBackground,t.default[e].color),d&&o.css(["background-color:",";a:focus,button:focus{background-color:",";color:",';[data-component="icon"]{color:',";}","}a:hover,button:hover{background-color:",";color:var(--colorsComponentsMenuYang100);",' [data-component="icon"]{color:',";}}"," ",""],t.default[e].submenuBackground,t.default[e].submenuBackground,t.default[e].color,t.default[e].color,f&&p&&o.css(["background-color:",";"],t.default[e].submenuOpenedBackground),t.default[e].submenuOpenedBackground,!(h||f)&&o.css(["cursor:default;background-color:",";color:",";"],t.default[e].submenuItemBackground,t.default[e].color),t.default[e].color,s&&o.css(["background-color:",";a:focus,button:focus{background-color:",";}a:hover,button:hover{background-color:var(--colorsComponentsMenuAutumnStandard600);color:var(--colorsComponentsMenuYang100);}"],t.default[e].submenuSelected,t.default[e].submenuSelected),b&&o.css(["&&&{> a,> button:not(","){padding-right:",";}}a::before,button::before{display:block;margin-top:-1px;pointer-events:none;position:absolute;right:",';top:50%;z-index:2;content:"";width:0;height:0;border-width:5px 4px 4px;border-style:solid;border-top-color:initial;border-right-color:transparent;border-bottom-color:transparent;border-left-color:transparent;}'],r.default,(o=>l(n.padding(o)).padding),(o=>l(n.padding(o)).iconSpacing))),v&&o.css([""," > a,> button{min-height:40px;line-height:40px;padding:0px 16px;width:100vw;box-sizing:border-box;}a:focus,button:focus{z-index:1;position:relative;}","}"],y&&o.css(["&&&{> a,> button{color:",";outline:none;}> button:hover,> a:hover{background-color:transparent;cursor:default;outline:none;color:",";}}"],t.default[e].title,t.default[e].title),!k&&o.css(["&&{> a:focus,> a:hover,> button:focus,> button:hover{background-color:var(--colorsComponentsMenuAutumnStandard600);color:var(--colorsComponentsMenuYang100);","}}"],!w&&o.css(['[data-component="icon"]{color:var(--colorsComponentsMenuYang100);}']))))),n.padding);exports.default=p;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("styled-components"),t=require("styled-system"),o=require("../menu.config.js"),a=require("../../../style/themes/apply-base-theme.js"),s=require("../../../style/utils/add-focus-styling.js");function r(e){return e&&e.__esModule?e:{default:e}}var l=r(e);const n=l.default.li.attrs(a.default).withConfig({displayName:"menu-item.style__StyledMenuItem",componentId:"carbon_v162_10_0__sc-338885db-0"})(["display:flex;list-style:none;align-items:stretch;min-height:var(--global-size-m);"," "," ",""],t.layout,t.flexbox,(({$inSubmenu:t,$removeHeight:o,$inFullscreenView:a,$maxWidth:s})=>e.css([""," "," ",""],t&&e.css(["display:list-item;",""],a&&e.css(["width:100%;"])),o&&e.css(["min-height:0;"]),s&&e.css(["max-width:",";"],s)))),i=e.css(['padding:0;.popover-open-component{[data-component="button"]{background-color:inherit;color:inherit;border-radius:inherit;border:none;padding:var(--global-space-comp-xs) var(--global-space-comp-l);&:focus{','}}[data-popover-container-button="true"]{background-color:var(--colorsActionMajor500);&:focus{background-color:var(--colorsActionMajor500);}}}'],s.default(!0)),c=l.default.a.attrs(a.default).withConfig({displayName:"menu-item.style__StyledMenuItemWrapper",componentId:"carbon_v162_10_0__sc-338885db-1"})(["",""],(({$menuVariant:a,$selected:r,$hasSubmenu:l,$isOpen:n,$menuItemVariant:c,$maxWidth:d,$inFullscreenView:u,$asPassiveItem:m,$asDiv:p,$inSubmenu:b,$submenuMaxWidth:g,theme:f})=>e.css(["position:relative;display:flex;align-items:center;box-sizing:border-box;min-height:var(--global-size-m);text-decoration:none;text-align:left;font:var(--global-font-static-comp-medium-m);padding:var(--global-space-comp-xs) var(--global-space-comp-l);background-color:",";color:",";border:none;"," "," "," "," "," "," &:has([data-component='popover-container']){","}"],o.default[a].background,o.default[a].color,t.padding,d&&e.css(["max-width:",";"],d),u&&e.css(["width:100%;font:var(--global-font-static-comp-medium-l);",""],l&&e.css(["color:",";"],o.default[a].title)),!m&&!p&&e.css(["&:hover{cursor:pointer;background-color:",";color:",";}&:focus{","}&:active{background-color:",";color:",";}"],o.default[a].backgroundHover,o.default[a].colorHover,s.default(!0),o.default[a].backgroundActive,o.default[a].colorActive),r&&e.css(['&::before{content:"";position:absolute;width:var(--global-size-xs);height:var(--global-size-6-xs);background-color:var(--nav-primary-bg-selected);'," ","}"],!u&&e.css(["bottom:0px;left:50%;transform:translate(-50%,0%);width:var(--global-size-xs);height:var(--global-size-6-xs);"]),u&&e.css(["left:0px;top:50%;transform:translate(0%,-50%);height:var(--global-size-xs);width:var(--global-size-6-xs);"])),!u&&e.css([""," ",""],l&&n&&e.css(["z-index:calc("," + 1);background-color:",";",""],f.zIndex.popover,o.default[a].submenuOpenedBackground,"white"===a&&e.css(["box-shadow:inset 1px 0 0 var(--nav-tertiary-border-default),inset -1px 0 0 var(--nav-tertiary-border-default);"])),b&&e.css(["width:100%;background-color:",";"," ",""],o.default[a].submenuItemBackground,"alternate"===c&&e.css(["background-color:",";"],o.default[a].alternate),g&&e.css(["max-width:",";"],g))),i))),d=l.default.span.withConfig({displayName:"menu-item.style__StyledMenuItemContent",componentId:"carbon_v162_10_0__sc-338885db-2"})(["",""],(({$hasMaxWidth:t})=>e.css(["display:flex;align-items:center;gap:var(--global-space-comp-s);width:100%;"," .search{width:100%;}"],t&&e.css(["display:block;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;vertical-align:middle;"]))));exports.StyledMenuItem=n,exports.StyledMenuItemContent=d,exports.StyledMenuItemWrapper=c,exports.default=c;
@@ -1,12 +1,13 @@
1
1
  import React from "react";
2
2
  import { VariantType } from "../menu-item";
3
3
  import { TagProps } from "../../../__internal__/utils/helpers/tags";
4
- declare const AS_VALUES: readonly ["h2", "h3", "h4", "h5", "h6"];
5
- type AllowedAsValues = (typeof AS_VALUES)[number];
4
+ type AllowedAsValues = "h2" | "h3" | "h4" | "h5" | "h6";
6
5
  export interface MenuTitleProps extends TagProps {
6
+ /** MenuItem children to be rendered within the segment */
7
7
  children?: React.ReactNode;
8
+ /** The text content for the segment title */
8
9
  text: string;
9
- /** Set the colour variant for a menuType */
10
+ /** Set the variant of the MenuSegmentTitle */
10
11
  variant?: VariantType;
11
12
  /** Set the heading level for the segment title */
12
13
  as?: AllowedAsValues;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("./menu-segment-title.style.js"),n=require("../__internal__/strict-menu.context.js"),u=require("../menu.style.js"),i=require("../../../__internal__/utils/helpers/tags/tags.js"),l=require("../__internal__/submenu/submenu.context.js"),s=require("./menu-segment-title.context.js");function o(e){return e&&e.__esModule?e:{default:e}}function a(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){a(e,t,r[t])}))}return e}function f(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 p=["h2","h3","h4","h5","h6"],d=o(t).default.forwardRef(((o,a)=>{var{children:d,variant:m="default",text:b,as:y="h2",segmentWrapperProps:O}=o,j=function(e,t){if(null==e)return{};var r,n,u=function(e,t){if(null==e)return{};var r,n,u={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(u[r]=e[r]);return u}(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)&&(u[r]=e[r])}return u}(o,["children","variant","text","as","segmentWrapperProps"]);const{menuType:g,inFullscreenView:h}=n.useStrictMenuContext(),{submenuHasMaxWidth:v}=t.useContext(l.default),x=!!h,P=t.useMemo((()=>x&&"alternate"===m&&["white","black"].includes(g)?"default":m),[x,g,m]);return e.jsxs(u.StyledMenuItem,{inSubmenu:!0,children:[e.jsx(r.StyledTitle,f(c({as:p.includes(y)?y:"h2"},i.default("menu-segment-title",j)),{menuType:g,ref:a,variant:P,shouldWrap:v,children:b})),d&&e.jsx(r.StyledSegmentChildren,f(c({menuType:g,variant:P},i.default("menu-segment-title",c({"data-role":"menu-segment-children"},O))),{children:e.jsx(s.MenuSegmentContext.Provider,{value:{isChildOfSegment:!0,overriddenVariant:P},children:d})}))]})}));d.displayName="MenuSegmentTitle",exports.default=d;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),t=require("react"),r=require("./menu-segment-title.style.js"),n=require("../__internal__/strict-menu.context.js"),u=require("../__internal__/menu-item-variant.context.js"),i=require("../menu-item/menu-item.style.js"),l=require("../../../__internal__/utils/helpers/tags/tags.js"),s=require("../__internal__/submenu/submenu.context.js");function o(e){return e&&e.__esModule?e:{default:e}}function a(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){a(e,t,r[t])}))}return e}function f(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 m=o(t).default.forwardRef(((o,a)=>{var{children:m,variant:p="default",text:b,as:d="h2",segmentWrapperProps:y}=o,O=function(e,t){if(null==e)return{};var r,n,u=function(e,t){if(null==e)return{};var r,n,u={},i=Object.keys(e);for(n=0;n<i.length;n++)r=i[n],t.indexOf(r)>=0||(u[r]=e[r]);return u}(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)&&(u[r]=e[r])}return u}(o,["children","variant","text","as","segmentWrapperProps"]);const{menuVariant:j,inFullscreenView:g}=n.useStrictMenuContext(),{submenuMaxWidth:_}=t.useContext(s.default);return e.jsxs(i.StyledMenuItem,{$inSubmenu:!0,$removeHeight:!0,children:[e.jsx(r.StyledTitle,f(c({as:d},l.default("menu-segment-title",O)),{$menuVariant:j,ref:a,$variant:g?void 0:p,$shouldWrap:!!_,$isInFullscreen:g,children:b})),m&&e.jsx(r.StyledSegmentChildren,f(c({},l.default("menu-segment-title",c({"data-role":"menu-segment-children"},y))),{children:e.jsx(u.default.Provider,{value:{menuItemVariant:p},children:m})}))]})}));m.displayName="MenuSegmentTitle",exports.default=m;
@@ -1,13 +1,11 @@
1
+ import { MenuVariantType } from "../menu.component";
1
2
  import { VariantType } from "../menu-item";
2
- import type { MenuType } from "../menu.types";
3
3
  interface StyledTitleProps {
4
- variant?: VariantType;
5
- menuType: MenuType;
6
- shouldWrap?: boolean;
4
+ $variant?: VariantType;
5
+ $menuVariant: MenuVariantType;
6
+ $shouldWrap?: boolean;
7
+ $isInFullscreen?: boolean;
7
8
  }
8
9
  declare const StyledTitle: import("styled-components").StyledComponent<"h2", any, StyledTitleProps, never>;
9
- declare const StyledSegmentChildren: import("styled-components").StyledComponent<"ul", any, {
10
- variant?: VariantType;
11
- menuType: MenuType;
12
- }, never>;
10
+ declare const StyledSegmentChildren: import("styled-components").StyledComponent<"ul", any, {}, never>;
13
11
  export { StyledTitle, StyledSegmentChildren };
@@ -1 +1 @@
1
- "use strict";var e=require("styled-components"),t=require("../menu.config.js");function n(e){return e&&e.__esModule?e:{default:e}}var a=n(e);const l=a.default.h2.withConfig({displayName:"menu-segment-title.style__StyledTitle",componentId:"carbon_v162_9_1__sc-41a2d76d-0"})(["",""],(({menuType:n,variant:a,shouldWrap:l})=>e.css(["margin:0px;padding:16px 16px 8px;font-size:12px;font-weight:500;text-transform:uppercase;line-height:14px;cursor:default;color:",";"," white-space:",";"],t.default[n].title,"alternate"===a&&`background-color: ${t.default[n].alternate};`,l?"normal":"nowrap"))),r=a.default.ul.withConfig({displayName:"menu-segment-title.style__StyledSegmentChildren",componentId:"carbon_v162_9_1__sc-41a2d76d-1"})(["",""],(({menuType:n,variant:a})=>e.css(["padding:0;li{list-style:none;"," &:not(&:last-child) a,&:not(&:last-child) button,&:not(&:last-child) > span,&:not(&:last-child) > div{border-radius:var(--borderRadius000);}}"],"alternate"===a&&e.css(["background-color:",";"],t.default[n].alternate))));exports.StyledSegmentChildren=r,exports.StyledTitle=l;
1
+ "use strict";var e=require("styled-components"),a=require("../menu.config.js");function t(e){return e&&e.__esModule?e:{default:e}}var l=t(e);const n=l.default.h2.withConfig({displayName:"menu-segment-title.style__StyledTitle",componentId:"carbon_v162_10_0__sc-6f99340f-0"})(["",""],(({$menuVariant:t,$variant:l,$shouldWrap:n,$isInFullscreen:o})=>e.css(["margin:var(--global-space-none);padding:var(--global-space-comp-s) var(--global-space-comp-l) var(--global-space-none);text-transform:uppercase;cursor:default;white-space:",";font-size:12px;font-weight:500;line-height:150%;color:",";background-color:",";"," ",""],n?"normal":"nowrap",a.default[t].title,a.default[t].submenuItemBackground,"alternate"===l&&e.css(["background-color:",";"],a.default[t].alternate),o&&e.css(["background-color:",";padding:var(--global-space-comp-s) var(--global-space-comp-l);"],a.default[t].background)))),o=l.default.ul.withConfig({displayName:"menu-segment-title.style__StyledSegmentChildren",componentId:"carbon_v162_10_0__sc-6f99340f-1"})(["padding:0;"]);exports.StyledSegmentChildren=o,exports.StyledTitle=n;
@@ -1,4 +1,18 @@
1
1
  import React from "react";
2
- import type { MenuProps } from "./menu.types";
3
- export declare const Menu: ({ menuType, children, ...rest }: MenuProps) => React.JSX.Element;
2
+ import { FlexboxProps, LayoutProps } from "styled-system";
3
+ import { TagProps } from "../../__internal__/utils/helpers/tags";
4
+ /** @deprecated */
5
+ export type MenuType = "light" | "dark" | "white" | "black";
6
+ export type MenuVariantType = "white" | "black";
7
+ export interface MenuProps extends TagProps, Pick<LayoutProps, "width" | "minWidth" | "maxWidth" | "overflow" | "overflowX" | "verticalAlign">, FlexboxProps {
8
+ /** Children elements */
9
+ children: React.ReactNode;
10
+ /**
11
+ * @deprecated Please use the `variant` prop instead.
12
+ */
13
+ menuType?: MenuType;
14
+ /** Set the color variant of the component */
15
+ variant?: MenuVariantType;
16
+ }
17
+ export declare const Menu: ({ menuType, variant, children, ...rest }: MenuProps) => React.JSX.Element;
4
18
  export default Menu;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("../../__internal__/utils/helpers/tags/tags.js"),n=require("./menu.style.js"),u=require("./__internal__/strict-menu.context.js"),o=require("./__internal__/menu.context.js"),i=require("./__internal__/keyboard-navigation/index.js"),l=require("./__internal__/locators.js");function c(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}const s=s=>{var{menuType:a="light",children:p}=s,f=function(e,r){if(null==e)return{};var t,n,u=function(e,r){if(null==e)return{};var t,n,u={},o=Object.keys(e);for(n=0;n<o.length;n++)t=o[n],r.indexOf(t)>=0||(u[t]=e[t]);return u}(e,r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)t=o[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(u[t]=e[t])}return u}(s,["menuType","children"]);const[y,b]=r.useState(null),O=r.useRef(null),[j,d]=r.useState(void 0),[_,m]=r.useState([]),g=r.useCallback((e=>{m((r=>[...r,e]))}),[]),v=r.useCallback((e=>{m((r=>r.filter((r=>r!==e))))}),[]);return e.jsx(n.StyledMenuWrapper,(P=function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),n.forEach((function(r){c(e,r,t[r])}))}return e}({menuType:a},f,t.default("menu",f)),S=null!=(S={ref:O,role:"list",onKeyDown:e=>{if(O.current){const r=O.current.querySelectorAll(l.MENU_ITEM_CHILDREN_LOCATOR);if(r){const t=i.menuKeyboardNavigation(e,Array.from(r));void 0!==t&&d(_[t])}}},children:e.jsx(u.StrictMenuProvider,{value:{menuType:a,openSubmenuId:y,setOpenSubmenuId:b,focusId:j,updateFocusId:d,registerItem:g,unregisterItem:v},children:e.jsx(o.default.Provider,{value:{inMenu:!0},children:p})})})?S:{},Object.getOwnPropertyDescriptors?Object.defineProperties(P,Object.getOwnPropertyDescriptors(S)):function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r}(Object(S)).forEach((function(e){Object.defineProperty(P,e,Object.getOwnPropertyDescriptor(S,e))})),P));var P,S};exports.Menu=s,exports.default=s;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),r=require("react"),t=require("../../__internal__/utils/helpers/tags/tags.js"),n=require("./menu.style.js"),u=require("./__internal__/strict-menu.context.js"),i=require("./__internal__/menu.context.js"),o=require("./__internal__/keyboard-navigation/index.js"),l=require("./__internal__/locators.js");function c(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}const a=a=>{var{menuType:s,variant:b="white",children:f}=a,p=function(e,r){if(null==e)return{};var t,n,u=function(e,r){if(null==e)return{};var t,n,u={},i=Object.keys(e);for(n=0;n<i.length;n++)t=i[n],r.indexOf(t)>=0||(u[t]=e[t]);return u}(e,r);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n<i.length;n++)t=i[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(u[t]=e[t])}return u}(a,["menuType","variant","children"]);const[y,O]=r.useState(null),d=r.useRef(null),[j,_]=r.useState(void 0),[m,v]=r.useState([]);let g=b;"light"===s||"white"===s?g="white":"dark"!==s&&"black"!==s||(g="black");const h=r.useCallback((e=>{v((r=>[...r,e]))}),[]),P=r.useCallback((e=>{v((r=>r.filter((r=>r!==e))))}),[]);return e.jsx(n.StyledMenuWrapper,(w=function(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{},n=Object.keys(t);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(t).filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})))),n.forEach((function(r){c(e,r,t[r])}))}return e}({},p,t.default("menu",p)),S=null!=(S={ref:d,role:"list",onKeyDown:e=>{if(d.current){const r=d.current.querySelectorAll(l.MENU_ITEM_CHILDREN_LOCATOR);if(r){const t=o.menuKeyboardNavigation(e,Array.from(r));void 0!==t&&_(m[t])}}},children:e.jsx(u.StrictMenuProvider,{value:{menuVariant:g,openSubmenuId:y,setOpenSubmenuId:O,focusId:j,updateFocusId:_,registerItem:h,unregisterItem:P},children:e.jsx(i.default.Provider,{value:{inMenu:!0},children:f})})})?S:{},Object.getOwnPropertyDescriptors?Object.defineProperties(w,Object.getOwnPropertyDescriptors(S)):function(e){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r.push.apply(r,t)}return r}(Object(S)).forEach((function(e){Object.defineProperty(w,e,Object.getOwnPropertyDescriptor(S,e))})),w));var w,S};exports.Menu=a,exports.default=a;