@carbon/web-components 2.58.1 → 2.59.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 (568) hide show
  1. package/custom-elements.json +186 -40
  2. package/es/components/accordion/accordion.scss.js +1 -1
  3. package/es/components/ai-label/ai-label.scss.js +1 -1
  4. package/es/components/ai-label/ai-label.scss.js.map +1 -1
  5. package/es/components/breadcrumb/breadcrumb.scss.js +1 -1
  6. package/es/components/button/button.d.ts +2 -2
  7. package/es/components/button/button.d.ts.map +1 -1
  8. package/es/components/button/button.js +2 -2
  9. package/es/components/button/button.js.map +1 -1
  10. package/es/components/button/button.scss.js +1 -1
  11. package/es/components/button/button.scss.js.map +1 -1
  12. package/es/components/chat-button/chat-button.scss.js +1 -1
  13. package/es/components/chat-button/chat-button.scss.js.map +1 -1
  14. package/es/components/checkbox/checkbox-group.d.ts +1 -1
  15. package/es/components/checkbox/checkbox.d.ts +1 -1
  16. package/es/components/checkbox/checkbox.scss.js +1 -1
  17. package/es/components/code-snippet/code-snippet.d.ts +1 -1
  18. package/es/components/code-snippet/code-snippet.scss.js +1 -1
  19. package/es/components/combo-box/combo-box.scss.js +1 -1
  20. package/es/components/combo-box/combo-box.scss.js.map +1 -1
  21. package/es/components/combo-button/combo-button.scss.js +1 -1
  22. package/es/components/contained-list/contained-list.scss.js +1 -1
  23. package/es/components/contained-list/contained-list.scss.js.map +1 -1
  24. package/es/components/content-switcher/content-switcher-item.d.ts +1 -1
  25. package/es/components/content-switcher/content-switcher.scss.js +1 -1
  26. package/es/components/copy-button/copy-button.scss.js +1 -1
  27. package/es/components/copy-button/copy-button.scss.js.map +1 -1
  28. package/es/components/data-table/data-table.scss.js +1 -1
  29. package/es/components/data-table/table-header-cell.d.ts +1 -1
  30. package/es/components/data-table/table-toolbar-search.d.ts +1 -1
  31. package/es/components/date-picker/date-picker-input.d.ts +1 -1
  32. package/es/components/date-picker/date-picker.scss.js +1 -1
  33. package/es/components/dialog/dialog.scss.js +1 -1
  34. package/es/components/dropdown/dropdown-item.d.ts +2 -1
  35. package/es/components/dropdown/dropdown-item.d.ts.map +1 -1
  36. package/es/components/dropdown/dropdown-item.js +4 -3
  37. package/es/components/dropdown/dropdown-item.js.map +1 -1
  38. package/es/components/dropdown/dropdown.d.ts +1 -1
  39. package/es/components/dropdown/dropdown.scss.js +1 -1
  40. package/es/components/feature-flags/index.d.ts +3 -0
  41. package/es/components/feature-flags/index.d.ts.map +1 -1
  42. package/es/components/feature-flags/index.js +33 -5
  43. package/es/components/feature-flags/index.js.map +1 -1
  44. package/es/components/file-uploader/file-uploader-button.d.ts +1 -0
  45. package/es/components/file-uploader/file-uploader-button.d.ts.map +1 -1
  46. package/es/components/file-uploader/file-uploader-button.js +10 -11
  47. package/es/components/file-uploader/file-uploader-button.js.map +1 -1
  48. package/es/components/file-uploader/file-uploader-drop-container.d.ts +1 -0
  49. package/es/components/file-uploader/file-uploader-drop-container.d.ts.map +1 -1
  50. package/es/components/file-uploader/file-uploader-drop-container.js +6 -5
  51. package/es/components/file-uploader/file-uploader-drop-container.js.map +1 -1
  52. package/es/components/file-uploader/file-uploader.scss.js +1 -1
  53. package/es/components/file-uploader/file-uploader.scss.js.map +1 -1
  54. package/es/components/floating-menu/floating-menu.d.ts +1 -1
  55. package/es/components/floating-menu/floating-menu.js +1 -1
  56. package/es/components/floating-menu/floating-menu.js.map +1 -1
  57. package/es/components/fluid-combo-box/fluid-combo-box.scss.js +1 -1
  58. package/es/components/fluid-combo-box/fluid-combo-box.scss.js.map +1 -1
  59. package/es/components/fluid-dropdown/fluid-dropdown.scss.js +1 -1
  60. package/es/components/fluid-dropdown/fluid-dropdown.scss.js.map +1 -1
  61. package/es/components/fluid-multi-select/fluid-multi-select.scss.js +1 -1
  62. package/es/components/fluid-multi-select/fluid-multi-select.scss.js.map +1 -1
  63. package/es/components/fluid-number-input/fluid-number-input.scss.js +1 -1
  64. package/es/components/fluid-number-input/fluid-number-input.scss.js.map +1 -1
  65. package/es/components/fluid-password-input/fluid-password-input.scss.js +1 -1
  66. package/es/components/fluid-password-input/fluid-password-input.scss.js.map +1 -1
  67. package/es/components/fluid-search/fluid-search.scss.js +1 -1
  68. package/es/components/fluid-search/fluid-search.scss.js.map +1 -1
  69. package/es/components/fluid-select/fluid-select.scss.js +1 -1
  70. package/es/components/fluid-select/fluid-select.scss.js.map +1 -1
  71. package/es/components/fluid-text-input/fluid-text-input.scss.js +1 -1
  72. package/es/components/fluid-text-input/fluid-text-input.scss.js.map +1 -1
  73. package/es/components/fluid-textarea/fluid-textarea.scss.js +1 -1
  74. package/es/components/fluid-textarea/fluid-textarea.scss.js.map +1 -1
  75. package/es/components/fluid-time-picker/fluid-time-picker.scss.js +1 -1
  76. package/es/components/fluid-time-picker/fluid-time-picker.scss.js.map +1 -1
  77. package/es/components/icon-button/icon-button.d.ts +1 -1
  78. package/es/components/icon-button/icon-button.d.ts.map +1 -1
  79. package/es/components/icon-button/icon-button.js.map +1 -1
  80. package/es/components/icon-button/icon-button.scss.js +1 -1
  81. package/es/components/icon-button/icon-button.scss.js.map +1 -1
  82. package/es/components/icon-indicator/icon-indicator.d.ts +20 -1
  83. package/es/components/icon-indicator/icon-indicator.d.ts.map +1 -1
  84. package/es/components/icon-indicator/icon-indicator.js +30 -2
  85. package/es/components/icon-indicator/icon-indicator.js.map +1 -1
  86. package/es/components/icon-indicator/icon-indicator.scss.js +1 -1
  87. package/es/components/icon-indicator/icon-indicator.scss.js.map +1 -1
  88. package/es/components/layout/layout.scss.js +1 -1
  89. package/es/components/layout/layout.scss.js.map +1 -1
  90. package/es/components/link/link.d.ts +1 -1
  91. package/es/components/menu/menu-item-selectable.d.ts +1 -1
  92. package/es/components/menu/menu-item.scss.js +1 -1
  93. package/es/components/menu/menu-item.scss.js.map +1 -1
  94. package/es/components/menu/menu.scss.js +1 -1
  95. package/es/components/menu-button/menu-button.scss.js +1 -1
  96. package/es/components/modal/modal-close-button.d.ts +1 -1
  97. package/es/components/modal/modal.scss.js +1 -1
  98. package/es/components/multi-select/multi-select.scss.js +1 -1
  99. package/es/components/notification/actionable-notification.d.ts.map +1 -1
  100. package/es/components/notification/actionable-notification.js +5 -2
  101. package/es/components/notification/actionable-notification.js.map +1 -1
  102. package/es/components/notification/actionable-notification.scss.js +1 -1
  103. package/es/components/notification/actionable-notification.scss.js.map +1 -1
  104. package/es/components/notification/inline-notification.scss.js +1 -1
  105. package/es/components/notification/inline-notification.scss.js.map +1 -1
  106. package/es/components/notification/toast-notification.scss.js +1 -1
  107. package/es/components/notification/toast-notification.scss.js.map +1 -1
  108. package/es/components/number-input/number-input.d.ts +1 -1
  109. package/es/components/number-input/number-input.scss.js +1 -1
  110. package/es/components/overflow-menu/overflow-menu-body.d.ts +1 -1
  111. package/es/components/overflow-menu/overflow-menu-body.d.ts.map +1 -1
  112. package/es/components/overflow-menu/overflow-menu-body.js +2 -2
  113. package/es/components/overflow-menu/overflow-menu-body.js.map +1 -1
  114. package/es/components/overflow-menu/overflow-menu-item.d.ts +1 -1
  115. package/es/components/overflow-menu/overflow-menu.d.ts +8 -1
  116. package/es/components/overflow-menu/overflow-menu.d.ts.map +1 -1
  117. package/es/components/overflow-menu/overflow-menu.js +47 -3
  118. package/es/components/overflow-menu/overflow-menu.js.map +1 -1
  119. package/es/components/overflow-menu/overflow-menu.scss.js +1 -1
  120. package/es/components/overflow-menu/overflow-menu.scss.js.map +1 -1
  121. package/es/components/pagination/pagination.d.ts +1 -1
  122. package/es/components/pagination/pagination.scss.js +1 -1
  123. package/es/components/pagination/pagination.scss.js.map +1 -1
  124. package/es/components/pagination-nav/pagination-nav.scss.js +1 -1
  125. package/es/components/pagination-nav/pagination-nav.scss.js.map +1 -1
  126. package/es/components/password-input/password-input.d.ts +1 -1
  127. package/es/components/password-input/password-input.scss.js +1 -1
  128. package/es/components/password-input/password-input.scss.js.map +1 -1
  129. package/es/components/popover/popover.scss.js +1 -1
  130. package/es/components/popover/popover.scss.js.map +1 -1
  131. package/es/components/progress-bar/progress-bar.scss.js +1 -1
  132. package/es/components/progress-indicator/progress-indicator.scss.js +1 -1
  133. package/es/components/progress-indicator/progress-step.d.ts +1 -1
  134. package/es/components/radio-button/radio-button.d.ts +1 -1
  135. package/es/components/radio-button/radio-button.scss.js +1 -1
  136. package/es/components/search/search.d.ts +9 -1
  137. package/es/components/search/search.d.ts.map +1 -1
  138. package/es/components/search/search.js +7 -6
  139. package/es/components/search/search.js.map +1 -1
  140. package/es/components/search/search.scss.js +1 -1
  141. package/es/components/select/select.d.ts +1 -1
  142. package/es/components/select/select.scss.js +1 -1
  143. package/es/components/select/select.scss.js.map +1 -1
  144. package/es/components/shape-indicator/shape-indicator.d.ts +20 -1
  145. package/es/components/shape-indicator/shape-indicator.d.ts.map +1 -1
  146. package/es/components/shape-indicator/shape-indicator.js +32 -4
  147. package/es/components/shape-indicator/shape-indicator.js.map +1 -1
  148. package/es/components/shape-indicator/shape-indicator.scss.js +1 -1
  149. package/es/components/shape-indicator/shape-indicator.scss.js.map +1 -1
  150. package/es/components/skip-to-content/skip-to-content.d.ts +1 -1
  151. package/es/components/skip-to-content/skip-to-content.scss.js +1 -1
  152. package/es/components/slider/slider-input.d.ts +2 -1
  153. package/es/components/slider/slider-input.d.ts.map +1 -1
  154. package/es/components/slider/slider-input.js +2 -1
  155. package/es/components/slider/slider-input.js.map +1 -1
  156. package/es/components/slider/slider.d.ts +2 -1
  157. package/es/components/slider/slider.d.ts.map +1 -1
  158. package/es/components/slider/slider.js +5 -5
  159. package/es/components/slider/slider.js.map +1 -1
  160. package/es/components/slider/slider.scss.js +1 -1
  161. package/es/components/slider/slider.scss.js.map +1 -1
  162. package/es/components/slug/slug.scss.js +1 -1
  163. package/es/components/slug/slug.scss.js.map +1 -1
  164. package/es/components/structured-list/structured-list.d.ts +1 -1
  165. package/es/components/structured-list/structured-list.scss.js +1 -1
  166. package/es/components/tabs/tabs-vertical.d.ts +4 -0
  167. package/es/components/tabs/tabs-vertical.d.ts.map +1 -1
  168. package/es/components/tabs/tabs-vertical.js +3 -2
  169. package/es/components/tabs/tabs-vertical.js.map +1 -1
  170. package/es/components/tabs/tabs.scss.js +1 -1
  171. package/es/components/tabs/tabs.scss.js.map +1 -1
  172. package/es/components/tag/operational-tag.d.ts +1 -1
  173. package/es/components/tag/operational-tag.d.ts.map +1 -1
  174. package/es/components/tag/operational-tag.js +3 -3
  175. package/es/components/tag/operational-tag.js.map +1 -1
  176. package/es/components/tag/selectable-tag.d.ts +1 -1
  177. package/es/components/tag/selectable-tag.d.ts.map +1 -1
  178. package/es/components/tag/selectable-tag.js +3 -3
  179. package/es/components/tag/selectable-tag.js.map +1 -1
  180. package/es/components/tag/tag.d.ts +1 -0
  181. package/es/components/tag/tag.d.ts.map +1 -1
  182. package/es/components/tag/tag.js +3 -3
  183. package/es/components/tag/tag.js.map +1 -1
  184. package/es/components/tag/tag.scss.js +1 -1
  185. package/es/components/text-input/text-input.d.ts +1 -1
  186. package/es/components/text-input/text-input.scss.js +1 -1
  187. package/es/components/text-input/text-input.scss.js.map +1 -1
  188. package/es/components/textarea/textarea.d.ts +1 -1
  189. package/es/components/textarea/textarea.scss.js +1 -1
  190. package/es/components/textarea/textarea.scss.js.map +1 -1
  191. package/es/components/tile/selectable-tile.d.ts +1 -1
  192. package/es/components/tile/tile.scss.js +1 -1
  193. package/es/components/tile/tile.scss.js.map +1 -1
  194. package/es/components/time-picker/time-picker-select.d.ts +1 -1
  195. package/es/components/time-picker/time-picker.d.ts +1 -1
  196. package/es/components/time-picker/time-picker.scss.js +1 -1
  197. package/es/components/time-picker/time-picker.scss.js.map +1 -1
  198. package/es/components/toggle-tip/toggletip.d.ts +13 -1
  199. package/es/components/toggle-tip/toggletip.d.ts.map +1 -1
  200. package/es/components/toggle-tip/toggletip.js +10 -14
  201. package/es/components/toggle-tip/toggletip.js.map +1 -1
  202. package/es/components/toggle-tip/toggletip.scss.js +1 -1
  203. package/es/components/tooltip/definition-tooltip.d.ts +4 -2
  204. package/es/components/tooltip/definition-tooltip.d.ts.map +1 -1
  205. package/es/components/tooltip/definition-tooltip.js +23 -12
  206. package/es/components/tooltip/definition-tooltip.js.map +1 -1
  207. package/es/components/tooltip/tooltip.scss.js +1 -1
  208. package/es/components/tooltip/tooltip.scss.js.map +1 -1
  209. package/es/components/ui-shell/header-global-action.d.ts +2 -2
  210. package/es/components/ui-shell/header-global-action.d.ts.map +1 -1
  211. package/es/components/ui-shell/header-global-action.js +3 -3
  212. package/es/components/ui-shell/header-global-action.js.map +1 -1
  213. package/es/components/ui-shell/header-menu-button.d.ts +1 -1
  214. package/es/components/ui-shell/header-menu.d.ts +1 -1
  215. package/es/components/ui-shell/header-name.d.ts +1 -1
  216. package/es/components/ui-shell/header-nav-item.d.ts +1 -1
  217. package/es/components/ui-shell/header-panel.d.ts +1 -1
  218. package/es/components/ui-shell/header.scss.js +1 -1
  219. package/es/components/ui-shell/side-nav-link.d.ts +1 -1
  220. package/es/components/ui-shell/side-nav-menu-item.d.ts +1 -1
  221. package/es/components/ui-shell/side-nav-menu.d.ts +1 -1
  222. package/es/components/ui-shell/switcher-item.d.ts +1 -1
  223. package/es/components/ui-shell/switcher.d.ts +1 -1
  224. package/es/packages/feature-flags/es/index.js +12 -0
  225. package/es/packages/feature-flags/es/index.js.map +1 -1
  226. package/es-custom/components/accordion/accordion.scss.js +1 -1
  227. package/es-custom/components/ai-label/ai-label.scss.js +1 -1
  228. package/es-custom/components/ai-label/ai-label.scss.js.map +1 -1
  229. package/es-custom/components/breadcrumb/breadcrumb.scss.js +1 -1
  230. package/es-custom/components/button/button.d.ts +2 -2
  231. package/es-custom/components/button/button.d.ts.map +1 -1
  232. package/es-custom/components/button/button.js +2 -2
  233. package/es-custom/components/button/button.js.map +1 -1
  234. package/es-custom/components/button/button.scss.js +1 -1
  235. package/es-custom/components/button/button.scss.js.map +1 -1
  236. package/es-custom/components/chat-button/chat-button.scss.js +1 -1
  237. package/es-custom/components/chat-button/chat-button.scss.js.map +1 -1
  238. package/es-custom/components/checkbox/checkbox-group.d.ts +1 -1
  239. package/es-custom/components/checkbox/checkbox.d.ts +1 -1
  240. package/es-custom/components/checkbox/checkbox.scss.js +1 -1
  241. package/es-custom/components/code-snippet/code-snippet.d.ts +1 -1
  242. package/es-custom/components/code-snippet/code-snippet.scss.js +1 -1
  243. package/es-custom/components/combo-box/combo-box.scss.js +1 -1
  244. package/es-custom/components/combo-box/combo-box.scss.js.map +1 -1
  245. package/es-custom/components/combo-button/combo-button.scss.js +1 -1
  246. package/es-custom/components/contained-list/contained-list.scss.js +1 -1
  247. package/es-custom/components/contained-list/contained-list.scss.js.map +1 -1
  248. package/es-custom/components/content-switcher/content-switcher-item.d.ts +1 -1
  249. package/es-custom/components/content-switcher/content-switcher.scss.js +1 -1
  250. package/es-custom/components/copy-button/copy-button.scss.js +1 -1
  251. package/es-custom/components/copy-button/copy-button.scss.js.map +1 -1
  252. package/es-custom/components/data-table/data-table.scss.js +1 -1
  253. package/es-custom/components/data-table/table-header-cell.d.ts +1 -1
  254. package/es-custom/components/data-table/table-toolbar-search.d.ts +1 -1
  255. package/es-custom/components/date-picker/date-picker-input.d.ts +1 -1
  256. package/es-custom/components/date-picker/date-picker.scss.js +1 -1
  257. package/es-custom/components/dialog/dialog.scss.js +1 -1
  258. package/es-custom/components/dropdown/dropdown-item.d.ts +2 -1
  259. package/es-custom/components/dropdown/dropdown-item.d.ts.map +1 -1
  260. package/es-custom/components/dropdown/dropdown-item.js +4 -3
  261. package/es-custom/components/dropdown/dropdown-item.js.map +1 -1
  262. package/es-custom/components/dropdown/dropdown.d.ts +1 -1
  263. package/es-custom/components/dropdown/dropdown.scss.js +1 -1
  264. package/es-custom/components/feature-flags/index.d.ts +3 -0
  265. package/es-custom/components/feature-flags/index.d.ts.map +1 -1
  266. package/es-custom/components/feature-flags/index.js +33 -5
  267. package/es-custom/components/feature-flags/index.js.map +1 -1
  268. package/es-custom/components/file-uploader/file-uploader-button.d.ts +1 -0
  269. package/es-custom/components/file-uploader/file-uploader-button.d.ts.map +1 -1
  270. package/es-custom/components/file-uploader/file-uploader-button.js +10 -11
  271. package/es-custom/components/file-uploader/file-uploader-button.js.map +1 -1
  272. package/es-custom/components/file-uploader/file-uploader-drop-container.d.ts +1 -0
  273. package/es-custom/components/file-uploader/file-uploader-drop-container.d.ts.map +1 -1
  274. package/es-custom/components/file-uploader/file-uploader-drop-container.js +6 -5
  275. package/es-custom/components/file-uploader/file-uploader-drop-container.js.map +1 -1
  276. package/es-custom/components/file-uploader/file-uploader.scss.js +1 -1
  277. package/es-custom/components/file-uploader/file-uploader.scss.js.map +1 -1
  278. package/es-custom/components/floating-menu/floating-menu.d.ts +1 -1
  279. package/es-custom/components/floating-menu/floating-menu.js +1 -1
  280. package/es-custom/components/floating-menu/floating-menu.js.map +1 -1
  281. package/es-custom/components/fluid-combo-box/fluid-combo-box.scss.js +1 -1
  282. package/es-custom/components/fluid-combo-box/fluid-combo-box.scss.js.map +1 -1
  283. package/es-custom/components/fluid-dropdown/fluid-dropdown.scss.js +1 -1
  284. package/es-custom/components/fluid-dropdown/fluid-dropdown.scss.js.map +1 -1
  285. package/es-custom/components/fluid-multi-select/fluid-multi-select.scss.js +1 -1
  286. package/es-custom/components/fluid-multi-select/fluid-multi-select.scss.js.map +1 -1
  287. package/es-custom/components/fluid-number-input/fluid-number-input.scss.js +1 -1
  288. package/es-custom/components/fluid-number-input/fluid-number-input.scss.js.map +1 -1
  289. package/es-custom/components/fluid-password-input/fluid-password-input.scss.js +1 -1
  290. package/es-custom/components/fluid-password-input/fluid-password-input.scss.js.map +1 -1
  291. package/es-custom/components/fluid-search/fluid-search.scss.js +1 -1
  292. package/es-custom/components/fluid-search/fluid-search.scss.js.map +1 -1
  293. package/es-custom/components/fluid-select/fluid-select.scss.js +1 -1
  294. package/es-custom/components/fluid-select/fluid-select.scss.js.map +1 -1
  295. package/es-custom/components/fluid-text-input/fluid-text-input.scss.js +1 -1
  296. package/es-custom/components/fluid-text-input/fluid-text-input.scss.js.map +1 -1
  297. package/es-custom/components/fluid-textarea/fluid-textarea.scss.js +1 -1
  298. package/es-custom/components/fluid-textarea/fluid-textarea.scss.js.map +1 -1
  299. package/es-custom/components/fluid-time-picker/fluid-time-picker.scss.js +1 -1
  300. package/es-custom/components/fluid-time-picker/fluid-time-picker.scss.js.map +1 -1
  301. package/es-custom/components/icon-button/icon-button.d.ts +1 -1
  302. package/es-custom/components/icon-button/icon-button.d.ts.map +1 -1
  303. package/es-custom/components/icon-button/icon-button.js.map +1 -1
  304. package/es-custom/components/icon-button/icon-button.scss.js +1 -1
  305. package/es-custom/components/icon-button/icon-button.scss.js.map +1 -1
  306. package/es-custom/components/icon-indicator/icon-indicator.d.ts +20 -1
  307. package/es-custom/components/icon-indicator/icon-indicator.d.ts.map +1 -1
  308. package/es-custom/components/icon-indicator/icon-indicator.js +30 -2
  309. package/es-custom/components/icon-indicator/icon-indicator.js.map +1 -1
  310. package/es-custom/components/icon-indicator/icon-indicator.scss.js +1 -1
  311. package/es-custom/components/icon-indicator/icon-indicator.scss.js.map +1 -1
  312. package/es-custom/components/layout/layout.scss.js +1 -1
  313. package/es-custom/components/layout/layout.scss.js.map +1 -1
  314. package/es-custom/components/link/link.d.ts +1 -1
  315. package/es-custom/components/menu/menu-item-selectable.d.ts +1 -1
  316. package/es-custom/components/menu/menu-item.scss.js +1 -1
  317. package/es-custom/components/menu/menu-item.scss.js.map +1 -1
  318. package/es-custom/components/menu/menu.scss.js +1 -1
  319. package/es-custom/components/menu-button/menu-button.scss.js +1 -1
  320. package/es-custom/components/modal/modal-close-button.d.ts +1 -1
  321. package/es-custom/components/modal/modal.scss.js +1 -1
  322. package/es-custom/components/multi-select/multi-select.scss.js +1 -1
  323. package/es-custom/components/notification/actionable-notification.d.ts.map +1 -1
  324. package/es-custom/components/notification/actionable-notification.js +5 -2
  325. package/es-custom/components/notification/actionable-notification.js.map +1 -1
  326. package/es-custom/components/notification/actionable-notification.scss.js +1 -1
  327. package/es-custom/components/notification/actionable-notification.scss.js.map +1 -1
  328. package/es-custom/components/notification/inline-notification.scss.js +1 -1
  329. package/es-custom/components/notification/inline-notification.scss.js.map +1 -1
  330. package/es-custom/components/notification/toast-notification.scss.js +1 -1
  331. package/es-custom/components/notification/toast-notification.scss.js.map +1 -1
  332. package/es-custom/components/number-input/number-input.d.ts +1 -1
  333. package/es-custom/components/number-input/number-input.scss.js +1 -1
  334. package/es-custom/components/overflow-menu/overflow-menu-body.d.ts +1 -1
  335. package/es-custom/components/overflow-menu/overflow-menu-body.d.ts.map +1 -1
  336. package/es-custom/components/overflow-menu/overflow-menu-body.js +2 -2
  337. package/es-custom/components/overflow-menu/overflow-menu-body.js.map +1 -1
  338. package/es-custom/components/overflow-menu/overflow-menu-item.d.ts +1 -1
  339. package/es-custom/components/overflow-menu/overflow-menu.d.ts +8 -1
  340. package/es-custom/components/overflow-menu/overflow-menu.d.ts.map +1 -1
  341. package/es-custom/components/overflow-menu/overflow-menu.js +47 -3
  342. package/es-custom/components/overflow-menu/overflow-menu.js.map +1 -1
  343. package/es-custom/components/overflow-menu/overflow-menu.scss.js +1 -1
  344. package/es-custom/components/overflow-menu/overflow-menu.scss.js.map +1 -1
  345. package/es-custom/components/pagination/pagination.d.ts +1 -1
  346. package/es-custom/components/pagination/pagination.scss.js +1 -1
  347. package/es-custom/components/pagination/pagination.scss.js.map +1 -1
  348. package/es-custom/components/pagination-nav/pagination-nav.scss.js +1 -1
  349. package/es-custom/components/pagination-nav/pagination-nav.scss.js.map +1 -1
  350. package/es-custom/components/password-input/password-input.d.ts +1 -1
  351. package/es-custom/components/password-input/password-input.scss.js +1 -1
  352. package/es-custom/components/password-input/password-input.scss.js.map +1 -1
  353. package/es-custom/components/popover/popover.scss.js +1 -1
  354. package/es-custom/components/popover/popover.scss.js.map +1 -1
  355. package/es-custom/components/progress-bar/progress-bar.scss.js +1 -1
  356. package/es-custom/components/progress-indicator/progress-indicator.scss.js +1 -1
  357. package/es-custom/components/progress-indicator/progress-step.d.ts +1 -1
  358. package/es-custom/components/radio-button/radio-button.d.ts +1 -1
  359. package/es-custom/components/radio-button/radio-button.scss.js +1 -1
  360. package/es-custom/components/search/search.d.ts +9 -1
  361. package/es-custom/components/search/search.d.ts.map +1 -1
  362. package/es-custom/components/search/search.js +7 -6
  363. package/es-custom/components/search/search.js.map +1 -1
  364. package/es-custom/components/search/search.scss.js +1 -1
  365. package/es-custom/components/select/select.d.ts +1 -1
  366. package/es-custom/components/select/select.scss.js +1 -1
  367. package/es-custom/components/select/select.scss.js.map +1 -1
  368. package/es-custom/components/shape-indicator/shape-indicator.d.ts +20 -1
  369. package/es-custom/components/shape-indicator/shape-indicator.d.ts.map +1 -1
  370. package/es-custom/components/shape-indicator/shape-indicator.js +32 -4
  371. package/es-custom/components/shape-indicator/shape-indicator.js.map +1 -1
  372. package/es-custom/components/shape-indicator/shape-indicator.scss.js +1 -1
  373. package/es-custom/components/shape-indicator/shape-indicator.scss.js.map +1 -1
  374. package/es-custom/components/skip-to-content/skip-to-content.d.ts +1 -1
  375. package/es-custom/components/skip-to-content/skip-to-content.scss.js +1 -1
  376. package/es-custom/components/slider/slider-input.d.ts +2 -1
  377. package/es-custom/components/slider/slider-input.d.ts.map +1 -1
  378. package/es-custom/components/slider/slider-input.js +2 -1
  379. package/es-custom/components/slider/slider-input.js.map +1 -1
  380. package/es-custom/components/slider/slider.d.ts +2 -1
  381. package/es-custom/components/slider/slider.d.ts.map +1 -1
  382. package/es-custom/components/slider/slider.js +5 -5
  383. package/es-custom/components/slider/slider.js.map +1 -1
  384. package/es-custom/components/slider/slider.scss.js +1 -1
  385. package/es-custom/components/slider/slider.scss.js.map +1 -1
  386. package/es-custom/components/slug/slug.scss.js +1 -1
  387. package/es-custom/components/slug/slug.scss.js.map +1 -1
  388. package/es-custom/components/structured-list/structured-list.d.ts +1 -1
  389. package/es-custom/components/structured-list/structured-list.scss.js +1 -1
  390. package/es-custom/components/tabs/tabs-vertical.d.ts +4 -0
  391. package/es-custom/components/tabs/tabs-vertical.d.ts.map +1 -1
  392. package/es-custom/components/tabs/tabs-vertical.js +3 -2
  393. package/es-custom/components/tabs/tabs-vertical.js.map +1 -1
  394. package/es-custom/components/tabs/tabs.scss.js +1 -1
  395. package/es-custom/components/tabs/tabs.scss.js.map +1 -1
  396. package/es-custom/components/tag/operational-tag.d.ts +1 -1
  397. package/es-custom/components/tag/operational-tag.d.ts.map +1 -1
  398. package/es-custom/components/tag/operational-tag.js +3 -3
  399. package/es-custom/components/tag/operational-tag.js.map +1 -1
  400. package/es-custom/components/tag/selectable-tag.d.ts +1 -1
  401. package/es-custom/components/tag/selectable-tag.d.ts.map +1 -1
  402. package/es-custom/components/tag/selectable-tag.js +3 -3
  403. package/es-custom/components/tag/selectable-tag.js.map +1 -1
  404. package/es-custom/components/tag/tag.d.ts +1 -0
  405. package/es-custom/components/tag/tag.d.ts.map +1 -1
  406. package/es-custom/components/tag/tag.js +3 -3
  407. package/es-custom/components/tag/tag.js.map +1 -1
  408. package/es-custom/components/tag/tag.scss.js +1 -1
  409. package/es-custom/components/text-input/text-input.d.ts +1 -1
  410. package/es-custom/components/text-input/text-input.scss.js +1 -1
  411. package/es-custom/components/text-input/text-input.scss.js.map +1 -1
  412. package/es-custom/components/textarea/textarea.d.ts +1 -1
  413. package/es-custom/components/textarea/textarea.scss.js +1 -1
  414. package/es-custom/components/textarea/textarea.scss.js.map +1 -1
  415. package/es-custom/components/tile/selectable-tile.d.ts +1 -1
  416. package/es-custom/components/tile/tile.scss.js +1 -1
  417. package/es-custom/components/tile/tile.scss.js.map +1 -1
  418. package/es-custom/components/time-picker/time-picker-select.d.ts +1 -1
  419. package/es-custom/components/time-picker/time-picker.d.ts +1 -1
  420. package/es-custom/components/time-picker/time-picker.scss.js +1 -1
  421. package/es-custom/components/time-picker/time-picker.scss.js.map +1 -1
  422. package/es-custom/components/toggle-tip/toggletip.d.ts +13 -1
  423. package/es-custom/components/toggle-tip/toggletip.d.ts.map +1 -1
  424. package/es-custom/components/toggle-tip/toggletip.js +10 -14
  425. package/es-custom/components/toggle-tip/toggletip.js.map +1 -1
  426. package/es-custom/components/toggle-tip/toggletip.scss.js +1 -1
  427. package/es-custom/components/tooltip/definition-tooltip.d.ts +4 -2
  428. package/es-custom/components/tooltip/definition-tooltip.d.ts.map +1 -1
  429. package/es-custom/components/tooltip/definition-tooltip.js +23 -12
  430. package/es-custom/components/tooltip/definition-tooltip.js.map +1 -1
  431. package/es-custom/components/tooltip/tooltip.scss.js +1 -1
  432. package/es-custom/components/tooltip/tooltip.scss.js.map +1 -1
  433. package/es-custom/components/ui-shell/header-global-action.d.ts +2 -2
  434. package/es-custom/components/ui-shell/header-global-action.d.ts.map +1 -1
  435. package/es-custom/components/ui-shell/header-global-action.js +3 -3
  436. package/es-custom/components/ui-shell/header-global-action.js.map +1 -1
  437. package/es-custom/components/ui-shell/header-menu-button.d.ts +1 -1
  438. package/es-custom/components/ui-shell/header-menu.d.ts +1 -1
  439. package/es-custom/components/ui-shell/header-name.d.ts +1 -1
  440. package/es-custom/components/ui-shell/header-nav-item.d.ts +1 -1
  441. package/es-custom/components/ui-shell/header-panel.d.ts +1 -1
  442. package/es-custom/components/ui-shell/header.scss.js +1 -1
  443. package/es-custom/components/ui-shell/side-nav-link.d.ts +1 -1
  444. package/es-custom/components/ui-shell/side-nav-menu-item.d.ts +1 -1
  445. package/es-custom/components/ui-shell/side-nav-menu.d.ts +1 -1
  446. package/es-custom/components/ui-shell/switcher-item.d.ts +1 -1
  447. package/es-custom/components/ui-shell/switcher.d.ts +1 -1
  448. package/es-custom/packages/feature-flags/es/index.js +12 -0
  449. package/es-custom/packages/feature-flags/es/index.js.map +1 -1
  450. package/lib/components/button/button.d.ts +2 -2
  451. package/lib/components/button/button.d.ts.map +1 -1
  452. package/lib/components/checkbox/checkbox-group.d.ts +1 -1
  453. package/lib/components/checkbox/checkbox.d.ts +1 -1
  454. package/lib/components/code-snippet/code-snippet.d.ts +1 -1
  455. package/lib/components/content-switcher/content-switcher-item.d.ts +1 -1
  456. package/lib/components/data-table/table-header-cell.d.ts +1 -1
  457. package/lib/components/data-table/table-toolbar-search.d.ts +1 -1
  458. package/lib/components/date-picker/date-picker-input.d.ts +1 -1
  459. package/lib/components/dropdown/dropdown-item.d.ts +2 -1
  460. package/lib/components/dropdown/dropdown-item.d.ts.map +1 -1
  461. package/lib/components/dropdown/dropdown.d.ts +1 -1
  462. package/lib/components/feature-flags/index.d.ts +3 -0
  463. package/lib/components/feature-flags/index.d.ts.map +1 -1
  464. package/lib/components/file-uploader/file-uploader-button.d.ts +1 -0
  465. package/lib/components/file-uploader/file-uploader-button.d.ts.map +1 -1
  466. package/lib/components/file-uploader/file-uploader-drop-container.d.ts +1 -0
  467. package/lib/components/file-uploader/file-uploader-drop-container.d.ts.map +1 -1
  468. package/lib/components/floating-menu/floating-menu.d.ts +1 -1
  469. package/lib/components/icon-button/icon-button.d.ts +1 -1
  470. package/lib/components/icon-button/icon-button.d.ts.map +1 -1
  471. package/lib/components/icon-indicator/icon-indicator.d.ts +20 -1
  472. package/lib/components/icon-indicator/icon-indicator.d.ts.map +1 -1
  473. package/lib/components/link/link.d.ts +1 -1
  474. package/lib/components/menu/menu-item-selectable.d.ts +1 -1
  475. package/lib/components/modal/modal-close-button.d.ts +1 -1
  476. package/lib/components/notification/actionable-notification.d.ts.map +1 -1
  477. package/lib/components/number-input/number-input.d.ts +1 -1
  478. package/lib/components/overflow-menu/overflow-menu-body.d.ts +1 -1
  479. package/lib/components/overflow-menu/overflow-menu-body.d.ts.map +1 -1
  480. package/lib/components/overflow-menu/overflow-menu-item.d.ts +1 -1
  481. package/lib/components/overflow-menu/overflow-menu.d.ts +8 -1
  482. package/lib/components/overflow-menu/overflow-menu.d.ts.map +1 -1
  483. package/lib/components/pagination/pagination.d.ts +1 -1
  484. package/lib/components/password-input/password-input.d.ts +1 -1
  485. package/lib/components/progress-indicator/progress-step.d.ts +1 -1
  486. package/lib/components/radio-button/radio-button.d.ts +1 -1
  487. package/lib/components/search/search.d.ts +9 -1
  488. package/lib/components/search/search.d.ts.map +1 -1
  489. package/lib/components/select/select.d.ts +1 -1
  490. package/lib/components/shape-indicator/shape-indicator.d.ts +20 -1
  491. package/lib/components/shape-indicator/shape-indicator.d.ts.map +1 -1
  492. package/lib/components/skip-to-content/skip-to-content.d.ts +1 -1
  493. package/lib/components/slider/slider-input.d.ts +2 -1
  494. package/lib/components/slider/slider-input.d.ts.map +1 -1
  495. package/lib/components/slider/slider.d.ts +2 -1
  496. package/lib/components/slider/slider.d.ts.map +1 -1
  497. package/lib/components/structured-list/structured-list.d.ts +1 -1
  498. package/lib/components/tabs/tabs-vertical.d.ts +4 -0
  499. package/lib/components/tabs/tabs-vertical.d.ts.map +1 -1
  500. package/lib/components/tag/operational-tag.d.ts +1 -1
  501. package/lib/components/tag/operational-tag.d.ts.map +1 -1
  502. package/lib/components/tag/selectable-tag.d.ts +1 -1
  503. package/lib/components/tag/selectable-tag.d.ts.map +1 -1
  504. package/lib/components/tag/tag.d.ts +1 -0
  505. package/lib/components/tag/tag.d.ts.map +1 -1
  506. package/lib/components/text-input/text-input.d.ts +1 -1
  507. package/lib/components/textarea/textarea.d.ts +1 -1
  508. package/lib/components/tile/selectable-tile.d.ts +1 -1
  509. package/lib/components/time-picker/time-picker-select.d.ts +1 -1
  510. package/lib/components/time-picker/time-picker.d.ts +1 -1
  511. package/lib/components/toggle-tip/toggletip.d.ts +13 -1
  512. package/lib/components/toggle-tip/toggletip.d.ts.map +1 -1
  513. package/lib/components/tooltip/definition-tooltip.d.ts +4 -2
  514. package/lib/components/tooltip/definition-tooltip.d.ts.map +1 -1
  515. package/lib/components/ui-shell/header-global-action.d.ts +2 -2
  516. package/lib/components/ui-shell/header-global-action.d.ts.map +1 -1
  517. package/lib/components/ui-shell/header-menu-button.d.ts +1 -1
  518. package/lib/components/ui-shell/header-menu.d.ts +1 -1
  519. package/lib/components/ui-shell/header-name.d.ts +1 -1
  520. package/lib/components/ui-shell/header-nav-item.d.ts +1 -1
  521. package/lib/components/ui-shell/header-panel.d.ts +1 -1
  522. package/lib/components/ui-shell/side-nav-link.d.ts +1 -1
  523. package/lib/components/ui-shell/side-nav-menu-item.d.ts +1 -1
  524. package/lib/components/ui-shell/side-nav-menu.d.ts +1 -1
  525. package/lib/components/ui-shell/switcher-item.d.ts +1 -1
  526. package/lib/components/ui-shell/switcher.d.ts +1 -1
  527. package/package.json +13 -9
  528. package/scss/components/ai-label/ai-label.scss +1 -1
  529. package/scss/components/button/button.scss +2 -1
  530. package/scss/components/chat-button/chat-button.scss +1 -1
  531. package/scss/components/combo-box/combo-box.scss +1 -1
  532. package/scss/components/contained-list/contained-list.scss +4 -1
  533. package/scss/components/copy-button/copy-button.scss +1 -1
  534. package/scss/components/data-table/_table-action.scss +0 -1
  535. package/scss/components/file-uploader/file-uploader.scss +3 -1
  536. package/scss/components/fluid-combo-box/fluid-combo-box.scss +1 -1
  537. package/scss/components/fluid-dropdown/fluid-dropdown.scss +1 -1
  538. package/scss/components/fluid-multi-select/fluid-multi-select.scss +1 -1
  539. package/scss/components/fluid-number-input/fluid-number-input.scss +1 -1
  540. package/scss/components/fluid-password-input/fluid-password-input.scss +1 -1
  541. package/scss/components/fluid-search/fluid-search.scss +1 -1
  542. package/scss/components/fluid-select/fluid-select.scss +1 -1
  543. package/scss/components/fluid-text-input/fluid-text-input.scss +1 -1
  544. package/scss/components/fluid-textarea/fluid-textarea.scss +1 -1
  545. package/scss/components/fluid-time-picker/fluid-time-picker.scss +1 -1
  546. package/scss/components/icon-button/icon-button.scss +1 -1
  547. package/scss/components/icon-indicator/icon-indicator.scss +19 -1
  548. package/scss/components/layout/layout.scss +1 -1
  549. package/scss/components/menu/menu-item.scss +4 -0
  550. package/scss/components/notification/actionable-notification.scss +1 -1
  551. package/scss/components/notification/inline-notification.scss +1 -1
  552. package/scss/components/notification/toast-notification.scss +1 -1
  553. package/scss/components/overflow-menu/overflow-menu.scss +13 -39
  554. package/scss/components/pagination/pagination.scss +1 -1
  555. package/scss/components/pagination-nav/pagination-nav.scss +3 -1
  556. package/scss/components/password-input/password-input.scss +3 -1
  557. package/scss/components/popover/popover.scss +3 -1
  558. package/scss/components/select/select.scss +1 -1
  559. package/scss/components/shape-indicator/shape-indicator.scss +19 -1
  560. package/scss/components/slider/slider.scss +1 -1
  561. package/scss/components/slug/slug.scss +1 -1
  562. package/scss/components/tabs/tabs.scss +4 -1
  563. package/scss/components/text-input/text-input.scss +3 -1
  564. package/scss/components/textarea/textarea.scss +1 -1
  565. package/scss/components/tile/tile.scss +1 -1
  566. package/scss/components/time-picker/time-picker.scss +1 -1
  567. package/scss/components/tooltip/tooltip.scss +15 -2
  568. package/telemetry.yml +4 -234
@@ -1 +1 @@
1
- {"version":3,"file":"floating-menu.js","names":[],"sources":["../../../src/components/floating-menu/floating-menu.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2019, 2026\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { LitElement } from 'lit';\nimport HostListener from '../../globals/decorators/host-listener';\nimport FocusMixin from '../../globals/mixins/focus';\nimport HostListenerMixin from '../../globals/mixins/host-listener';\nimport Handle from '../../globals/internal/handle';\nimport {\n FLOATING_MENU_DIRECTION,\n FLOATING_MENU_POSITION_DIRECTION,\n} from './defs';\nimport CDSFloatingMenuTrigger from './floating-menu-trigger';\nimport { prefix } from '../../globals/settings';\n\nexport { FLOATING_MENU_DIRECTION, FLOATING_MENU_POSITION_DIRECTION };\n\nexport interface Offset {\n top: number;\n left: number;\n}\n\nexport type MenuDirection = FLOATING_MENU_DIRECTION;\n\nexport type MenuOffset =\n | Offset\n | ((\n menuBody: HTMLElement,\n menuDirection: MenuDirection,\n trigger?: HTMLElement | null,\n flipped?: boolean\n ) => Offset);\n\n/**\n * Calculates the offset for the floating menu.\n *\n * @param menuBody - The menu body element.\n * @param menuDirection - The floating menu direction.\n * @param trigger - The trigger element.\n * @param flipped - Whether the menu is flipped.\n * @returns The adjustment of the floating menu position.\n */\nexport const getMenuOffset = (\n menuBody: HTMLElement,\n menuDirection: MenuDirection,\n trigger?: HTMLElement,\n flipped?: boolean\n): Offset => {\n const { offsetWidth: menuWidth } = menuBody;\n\n switch (menuDirection) {\n case FLOATING_MENU_DIRECTION.TOP:\n case FLOATING_MENU_DIRECTION.BOTTOM: {\n const triggerWidth = !trigger ? 0 : trigger.offsetWidth;\n return {\n left: (!flipped ? 1 : -1) * (menuWidth / 2 - triggerWidth / 2),\n top: 0,\n };\n }\n default:\n return { left: 0, top: 0 };\n }\n};\n\n/**\n * Position of floating menu, or trigger button of floating menu.\n */\nexport interface FloatingMenuPosition {\n /**\n * The LTR/RTL direction used for positioning floating menu.\n */\n direction: FLOATING_MENU_POSITION_DIRECTION;\n\n /**\n * The start position (Left position for LTR, right position for RTL).\n */\n start: number;\n\n /**\n * The top position.\n */\n top: number;\n}\n\n/**\n * Observes resize of the given element with the given resize observer.\n *\n * @param observer The resize observer.\n * @param elem The element to observe the resize.\n */\nconst observeResize = (observer: ResizeObserver, elem: Element) => {\n observer.observe(elem);\n return {\n release() {\n observer.unobserve(elem);\n return null;\n },\n } as Handle;\n};\n\n/**\n * @param elem The starting element.\n * @param selector The CSS selector.\n * @returns {Element}\n * The closest ancestor node of the given element that matches the given selector, crossing Shadow DOM boundary.\n */\nconst closestComposed = (elem: Element, selector: string) => {\n const found = elem.closest(selector);\n if (found) {\n return found;\n }\n const { host } = elem.getRootNode() as ShadowRoot;\n if (host) {\n return closestComposed(host, selector);\n }\n return null;\n};\n\n/**\n * Floating menu.\n */\nabstract class CDSFloatingMenu extends HostListenerMixin(\n FocusMixin(LitElement)\n) {\n /**\n * The handle for observing resize of the element containing the trigger button.\n */\n private _hObserveResizeParent: Handle | null = null;\n\n /**\n * The handle for observing resize of the floating menu container.\n */\n private _hObserveResizeContainer: Handle | null = null;\n\n /**\n * The `ResizeObserver` instance for observing element resizes for re-positioning floating menu position.\n */\n // TODO: Wait for `.d.ts` update to support `ResizeObserver`\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452\n // @ts-ignore\n private _resizeObserver = new ResizeObserver(() => {\n const { container, open, parent, position } = this;\n if (container && open && parent) {\n const { top } = position;\n this.style.top = `${top}px`;\n }\n });\n\n @HostListener('focusout')\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n private _handleBlur = ({ relatedTarget }: FocusEvent) => {\n if (!this.contains(relatedTarget as Node)) {\n const { parent } = this;\n if (parent && parent !== relatedTarget) {\n parent.open = false;\n HTMLElement.prototype.focus.call(this.parent); // SVGElement in IE11 does not have `.focus()` method\n }\n }\n };\n\n @HostListener('click')\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n private _click = () => {\n const { parent } = this;\n if (parent) {\n parent.open = false;\n }\n };\n\n @HostListener('keydown')\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n private _handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Tab') {\n if (event.shiftKey) {\n const { parent } = this;\n if (parent) {\n parent.open = false;\n }\n }\n }\n };\n\n /**\n * The DOM element, typically a custom element in this library, launching this floating menu.\n */\n protected parent: CDSFloatingMenuTrigger | null = null;\n\n /**\n * The menu direction.\n */\n abstract direction: FLOATING_MENU_DIRECTION;\n\n /**\n * `true` if the menu should be open.\n */\n abstract open: boolean;\n\n /**\n * `true` if the menu alignment should be flipped.\n */\n abstract flipped: boolean;\n\n /**\n * Gets the menu offset configuration (object or function).\n * Subclasses override this to specify custom offset configs.\n *\n * @returns The menu offset configuration, or undefined for no offset.\n */\n protected getOffsetConfig(): MenuOffset | undefined {\n return undefined;\n }\n\n /**\n * Resolves the final menu offset by evaluating the offset configuration.\n * Handles both static offset objects and dynamic offset functions.\n *\n * @returns The resolved offset with left and top values.\n */\n protected resolveOffset(): Offset {\n const config = this.getOffsetConfig();\n\n if (!config) {\n return { left: 0, top: 0 };\n }\n\n if (typeof config === 'function') {\n const trigger = this.parent as HTMLElement;\n return config(this, this.direction, trigger, this.flipped);\n }\n\n return config;\n }\n\n /**\n * The DOM element to put this menu into.\n */\n get container() {\n return (\n closestComposed(\n this,\n (this.constructor as typeof CDSFloatingMenu).selectorContainer\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452\n ) || this.ownerDocument!.body\n );\n }\n\n /**\n * The position of this floating menu.\n */\n get position(): FloatingMenuPosition {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452\n const { triggerPosition } = this.parent!;\n if (!triggerPosition) {\n throw new TypeError('Missing information of trigger button position.');\n }\n\n const { container } = this;\n const {\n left: refLeft = 0,\n top: refTop = 0,\n right: refRight = 0,\n bottom: refBottom = 0,\n } = triggerPosition;\n const { width, height } = this.getBoundingClientRect();\n const containerRect = container.getBoundingClientRect();\n\n const containerComputedStyle =\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452\n container.ownerDocument!.defaultView!.getComputedStyle(container);\n const containerPosition =\n containerComputedStyle.getPropertyValue('position');\n const positionDirection = containerComputedStyle.getPropertyValue(\n 'direction'\n ) as FLOATING_MENU_POSITION_DIRECTION;\n\n const scrollX = globalThis.scrollX ?? 0;\n const scrollY = globalThis.scrollY ?? 0;\n const effectiveScrollX = containerPosition !== 'static' ? 0 : scrollX;\n const effectiveScrollY = containerPosition !== 'static' ? 0 : scrollY;\n\n const relativeDiff = {\n top: containerPosition !== 'static' ? containerRect.top : 0,\n left: containerPosition !== 'static' ? containerRect.left : 0,\n };\n\n const refCenterHorizontal = (refLeft + refRight) / 2;\n const refCenterVertical = (refTop + refBottom) / 2;\n\n const offset = this.resolveOffset();\n const { top = 0, left = 0 } = offset;\n\n const { direction } = this;\n if (Object.values(FLOATING_MENU_DIRECTION).indexOf(direction) < 0) {\n throw new Error(`Wrong menu position direction: ${direction}`);\n }\n\n const positions: Record<MenuDirection, () => Offset> = {\n [FLOATING_MENU_DIRECTION.LEFT]: () => ({\n left: refLeft - width + effectiveScrollX - left - relativeDiff.left,\n top:\n refCenterVertical -\n height / 2 +\n effectiveScrollY +\n top -\n 9 -\n relativeDiff.top,\n }),\n [FLOATING_MENU_DIRECTION.TOP]: () => ({\n left:\n refCenterHorizontal -\n width / 2 +\n effectiveScrollX +\n left -\n relativeDiff.left,\n top: refTop - height + effectiveScrollY - top - relativeDiff.top,\n }),\n [FLOATING_MENU_DIRECTION.RIGHT]: () => ({\n left: refRight + effectiveScrollX + left - relativeDiff.left,\n top:\n refCenterVertical -\n height / 2 +\n effectiveScrollY +\n top +\n 3 -\n relativeDiff.top,\n }),\n [FLOATING_MENU_DIRECTION.BOTTOM]: () => ({\n left:\n refCenterHorizontal -\n width / 2 +\n effectiveScrollX +\n left -\n relativeDiff.left,\n top: refBottom + effectiveScrollY + top - relativeDiff.top,\n }),\n };\n\n const { left: calculatedLeft, top: calculatedTop } = positions[direction]();\n\n return {\n direction: positionDirection,\n start: calculatedLeft,\n top: calculatedTop,\n };\n }\n\n disconnectedCallback() {\n if (this._hObserveResizeContainer) {\n this._hObserveResizeContainer = this._hObserveResizeContainer.release();\n }\n if (this._hObserveResizeParent) {\n this._hObserveResizeParent = this._hObserveResizeParent.release();\n }\n }\n\n updated(changedProperties) {\n const { container, open, parent } = this;\n if (\n (changedProperties.has('flipped') ||\n changedProperties.has('direction') ||\n changedProperties.has('open')) &&\n open\n ) {\n if (!parent) {\n this.parent = this.parentElement as CDSFloatingMenuTrigger;\n container.appendChild(this);\n }\n // Note: `this.position` cannot be referenced until `this.parent` is set\n const { start, top } = this.position;\n this.style.left = `${start}px`;\n this.style.right = 'auto';\n this.style.top = `${top}px`;\n }\n if (changedProperties.has('open')) {\n if (this._hObserveResizeContainer) {\n this._hObserveResizeContainer = this._hObserveResizeContainer.release();\n }\n if (this._hObserveResizeParent) {\n this._hObserveResizeParent = this._hObserveResizeParent.release();\n }\n if (open) {\n const { parentElement } = this.parent ?? {};\n this._hObserveResizeContainer = observeResize(\n this._resizeObserver,\n container\n );\n if (parentElement) {\n this._hObserveResizeParent = observeResize(\n this._resizeObserver,\n parentElement\n );\n }\n }\n }\n }\n\n /**\n * A constant indicating that this class is a floating menu.\n */\n static FLOATING_MENU = true;\n\n /**\n * The CSS selector to find the element to put this floating menu in.\n */\n static get selectorContainer() {\n return `[data-floating-menu-container],${prefix}-modal`;\n }\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n}\n\nexport default CDSFloatingMenu;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CA,MAAa,iBACX,UACA,eACA,SACA,YACW;CACX,MAAM,EAAE,aAAa,cAAc;CAEnC,QAAQ,eAAR;EACE,KAAA;EACA,KAAA,UAAqC;GACnC,MAAM,eAAe,CAAC,UAAU,IAAI,QAAQ;GAC5C,OAAO;IACL,OAAO,CAAC,UAAU,IAAI,OAAO,YAAY,IAAI,eAAe;IAC5D,KAAK;GACP;EACF;EACA,SACE,OAAO;GAAE,MAAM;GAAG,KAAK;EAAE;CAC7B;AACF;;;;;;;AA4BA,MAAM,iBAAiB,UAA0B,SAAkB;CACjE,SAAS,QAAQ,IAAI;CACrB,OAAO,EACL,UAAU;EACR,SAAS,UAAU,IAAI;EACvB,OAAO;CACT,EACF;AACF;;;;;;;AAQA,MAAM,mBAAmB,MAAe,aAAqB;CAC3D,MAAM,QAAQ,KAAK,QAAQ,QAAQ;CACnC,IAAI,OACF,OAAO;CAET,MAAM,EAAE,SAAS,KAAK,YAAY;CAClC,IAAI,MACF,OAAO,gBAAgB,MAAM,QAAQ;CAEvC,OAAO;AACT;;;;AA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../../src/components/floating-menu/floating-menu.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2019, 2026\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { LitElement } from 'lit';\nimport HostListener from '../../globals/decorators/host-listener';\nimport FocusMixin from '../../globals/mixins/focus';\nimport HostListenerMixin from '../../globals/mixins/host-listener';\nimport Handle from '../../globals/internal/handle';\nimport {\n FLOATING_MENU_DIRECTION,\n FLOATING_MENU_POSITION_DIRECTION,\n} from './defs';\nimport CDSFloatingMenuTrigger from './floating-menu-trigger';\nimport { prefix } from '../../globals/settings';\n\nexport { FLOATING_MENU_DIRECTION, FLOATING_MENU_POSITION_DIRECTION };\n\nexport interface Offset {\n top: number;\n left: number;\n}\n\nexport type MenuDirection = FLOATING_MENU_DIRECTION;\n\nexport type MenuOffset =\n | Offset\n | ((\n menuBody: HTMLElement,\n menuDirection: MenuDirection,\n trigger?: HTMLElement | null,\n flipped?: boolean\n ) => Offset);\n\n/**\n * Calculates the offset for the floating menu.\n *\n * @param menuBody - The menu body element.\n * @param menuDirection - The floating menu direction.\n * @param trigger - The trigger element.\n * @param flipped - Whether the menu is flipped.\n * @returns The adjustment of the floating menu position.\n */\nexport const getMenuOffset = (\n menuBody: HTMLElement,\n menuDirection: MenuDirection,\n trigger?: HTMLElement,\n flipped?: boolean\n): Offset => {\n const { offsetWidth: menuWidth } = menuBody;\n\n switch (menuDirection) {\n case FLOATING_MENU_DIRECTION.TOP:\n case FLOATING_MENU_DIRECTION.BOTTOM: {\n const triggerWidth = !trigger ? 0 : trigger.offsetWidth;\n return {\n left: (!flipped ? 1 : -1) * (menuWidth / 2 - triggerWidth / 2),\n top: 0,\n };\n }\n default:\n return { left: 0, top: 0 };\n }\n};\n\n/**\n * Position of floating menu, or trigger button of floating menu.\n */\nexport interface FloatingMenuPosition {\n /**\n * The LTR/RTL direction used for positioning floating menu.\n */\n direction: FLOATING_MENU_POSITION_DIRECTION;\n\n /**\n * The start position (Left position for LTR, right position for RTL).\n */\n start: number;\n\n /**\n * The top position.\n */\n top: number;\n}\n\n/**\n * Observes resize of the given element with the given resize observer.\n *\n * @param observer The resize observer.\n * @param elem The element to observe the resize.\n */\nconst observeResize = (observer: ResizeObserver, elem: Element) => {\n observer.observe(elem);\n return {\n release() {\n observer.unobserve(elem);\n return null;\n },\n } as Handle;\n};\n\n/**\n * @param elem The starting element.\n * @param selector The CSS selector.\n * @returns {Element}\n * The closest ancestor node of the given element that matches the given selector, crossing Shadow DOM boundary.\n */\nconst closestComposed = (elem: Element, selector: string) => {\n const found = elem.closest(selector);\n if (found) {\n return found;\n }\n const { host } = elem.getRootNode() as ShadowRoot;\n if (host) {\n return closestComposed(host, selector);\n }\n return null;\n};\n\n/**\n * Floating menu.\n */\nabstract class CDSFloatingMenu extends HostListenerMixin(\n FocusMixin(LitElement)\n) {\n /**\n * The handle for observing resize of the element containing the trigger button.\n */\n private _hObserveResizeParent: Handle | null = null;\n\n /**\n * The handle for observing resize of the floating menu container.\n */\n private _hObserveResizeContainer: Handle | null = null;\n\n /**\n * The `ResizeObserver` instance for observing element resizes for re-positioning floating menu position.\n */\n // TODO: Wait for `.d.ts` update to support `ResizeObserver`\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452\n // @ts-ignore\n private _resizeObserver = new ResizeObserver(() => {\n const { container, open, parent, position } = this;\n if (container && open && parent) {\n const { top } = position;\n this.style.top = `${top}px`;\n }\n });\n\n @HostListener('focusout')\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n private _handleBlur = ({ relatedTarget }: FocusEvent) => {\n if (!this.contains(relatedTarget as Node)) {\n const { parent } = this;\n if (parent && parent !== relatedTarget) {\n parent.open = false;\n HTMLElement.prototype.focus.call(this.parent); // SVGElement in IE11 does not have `.focus()` method\n }\n }\n };\n\n @HostListener('click')\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n private _click = () => {\n const { parent } = this;\n if (parent) {\n parent.open = false;\n }\n };\n\n @HostListener('keydown')\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452\n // @ts-ignore: The decorator refers to this method but TS thinks this method is not referred to\n private _handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Tab') {\n if (event.shiftKey) {\n const { parent } = this;\n if (parent) {\n parent.open = false;\n }\n }\n }\n };\n\n /**\n * The DOM element, typically a custom element in this library, launching this floating menu.\n */\n protected parent: CDSFloatingMenuTrigger | null = null;\n\n /**\n * The menu direction.\n */\n abstract direction: FLOATING_MENU_DIRECTION;\n\n /**\n * `true` if the menu should be open.\n */\n abstract open: boolean;\n\n /**\n * `true` if the menu alignment should be flipped.\n */\n abstract flipped: boolean;\n\n /**\n * Gets the menu offset configuration (object or function).\n * Subclasses override this to specify custom offset configs.\n *\n * @returns The menu offset configuration, or undefined for no offset.\n */\n protected getOffsetConfig(): MenuOffset | undefined {\n return undefined;\n }\n\n /**\n * Resolves the final menu offset by evaluating the offset configuration.\n * Handles both static offset objects and dynamic offset functions.\n *\n * @returns The resolved offset with left and top values.\n */\n protected resolveOffset(): Offset {\n const config = this.getOffsetConfig();\n\n if (!config) {\n return { left: 0, top: 0 };\n }\n\n if (typeof config === 'function') {\n const trigger = this.parent as HTMLElement;\n return config(this, this.direction, trigger, this.flipped);\n }\n\n return config;\n }\n\n /**\n * The DOM element to put this menu into.\n */\n get container() {\n return (\n closestComposed(\n this,\n (this.constructor as typeof CDSFloatingMenu).selectorContainer\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452\n ) || this.ownerDocument!.body\n );\n }\n\n /**\n * The position of this floating menu.\n */\n get position(): FloatingMenuPosition {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452\n const { triggerPosition } = this.parent!;\n if (!triggerPosition) {\n throw new TypeError('Missing information of trigger button position.');\n }\n\n const { container } = this;\n const {\n left: refLeft = 0,\n top: refTop = 0,\n right: refRight = 0,\n bottom: refBottom = 0,\n } = triggerPosition;\n const { width, height } = this.getBoundingClientRect();\n const containerRect = container.getBoundingClientRect();\n\n const containerComputedStyle =\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452\n container.ownerDocument!.defaultView!.getComputedStyle(container);\n const containerPosition =\n containerComputedStyle.getPropertyValue('position');\n const positionDirection = containerComputedStyle.getPropertyValue(\n 'direction'\n ) as FLOATING_MENU_POSITION_DIRECTION;\n\n const scrollX = globalThis.scrollX ?? 0;\n const scrollY = globalThis.scrollY ?? 0;\n const effectiveScrollX = containerPosition !== 'static' ? 0 : scrollX;\n const effectiveScrollY = containerPosition !== 'static' ? 0 : scrollY;\n\n const relativeDiff = {\n top: containerPosition !== 'static' ? containerRect.top : 0,\n left: containerPosition !== 'static' ? containerRect.left : 0,\n };\n\n const refCenterHorizontal = (refLeft + refRight) / 2;\n const refCenterVertical = (refTop + refBottom) / 2;\n\n const offset = this.resolveOffset();\n const { top = 0, left = 0 } = offset;\n\n const { direction } = this;\n if (Object.values(FLOATING_MENU_DIRECTION).indexOf(direction) < 0) {\n throw new Error(`Wrong menu position direction: ${direction}`);\n }\n\n const positions: Record<MenuDirection, () => Offset> = {\n [FLOATING_MENU_DIRECTION.LEFT]: () => ({\n left: refLeft - width + effectiveScrollX - left - relativeDiff.left,\n top:\n refCenterVertical -\n height / 2 +\n effectiveScrollY +\n top -\n 9 -\n relativeDiff.top,\n }),\n [FLOATING_MENU_DIRECTION.TOP]: () => ({\n left:\n refCenterHorizontal -\n width / 2 +\n effectiveScrollX +\n left -\n relativeDiff.left,\n top: refTop - height + effectiveScrollY - top - relativeDiff.top,\n }),\n [FLOATING_MENU_DIRECTION.RIGHT]: () => ({\n left: refRight + effectiveScrollX + left - relativeDiff.left,\n top:\n refCenterVertical -\n height / 2 +\n effectiveScrollY +\n top +\n 3 -\n relativeDiff.top,\n }),\n [FLOATING_MENU_DIRECTION.BOTTOM]: () => ({\n left:\n refCenterHorizontal -\n width / 2 +\n effectiveScrollX +\n left -\n relativeDiff.left,\n top: refBottom + effectiveScrollY + top - relativeDiff.top,\n }),\n };\n\n const { left: calculatedLeft, top: calculatedTop } = positions[direction]();\n\n return {\n direction: positionDirection,\n start: calculatedLeft,\n top: calculatedTop,\n };\n }\n\n disconnectedCallback() {\n if (this._hObserveResizeContainer) {\n this._hObserveResizeContainer = this._hObserveResizeContainer.release();\n }\n if (this._hObserveResizeParent) {\n this._hObserveResizeParent = this._hObserveResizeParent.release();\n }\n }\n\n updated(changedProperties) {\n const { container, open, parent } = this;\n if (\n (changedProperties.has('flipped') ||\n changedProperties.has('direction') ||\n changedProperties.has('open')) &&\n open\n ) {\n if (!parent) {\n this.parent = this.parentElement as CDSFloatingMenuTrigger;\n container.appendChild(this);\n }\n // Note: `this.position` cannot be referenced until `this.parent` is set\n const { start, top } = this.position;\n this.style.left = `${start}px`;\n this.style.right = 'auto';\n this.style.top = `${top}px`;\n }\n if (changedProperties.has('open')) {\n if (this._hObserveResizeContainer) {\n this._hObserveResizeContainer = this._hObserveResizeContainer.release();\n }\n if (this._hObserveResizeParent) {\n this._hObserveResizeParent = this._hObserveResizeParent.release();\n }\n if (open) {\n const { parentElement } = this.parent ?? {};\n this._hObserveResizeContainer = observeResize(\n this._resizeObserver,\n container\n );\n if (parentElement) {\n this._hObserveResizeParent = observeResize(\n this._resizeObserver,\n parentElement\n );\n }\n }\n }\n }\n\n /**\n * A constant indicating that this class is a floating menu.\n */\n static FLOATING_MENU = true;\n\n /**\n * The CSS selector to find the element to put this floating menu in.\n */\n static get selectorContainer() {\n return `[data-floating-menu-container],${prefix}-layout,${prefix}-modal`;\n }\n static shadowRoot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