@carbon/web-components 2.59.0 → 2.60.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 (584) hide show
  1. package/custom-elements.json +54 -1
  2. package/es/_virtual/{_@oxc-project_runtime@0.135.0 → _@oxc-project_runtime@0.139.0}/helpers/esm/decorate.js +2 -2
  3. package/es/components/accordion/accordion-item-skeleton.js +1 -1
  4. package/es/components/accordion/accordion-item.d.ts +4 -1
  5. package/es/components/accordion/accordion-item.d.ts.map +1 -1
  6. package/es/components/accordion/accordion-item.js +4 -7
  7. package/es/components/accordion/accordion-item.js.map +1 -1
  8. package/es/components/accordion/accordion-skeleton.d.ts +4 -1
  9. package/es/components/accordion/accordion-skeleton.d.ts.map +1 -1
  10. package/es/components/accordion/accordion-skeleton.js +5 -7
  11. package/es/components/accordion/accordion-skeleton.js.map +1 -1
  12. package/es/components/accordion/accordion.js +1 -1
  13. package/es/components/ai-label/ai-label-action-button.js +1 -1
  14. package/es/components/ai-label/ai-label.js +1 -1
  15. package/es/components/ai-label/ai-label.scss.js +1 -1
  16. package/es/components/ai-label/ai-label.scss.js.map +1 -1
  17. package/es/components/ai-skeleton/ai-skeleton-icon.js +1 -1
  18. package/es/components/ai-skeleton/ai-skeleton-placeholder.js +1 -1
  19. package/es/components/ai-skeleton/ai-skeleton-text.js +1 -1
  20. package/es/components/badge-indicator/badge-indicator.js +1 -1
  21. package/es/components/breadcrumb/breadcrumb-item.js +1 -1
  22. package/es/components/breadcrumb/breadcrumb-link.js +1 -1
  23. package/es/components/breadcrumb/breadcrumb-overflow-menu.js +1 -1
  24. package/es/components/breadcrumb/breadcrumb-skeleton.js +1 -1
  25. package/es/components/breadcrumb/breadcrumb.js +1 -1
  26. package/es/components/button/button-set-base.js +1 -1
  27. package/es/components/button/button-set.js +1 -1
  28. package/es/components/button/button-skeleton.js +3 -3
  29. package/es/components/button/button-skeleton.js.map +1 -1
  30. package/es/components/button/button.js +1 -1
  31. package/es/components/button/button.scss.js +1 -1
  32. package/es/components/chat-button/chat-button-skeleton.js +1 -1
  33. package/es/components/chat-button/chat-button.js +1 -1
  34. package/es/components/checkbox/checkbox-group.js +1 -1
  35. package/es/components/checkbox/checkbox-skeleton.js +1 -1
  36. package/es/components/checkbox/checkbox.js +1 -1
  37. package/es/components/code-snippet/code-snippet-skeleton.js +1 -1
  38. package/es/components/code-snippet/code-snippet.d.ts +11 -0
  39. package/es/components/code-snippet/code-snippet.d.ts.map +1 -1
  40. package/es/components/code-snippet/code-snippet.js +30 -20
  41. package/es/components/code-snippet/code-snippet.js.map +1 -1
  42. package/es/components/code-snippet/code-snippet.scss.js +1 -1
  43. package/es/components/combo-box/combo-box-item.js +1 -1
  44. package/es/components/combo-box/combo-box.d.ts.map +1 -1
  45. package/es/components/combo-box/combo-box.js +16 -12
  46. package/es/components/combo-box/combo-box.js.map +1 -1
  47. package/es/components/combo-button/combo-button.js +1 -1
  48. package/es/components/contained-list/contained-list-description.js +1 -1
  49. package/es/components/contained-list/contained-list-item.js +1 -1
  50. package/es/components/contained-list/contained-list.js +1 -1
  51. package/es/components/content-switcher/content-switcher-item.d.ts +4 -0
  52. package/es/components/content-switcher/content-switcher-item.d.ts.map +1 -1
  53. package/es/components/content-switcher/content-switcher-item.js +4 -3
  54. package/es/components/content-switcher/content-switcher-item.js.map +1 -1
  55. package/es/components/content-switcher/content-switcher.js +1 -1
  56. package/es/components/content-switcher/content-switcher.scss.js +1 -1
  57. package/es/components/content-switcher/content-switcher.scss.js.map +1 -1
  58. package/es/components/copy/copy.js +1 -1
  59. package/es/components/copy-button/copy-button.js +1 -1
  60. package/es/components/copy-button/copy-button.scss.js +1 -1
  61. package/es/components/data-table/table-batch-actions.js +1 -1
  62. package/es/components/data-table/table-body.js +1 -1
  63. package/es/components/data-table/table-cell-content.js +1 -1
  64. package/es/components/data-table/table-cell.js +1 -1
  65. package/es/components/data-table/table-expanded-row.js +1 -1
  66. package/es/components/data-table/table-head.js +1 -1
  67. package/es/components/data-table/table-header-cell.js +1 -1
  68. package/es/components/data-table/table-header-description.js +1 -1
  69. package/es/components/data-table/table-header-row.js +1 -1
  70. package/es/components/data-table/table-header-title.js +1 -1
  71. package/es/components/data-table/table-row.js +1 -1
  72. package/es/components/data-table/table-skeleton.js +1 -1
  73. package/es/components/data-table/table-toolbar-content.js +1 -1
  74. package/es/components/data-table/table-toolbar-search.js +1 -1
  75. package/es/components/data-table/table-toolbar.js +1 -1
  76. package/es/components/data-table/table.js +1 -1
  77. package/es/components/date-picker/date-picker-input-skeleton.js +1 -1
  78. package/es/components/date-picker/date-picker-input.js +1 -1
  79. package/es/components/date-picker/date-picker.js +1 -1
  80. package/es/components/dialog/dialog-body.js +1 -1
  81. package/es/components/dialog/dialog-close-button.js +1 -1
  82. package/es/components/dialog/dialog-controls.js +1 -1
  83. package/es/components/dialog/dialog-footer-button.js +1 -1
  84. package/es/components/dialog/dialog-footer.js +1 -1
  85. package/es/components/dialog/dialog-header.js +1 -1
  86. package/es/components/dialog/dialog-subtitle.js +1 -1
  87. package/es/components/dialog/dialog-title.js +1 -1
  88. package/es/components/dialog/dialog.js +1 -1
  89. package/es/components/dropdown/dropdown-item.js +1 -1
  90. package/es/components/dropdown/dropdown-skeleton.js +1 -1
  91. package/es/components/dropdown/dropdown.js +2 -2
  92. package/es/components/dropdown/dropdown.js.map +1 -1
  93. package/es/components/feature-flags/index.d.ts +39 -4
  94. package/es/components/feature-flags/index.d.ts.map +1 -1
  95. package/es/components/feature-flags/index.js +44 -7
  96. package/es/components/feature-flags/index.js.map +1 -1
  97. package/es/components/file-uploader/demo-file-uploader.js +1 -1
  98. package/es/components/file-uploader/file-uploader-button.js +1 -1
  99. package/es/components/file-uploader/file-uploader-drop-container.js +1 -1
  100. package/es/components/file-uploader/file-uploader-item.js +1 -1
  101. package/es/components/file-uploader/file-uploader-skeleton.js +1 -1
  102. package/es/components/file-uploader/file-uploader.js +1 -1
  103. package/es/components/floating-menu/floating-menu.js +1 -1
  104. package/es/components/fluid-combo-box/fluid-combo-box-skeleton.js +1 -1
  105. package/es/components/fluid-combo-box/fluid-combo-box.js +1 -1
  106. package/es/components/fluid-dropdown/fluid-dropdown-skeleton.js +1 -1
  107. package/es/components/fluid-dropdown/fluid-dropdown.js +1 -1
  108. package/es/components/fluid-form/fluid-form.js +1 -1
  109. package/es/components/fluid-multi-select/fluid-multi-select-skeleton.js +1 -1
  110. package/es/components/fluid-multi-select/fluid-multi-select.js +1 -1
  111. package/es/components/fluid-number-input/fluid-number-input-skeleton.js +1 -1
  112. package/es/components/fluid-number-input/fluid-number-input.js +1 -1
  113. package/es/components/fluid-password-input/fluid-password-input.js +1 -1
  114. package/es/components/fluid-search/fluid-search-skeleton.js +1 -1
  115. package/es/components/fluid-search/fluid-search.js +1 -1
  116. package/es/components/fluid-select/fluid-select-skeleton.js +1 -1
  117. package/es/components/fluid-select/fluid-select.js +1 -1
  118. package/es/components/fluid-text-input/fluid-text-input-skeleton.js +1 -1
  119. package/es/components/fluid-text-input/fluid-text-input.js +1 -1
  120. package/es/components/fluid-textarea/fluid-textarea-skeleton.js +1 -1
  121. package/es/components/fluid-textarea/fluid-textarea.js +1 -1
  122. package/es/components/fluid-time-picker/fluid-time-picker-select.js +1 -1
  123. package/es/components/fluid-time-picker/fluid-time-picker-skeleton.js +1 -1
  124. package/es/components/fluid-time-picker/fluid-time-picker.js +1 -1
  125. package/es/components/form/form-item.js +1 -1
  126. package/es/components/form/form.js +1 -1
  127. package/es/components/form-group/form-group.js +1 -1
  128. package/es/components/grid/column-hang.js +1 -1
  129. package/es/components/grid/column.js +1 -1
  130. package/es/components/grid/grid.js +1 -1
  131. package/es/components/heading/heading.js +1 -1
  132. package/es/components/icon/icon.js +1 -1
  133. package/es/components/icon-button/icon-button.js +1 -1
  134. package/es/components/icon-indicator/icon-indicator.js +1 -1
  135. package/es/components/inline-loading/inline-loading.js +1 -1
  136. package/es/components/layer/layer.js +1 -1
  137. package/es/components/layout/layout-constraint.js +1 -1
  138. package/es/components/layout/layout.js +1 -1
  139. package/es/components/link/link.js +1 -1
  140. package/es/components/list/list-item.js +1 -1
  141. package/es/components/list/ordered-list.js +1 -1
  142. package/es/components/list/unordered-list.js +1 -1
  143. package/es/components/loading/loading.js +1 -1
  144. package/es/components/menu/menu-item-divider.js +1 -1
  145. package/es/components/menu/menu-item-group.js +1 -1
  146. package/es/components/menu/menu-item-radio-group.js +1 -1
  147. package/es/components/menu/menu-item-selectable.js +1 -1
  148. package/es/components/menu/menu-item.js +1 -1
  149. package/es/components/menu/menu.js +1 -1
  150. package/es/components/menu-button/menu-button.js +1 -1
  151. package/es/components/modal/modal-base.js +1 -1
  152. package/es/components/modal/modal-body-content.js +1 -1
  153. package/es/components/modal/modal-body.js +1 -1
  154. package/es/components/modal/modal-close-button.js +1 -1
  155. package/es/components/modal/modal-footer-button.js +1 -1
  156. package/es/components/modal/modal-footer.js +1 -1
  157. package/es/components/modal/modal-header.js +1 -1
  158. package/es/components/modal/modal-heading.js +1 -1
  159. package/es/components/modal/modal-label.js +1 -1
  160. package/es/components/modal/modal.js +1 -1
  161. package/es/components/multi-select/multi-select-item.js +1 -1
  162. package/es/components/multi-select/multi-select.js +1 -1
  163. package/es/components/notification/actionable-notification-button.js +1 -1
  164. package/es/components/notification/actionable-notification.js +1 -1
  165. package/es/components/notification/actionable-notification.scss.js +1 -1
  166. package/es/components/notification/actionable-notification.scss.js.map +1 -1
  167. package/es/components/notification/callout-notification.js +1 -1
  168. package/es/components/notification/inline-notification.js +2 -2
  169. package/es/components/notification/inline-notification.js.map +1 -1
  170. package/es/components/notification/inline-notification.scss.js +1 -1
  171. package/es/components/notification/toast-notification.js +1 -1
  172. package/es/components/notification/toast-notification.scss.js +1 -1
  173. package/es/components/number-input/number-input-skeleton.js +1 -1
  174. package/es/components/number-input/number-input.js +1 -1
  175. package/es/components/overflow-menu/overflow-menu-body.js +1 -1
  176. package/es/components/overflow-menu/overflow-menu-item.js +1 -1
  177. package/es/components/overflow-menu/overflow-menu.js +2 -2
  178. package/es/components/overflow-menu/overflow-menu.js.map +1 -1
  179. package/es/components/page-header/page-header-breadcrumb.js +1 -1
  180. package/es/components/page-header/page-header-content-text.js +1 -1
  181. package/es/components/page-header/page-header-content.js +1 -1
  182. package/es/components/page-header/page-header-hero-image.js +1 -1
  183. package/es/components/page-header/page-header-tabs.js +1 -1
  184. package/es/components/page-header/page-header.js +1 -1
  185. package/es/components/pagination/pagination.js +1 -1
  186. package/es/components/pagination-nav/pagination-nav.js +1 -1
  187. package/es/components/password-input/password-input-skeleton.js +1 -1
  188. package/es/components/password-input/password-input.js +1 -1
  189. package/es/components/popover/popover-content.js +1 -1
  190. package/es/components/popover/popover.d.ts.map +1 -1
  191. package/es/components/popover/popover.js +20 -1
  192. package/es/components/popover/popover.js.map +1 -1
  193. package/es/components/progress-bar/progress-bar.js +1 -1
  194. package/es/components/progress-indicator/progress-indicator-skeleton.js +1 -1
  195. package/es/components/progress-indicator/progress-indicator.js +1 -1
  196. package/es/components/progress-indicator/progress-indicator.scss.js +1 -1
  197. package/es/components/progress-indicator/progress-step-skeleton.js +1 -1
  198. package/es/components/progress-indicator/progress-step.js +1 -1
  199. package/es/components/radio-button/radio-button-group.js +1 -1
  200. package/es/components/radio-button/radio-button-skeleton.js +1 -1
  201. package/es/components/radio-button/radio-button.js +1 -1
  202. package/es/components/search/search-skeleton.js +1 -1
  203. package/es/components/search/search.js +1 -1
  204. package/es/components/select/select-item-group.js +1 -1
  205. package/es/components/select/select-item.js +1 -1
  206. package/es/components/select/select-skeleton.js +1 -1
  207. package/es/components/select/select.js +1 -1
  208. package/es/components/shape-indicator/shape-indicator.js +1 -1
  209. package/es/components/side-panel/side-panel.js +5 -3
  210. package/es/components/side-panel/side-panel.js.map +1 -1
  211. package/es/components/skeleton-icon/skeleton-icon.js +1 -1
  212. package/es/components/skeleton-placeholder/skeleton-placeholder.js +1 -1
  213. package/es/components/skeleton-text/skeleton-text.js +1 -1
  214. package/es/components/skip-to-content/skip-to-content.js +1 -1
  215. package/es/components/slider/slider-input.js +1 -1
  216. package/es/components/slider/slider-skeleton.js +1 -1
  217. package/es/components/slider/slider.js +1 -1
  218. package/es/components/slug/slug-action-button.js +1 -1
  219. package/es/components/slug/slug.js +1 -1
  220. package/es/components/slug/slug.scss.js +1 -1
  221. package/es/components/stack/stack.js +1 -1
  222. package/es/components/structured-list/structured-list-body.js +1 -1
  223. package/es/components/structured-list/structured-list-cell.js +1 -1
  224. package/es/components/structured-list/structured-list-head.js +1 -1
  225. package/es/components/structured-list/structured-list-header-cell-skeleton.js +1 -1
  226. package/es/components/structured-list/structured-list-header-cell.js +1 -1
  227. package/es/components/structured-list/structured-list-header-row.js +1 -1
  228. package/es/components/structured-list/structured-list-row.js +1 -1
  229. package/es/components/structured-list/structured-list.js +1 -1
  230. package/es/components/tabs/stories/tabs-wrapper.js +1 -1
  231. package/es/components/tabs/tab-skeleton.js +1 -1
  232. package/es/components/tabs/tab.js +1 -1
  233. package/es/components/tabs/tabs-skeleton.js +1 -1
  234. package/es/components/tabs/tabs-vertical.js +1 -1
  235. package/es/components/tabs/tabs.js +2 -2
  236. package/es/components/tabs/tabs.js.map +1 -1
  237. package/es/components/tag/dismissible-tag.js +1 -1
  238. package/es/components/tag/operational-tag.js +1 -1
  239. package/es/components/tag/selectable-tag.js +1 -1
  240. package/es/components/tag/tag-skeleton.js +1 -1
  241. package/es/components/tag/tag.js +1 -1
  242. package/es/components/tearsheet/tearsheet.js +1 -1
  243. package/es/components/text-input/text-input-skeleton.js +1 -1
  244. package/es/components/text-input/text-input.js +1 -1
  245. package/es/components/textarea/textarea-skeleton.js +1 -1
  246. package/es/components/textarea/textarea.js +1 -1
  247. package/es/components/tile/clickable-tile.js +1 -1
  248. package/es/components/tile/expandable-tile.js +1 -1
  249. package/es/components/tile/radio-tile.js +1 -1
  250. package/es/components/tile/selectable-tile.js +1 -1
  251. package/es/components/tile/tile-group.js +1 -1
  252. package/es/components/tile/tile.js +1 -1
  253. package/es/components/time-picker/time-picker-select.js +1 -1
  254. package/es/components/time-picker/time-picker.js +1 -1
  255. package/es/components/toggle/toggle-skeleton.js +1 -1
  256. package/es/components/toggle/toggle.js +1 -1
  257. package/es/components/toggle-tip/toggletip.js +1 -1
  258. package/es/components/tooltip/definition-tooltip.js +1 -1
  259. package/es/components/tooltip/tooltip-content.js +1 -1
  260. package/es/components/tooltip/tooltip.js +1 -1
  261. package/es/components/tree-view/tree-node.js +1 -1
  262. package/es/components/tree-view/tree-view.js +1 -1
  263. package/es/components/ui-shell/header-global-action.js +1 -1
  264. package/es/components/ui-shell/header-menu-button.js +1 -1
  265. package/es/components/ui-shell/header-menu-item.js +1 -1
  266. package/es/components/ui-shell/header-menu.js +1 -1
  267. package/es/components/ui-shell/header-name.js +1 -1
  268. package/es/components/ui-shell/header-nav-item.js +1 -1
  269. package/es/components/ui-shell/header-nav.js +1 -1
  270. package/es/components/ui-shell/header-panel.js +1 -1
  271. package/es/components/ui-shell/header-side-nav-items.js +1 -1
  272. package/es/components/ui-shell/header.js +1 -1
  273. package/es/components/ui-shell/side-nav-divider.js +1 -1
  274. package/es/components/ui-shell/side-nav-items.js +1 -1
  275. package/es/components/ui-shell/side-nav-link.js +1 -1
  276. package/es/components/ui-shell/side-nav-menu-item.js +1 -1
  277. package/es/components/ui-shell/side-nav-menu.js +1 -1
  278. package/es/components/ui-shell/side-nav.js +1 -1
  279. package/es/components/ui-shell/switcher-divider.js +1 -1
  280. package/es/components/ui-shell/switcher-item.js +1 -1
  281. package/es/components/ui-shell/switcher.js +1 -1
  282. package/es/node_modules/flatpickr/dist/esm/l10n/default.js +1 -1
  283. package/es/packages/feature-flags/es/index.js +42 -2
  284. package/es/packages/feature-flags/es/index.js.map +1 -1
  285. package/es-custom/_virtual/{_@oxc-project_runtime@0.135.0 → _@oxc-project_runtime@0.139.0}/helpers/esm/decorate.js +2 -2
  286. package/es-custom/components/accordion/accordion-item-skeleton.js +1 -1
  287. package/es-custom/components/accordion/accordion-item.d.ts +4 -1
  288. package/es-custom/components/accordion/accordion-item.d.ts.map +1 -1
  289. package/es-custom/components/accordion/accordion-item.js +4 -7
  290. package/es-custom/components/accordion/accordion-item.js.map +1 -1
  291. package/es-custom/components/accordion/accordion-skeleton.d.ts +4 -1
  292. package/es-custom/components/accordion/accordion-skeleton.d.ts.map +1 -1
  293. package/es-custom/components/accordion/accordion-skeleton.js +5 -7
  294. package/es-custom/components/accordion/accordion-skeleton.js.map +1 -1
  295. package/es-custom/components/accordion/accordion.js +1 -1
  296. package/es-custom/components/ai-label/ai-label-action-button.js +1 -1
  297. package/es-custom/components/ai-label/ai-label.js +1 -1
  298. package/es-custom/components/ai-label/ai-label.scss.js +1 -1
  299. package/es-custom/components/ai-label/ai-label.scss.js.map +1 -1
  300. package/es-custom/components/ai-skeleton/ai-skeleton-icon.js +1 -1
  301. package/es-custom/components/ai-skeleton/ai-skeleton-placeholder.js +1 -1
  302. package/es-custom/components/ai-skeleton/ai-skeleton-text.js +1 -1
  303. package/es-custom/components/badge-indicator/badge-indicator.js +1 -1
  304. package/es-custom/components/breadcrumb/breadcrumb-item.js +1 -1
  305. package/es-custom/components/breadcrumb/breadcrumb-link.js +1 -1
  306. package/es-custom/components/breadcrumb/breadcrumb-overflow-menu.js +1 -1
  307. package/es-custom/components/breadcrumb/breadcrumb-skeleton.js +1 -1
  308. package/es-custom/components/breadcrumb/breadcrumb.js +1 -1
  309. package/es-custom/components/button/button-set-base.js +1 -1
  310. package/es-custom/components/button/button-set.js +1 -1
  311. package/es-custom/components/button/button-skeleton.js +3 -3
  312. package/es-custom/components/button/button-skeleton.js.map +1 -1
  313. package/es-custom/components/button/button.js +1 -1
  314. package/es-custom/components/button/button.scss.js +1 -1
  315. package/es-custom/components/chat-button/chat-button-skeleton.js +1 -1
  316. package/es-custom/components/chat-button/chat-button.js +1 -1
  317. package/es-custom/components/checkbox/checkbox-group.js +1 -1
  318. package/es-custom/components/checkbox/checkbox-skeleton.js +1 -1
  319. package/es-custom/components/checkbox/checkbox.js +1 -1
  320. package/es-custom/components/code-snippet/code-snippet-skeleton.js +1 -1
  321. package/es-custom/components/code-snippet/code-snippet.d.ts +11 -0
  322. package/es-custom/components/code-snippet/code-snippet.d.ts.map +1 -1
  323. package/es-custom/components/code-snippet/code-snippet.js +30 -20
  324. package/es-custom/components/code-snippet/code-snippet.js.map +1 -1
  325. package/es-custom/components/code-snippet/code-snippet.scss.js +1 -1
  326. package/es-custom/components/combo-box/combo-box-item.js +1 -1
  327. package/es-custom/components/combo-box/combo-box.d.ts.map +1 -1
  328. package/es-custom/components/combo-box/combo-box.js +16 -12
  329. package/es-custom/components/combo-box/combo-box.js.map +1 -1
  330. package/es-custom/components/combo-button/combo-button.js +1 -1
  331. package/es-custom/components/contained-list/contained-list-description.js +1 -1
  332. package/es-custom/components/contained-list/contained-list-item.js +1 -1
  333. package/es-custom/components/contained-list/contained-list.js +1 -1
  334. package/es-custom/components/content-switcher/content-switcher-item.d.ts +4 -0
  335. package/es-custom/components/content-switcher/content-switcher-item.d.ts.map +1 -1
  336. package/es-custom/components/content-switcher/content-switcher-item.js +4 -3
  337. package/es-custom/components/content-switcher/content-switcher-item.js.map +1 -1
  338. package/es-custom/components/content-switcher/content-switcher.js +1 -1
  339. package/es-custom/components/content-switcher/content-switcher.scss.js +1 -1
  340. package/es-custom/components/content-switcher/content-switcher.scss.js.map +1 -1
  341. package/es-custom/components/copy/copy.js +1 -1
  342. package/es-custom/components/copy-button/copy-button.js +1 -1
  343. package/es-custom/components/copy-button/copy-button.scss.js +1 -1
  344. package/es-custom/components/data-table/table-batch-actions.js +1 -1
  345. package/es-custom/components/data-table/table-body.js +1 -1
  346. package/es-custom/components/data-table/table-cell-content.js +1 -1
  347. package/es-custom/components/data-table/table-cell.js +1 -1
  348. package/es-custom/components/data-table/table-expanded-row.js +1 -1
  349. package/es-custom/components/data-table/table-head.js +1 -1
  350. package/es-custom/components/data-table/table-header-cell.js +1 -1
  351. package/es-custom/components/data-table/table-header-description.js +1 -1
  352. package/es-custom/components/data-table/table-header-row.js +1 -1
  353. package/es-custom/components/data-table/table-header-title.js +1 -1
  354. package/es-custom/components/data-table/table-row.js +1 -1
  355. package/es-custom/components/data-table/table-skeleton.js +1 -1
  356. package/es-custom/components/data-table/table-toolbar-content.js +1 -1
  357. package/es-custom/components/data-table/table-toolbar-search.js +1 -1
  358. package/es-custom/components/data-table/table-toolbar.js +1 -1
  359. package/es-custom/components/data-table/table.js +1 -1
  360. package/es-custom/components/date-picker/date-picker-input-skeleton.js +1 -1
  361. package/es-custom/components/date-picker/date-picker-input.js +1 -1
  362. package/es-custom/components/date-picker/date-picker.js +1 -1
  363. package/es-custom/components/dialog/dialog-body.js +1 -1
  364. package/es-custom/components/dialog/dialog-close-button.js +1 -1
  365. package/es-custom/components/dialog/dialog-controls.js +1 -1
  366. package/es-custom/components/dialog/dialog-footer-button.js +1 -1
  367. package/es-custom/components/dialog/dialog-footer.js +1 -1
  368. package/es-custom/components/dialog/dialog-header.js +1 -1
  369. package/es-custom/components/dialog/dialog-subtitle.js +1 -1
  370. package/es-custom/components/dialog/dialog-title.js +1 -1
  371. package/es-custom/components/dialog/dialog.js +1 -1
  372. package/es-custom/components/dropdown/dropdown-item.js +1 -1
  373. package/es-custom/components/dropdown/dropdown-skeleton.js +1 -1
  374. package/es-custom/components/dropdown/dropdown.js +2 -2
  375. package/es-custom/components/dropdown/dropdown.js.map +1 -1
  376. package/es-custom/components/feature-flags/index.d.ts +39 -4
  377. package/es-custom/components/feature-flags/index.d.ts.map +1 -1
  378. package/es-custom/components/feature-flags/index.js +44 -7
  379. package/es-custom/components/feature-flags/index.js.map +1 -1
  380. package/es-custom/components/file-uploader/demo-file-uploader.js +1 -1
  381. package/es-custom/components/file-uploader/file-uploader-button.js +1 -1
  382. package/es-custom/components/file-uploader/file-uploader-drop-container.js +1 -1
  383. package/es-custom/components/file-uploader/file-uploader-item.js +1 -1
  384. package/es-custom/components/file-uploader/file-uploader-skeleton.js +1 -1
  385. package/es-custom/components/file-uploader/file-uploader.js +1 -1
  386. package/es-custom/components/floating-menu/floating-menu.js +1 -1
  387. package/es-custom/components/fluid-combo-box/fluid-combo-box-skeleton.js +1 -1
  388. package/es-custom/components/fluid-combo-box/fluid-combo-box.js +1 -1
  389. package/es-custom/components/fluid-dropdown/fluid-dropdown-skeleton.js +1 -1
  390. package/es-custom/components/fluid-dropdown/fluid-dropdown.js +1 -1
  391. package/es-custom/components/fluid-form/fluid-form.js +1 -1
  392. package/es-custom/components/fluid-multi-select/fluid-multi-select-skeleton.js +1 -1
  393. package/es-custom/components/fluid-multi-select/fluid-multi-select.js +1 -1
  394. package/es-custom/components/fluid-number-input/fluid-number-input-skeleton.js +1 -1
  395. package/es-custom/components/fluid-number-input/fluid-number-input.js +1 -1
  396. package/es-custom/components/fluid-password-input/fluid-password-input.js +1 -1
  397. package/es-custom/components/fluid-search/fluid-search-skeleton.js +1 -1
  398. package/es-custom/components/fluid-search/fluid-search.js +1 -1
  399. package/es-custom/components/fluid-select/fluid-select-skeleton.js +1 -1
  400. package/es-custom/components/fluid-select/fluid-select.js +1 -1
  401. package/es-custom/components/fluid-text-input/fluid-text-input-skeleton.js +1 -1
  402. package/es-custom/components/fluid-text-input/fluid-text-input.js +1 -1
  403. package/es-custom/components/fluid-textarea/fluid-textarea-skeleton.js +1 -1
  404. package/es-custom/components/fluid-textarea/fluid-textarea.js +1 -1
  405. package/es-custom/components/fluid-time-picker/fluid-time-picker-select.js +1 -1
  406. package/es-custom/components/fluid-time-picker/fluid-time-picker-skeleton.js +1 -1
  407. package/es-custom/components/fluid-time-picker/fluid-time-picker.js +1 -1
  408. package/es-custom/components/form/form-item.js +1 -1
  409. package/es-custom/components/form/form.js +1 -1
  410. package/es-custom/components/form-group/form-group.js +1 -1
  411. package/es-custom/components/grid/column-hang.js +1 -1
  412. package/es-custom/components/grid/column.js +1 -1
  413. package/es-custom/components/grid/grid.js +1 -1
  414. package/es-custom/components/heading/heading.js +1 -1
  415. package/es-custom/components/icon/icon.js +1 -1
  416. package/es-custom/components/icon-button/icon-button.js +1 -1
  417. package/es-custom/components/icon-indicator/icon-indicator.js +1 -1
  418. package/es-custom/components/inline-loading/inline-loading.js +1 -1
  419. package/es-custom/components/layer/layer.js +1 -1
  420. package/es-custom/components/layout/layout-constraint.js +1 -1
  421. package/es-custom/components/layout/layout.js +1 -1
  422. package/es-custom/components/link/link.js +1 -1
  423. package/es-custom/components/list/list-item.js +1 -1
  424. package/es-custom/components/list/ordered-list.js +1 -1
  425. package/es-custom/components/list/unordered-list.js +1 -1
  426. package/es-custom/components/loading/loading.js +1 -1
  427. package/es-custom/components/menu/menu-item-divider.js +1 -1
  428. package/es-custom/components/menu/menu-item-group.js +1 -1
  429. package/es-custom/components/menu/menu-item-radio-group.js +1 -1
  430. package/es-custom/components/menu/menu-item-selectable.js +1 -1
  431. package/es-custom/components/menu/menu-item.js +1 -1
  432. package/es-custom/components/menu/menu.js +1 -1
  433. package/es-custom/components/menu-button/menu-button.js +1 -1
  434. package/es-custom/components/modal/modal-base.js +1 -1
  435. package/es-custom/components/modal/modal-body-content.js +1 -1
  436. package/es-custom/components/modal/modal-body.js +1 -1
  437. package/es-custom/components/modal/modal-close-button.js +1 -1
  438. package/es-custom/components/modal/modal-footer-button.js +1 -1
  439. package/es-custom/components/modal/modal-footer.js +1 -1
  440. package/es-custom/components/modal/modal-header.js +1 -1
  441. package/es-custom/components/modal/modal-heading.js +1 -1
  442. package/es-custom/components/modal/modal-label.js +1 -1
  443. package/es-custom/components/modal/modal.js +1 -1
  444. package/es-custom/components/multi-select/multi-select-item.js +1 -1
  445. package/es-custom/components/multi-select/multi-select.js +1 -1
  446. package/es-custom/components/notification/actionable-notification-button.js +1 -1
  447. package/es-custom/components/notification/actionable-notification.js +1 -1
  448. package/es-custom/components/notification/actionable-notification.scss.js +1 -1
  449. package/es-custom/components/notification/actionable-notification.scss.js.map +1 -1
  450. package/es-custom/components/notification/callout-notification.js +1 -1
  451. package/es-custom/components/notification/inline-notification.js +2 -2
  452. package/es-custom/components/notification/inline-notification.js.map +1 -1
  453. package/es-custom/components/notification/inline-notification.scss.js +1 -1
  454. package/es-custom/components/notification/toast-notification.js +1 -1
  455. package/es-custom/components/notification/toast-notification.scss.js +1 -1
  456. package/es-custom/components/number-input/number-input-skeleton.js +1 -1
  457. package/es-custom/components/number-input/number-input.js +1 -1
  458. package/es-custom/components/overflow-menu/overflow-menu-body.js +1 -1
  459. package/es-custom/components/overflow-menu/overflow-menu-item.js +1 -1
  460. package/es-custom/components/overflow-menu/overflow-menu.js +2 -2
  461. package/es-custom/components/overflow-menu/overflow-menu.js.map +1 -1
  462. package/es-custom/components/page-header/page-header-breadcrumb.js +1 -1
  463. package/es-custom/components/page-header/page-header-content-text.js +1 -1
  464. package/es-custom/components/page-header/page-header-content.js +1 -1
  465. package/es-custom/components/page-header/page-header-hero-image.js +1 -1
  466. package/es-custom/components/page-header/page-header-tabs.js +1 -1
  467. package/es-custom/components/page-header/page-header.js +1 -1
  468. package/es-custom/components/pagination/pagination.js +1 -1
  469. package/es-custom/components/pagination-nav/pagination-nav.js +1 -1
  470. package/es-custom/components/password-input/password-input-skeleton.js +1 -1
  471. package/es-custom/components/password-input/password-input.js +1 -1
  472. package/es-custom/components/popover/popover-content.js +1 -1
  473. package/es-custom/components/popover/popover.d.ts.map +1 -1
  474. package/es-custom/components/popover/popover.js +20 -1
  475. package/es-custom/components/popover/popover.js.map +1 -1
  476. package/es-custom/components/progress-bar/progress-bar.js +1 -1
  477. package/es-custom/components/progress-indicator/progress-indicator-skeleton.js +1 -1
  478. package/es-custom/components/progress-indicator/progress-indicator.js +1 -1
  479. package/es-custom/components/progress-indicator/progress-indicator.scss.js +1 -1
  480. package/es-custom/components/progress-indicator/progress-step-skeleton.js +1 -1
  481. package/es-custom/components/progress-indicator/progress-step.js +1 -1
  482. package/es-custom/components/radio-button/radio-button-group.js +1 -1
  483. package/es-custom/components/radio-button/radio-button-skeleton.js +1 -1
  484. package/es-custom/components/radio-button/radio-button.js +1 -1
  485. package/es-custom/components/search/search-skeleton.js +1 -1
  486. package/es-custom/components/search/search.js +1 -1
  487. package/es-custom/components/select/select-item-group.js +1 -1
  488. package/es-custom/components/select/select-item.js +1 -1
  489. package/es-custom/components/select/select-skeleton.js +1 -1
  490. package/es-custom/components/select/select.js +1 -1
  491. package/es-custom/components/shape-indicator/shape-indicator.js +1 -1
  492. package/es-custom/components/side-panel/side-panel.js +5 -3
  493. package/es-custom/components/side-panel/side-panel.js.map +1 -1
  494. package/es-custom/components/skeleton-icon/skeleton-icon.js +1 -1
  495. package/es-custom/components/skeleton-placeholder/skeleton-placeholder.js +1 -1
  496. package/es-custom/components/skeleton-text/skeleton-text.js +1 -1
  497. package/es-custom/components/skip-to-content/skip-to-content.js +1 -1
  498. package/es-custom/components/slider/slider-input.js +1 -1
  499. package/es-custom/components/slider/slider-skeleton.js +1 -1
  500. package/es-custom/components/slider/slider.js +1 -1
  501. package/es-custom/components/slug/slug-action-button.js +1 -1
  502. package/es-custom/components/slug/slug.js +1 -1
  503. package/es-custom/components/slug/slug.scss.js +1 -1
  504. package/es-custom/components/stack/stack.js +1 -1
  505. package/es-custom/components/structured-list/structured-list-body.js +1 -1
  506. package/es-custom/components/structured-list/structured-list-cell.js +1 -1
  507. package/es-custom/components/structured-list/structured-list-head.js +1 -1
  508. package/es-custom/components/structured-list/structured-list-header-cell-skeleton.js +1 -1
  509. package/es-custom/components/structured-list/structured-list-header-cell.js +1 -1
  510. package/es-custom/components/structured-list/structured-list-header-row.js +1 -1
  511. package/es-custom/components/structured-list/structured-list-row.js +1 -1
  512. package/es-custom/components/structured-list/structured-list.js +1 -1
  513. package/es-custom/components/tabs/stories/tabs-wrapper.js +1 -1
  514. package/es-custom/components/tabs/tab-skeleton.js +1 -1
  515. package/es-custom/components/tabs/tab.js +1 -1
  516. package/es-custom/components/tabs/tabs-skeleton.js +1 -1
  517. package/es-custom/components/tabs/tabs-vertical.js +1 -1
  518. package/es-custom/components/tabs/tabs.js +2 -2
  519. package/es-custom/components/tabs/tabs.js.map +1 -1
  520. package/es-custom/components/tag/dismissible-tag.js +1 -1
  521. package/es-custom/components/tag/operational-tag.js +1 -1
  522. package/es-custom/components/tag/selectable-tag.js +1 -1
  523. package/es-custom/components/tag/tag-skeleton.js +1 -1
  524. package/es-custom/components/tag/tag.js +1 -1
  525. package/es-custom/components/tearsheet/tearsheet.js +1 -1
  526. package/es-custom/components/text-input/text-input-skeleton.js +1 -1
  527. package/es-custom/components/text-input/text-input.js +1 -1
  528. package/es-custom/components/textarea/textarea-skeleton.js +1 -1
  529. package/es-custom/components/textarea/textarea.js +1 -1
  530. package/es-custom/components/tile/clickable-tile.js +1 -1
  531. package/es-custom/components/tile/expandable-tile.js +1 -1
  532. package/es-custom/components/tile/radio-tile.js +1 -1
  533. package/es-custom/components/tile/selectable-tile.js +1 -1
  534. package/es-custom/components/tile/tile-group.js +1 -1
  535. package/es-custom/components/tile/tile.js +1 -1
  536. package/es-custom/components/time-picker/time-picker-select.js +1 -1
  537. package/es-custom/components/time-picker/time-picker.js +1 -1
  538. package/es-custom/components/toggle/toggle-skeleton.js +1 -1
  539. package/es-custom/components/toggle/toggle.js +1 -1
  540. package/es-custom/components/toggle-tip/toggletip.js +1 -1
  541. package/es-custom/components/tooltip/definition-tooltip.js +1 -1
  542. package/es-custom/components/tooltip/tooltip-content.js +1 -1
  543. package/es-custom/components/tooltip/tooltip.js +1 -1
  544. package/es-custom/components/tree-view/tree-node.js +1 -1
  545. package/es-custom/components/tree-view/tree-view.js +1 -1
  546. package/es-custom/components/ui-shell/header-global-action.js +1 -1
  547. package/es-custom/components/ui-shell/header-menu-button.js +1 -1
  548. package/es-custom/components/ui-shell/header-menu-item.js +1 -1
  549. package/es-custom/components/ui-shell/header-menu.js +1 -1
  550. package/es-custom/components/ui-shell/header-name.js +1 -1
  551. package/es-custom/components/ui-shell/header-nav-item.js +1 -1
  552. package/es-custom/components/ui-shell/header-nav.js +1 -1
  553. package/es-custom/components/ui-shell/header-panel.js +1 -1
  554. package/es-custom/components/ui-shell/header-side-nav-items.js +1 -1
  555. package/es-custom/components/ui-shell/header.js +1 -1
  556. package/es-custom/components/ui-shell/side-nav-divider.js +1 -1
  557. package/es-custom/components/ui-shell/side-nav-items.js +1 -1
  558. package/es-custom/components/ui-shell/side-nav-link.js +1 -1
  559. package/es-custom/components/ui-shell/side-nav-menu-item.js +1 -1
  560. package/es-custom/components/ui-shell/side-nav-menu.js +1 -1
  561. package/es-custom/components/ui-shell/side-nav.js +1 -1
  562. package/es-custom/components/ui-shell/switcher-divider.js +1 -1
  563. package/es-custom/components/ui-shell/switcher-item.js +1 -1
  564. package/es-custom/components/ui-shell/switcher.js +1 -1
  565. package/es-custom/node_modules/flatpickr/dist/esm/l10n/default.js +1 -1
  566. package/es-custom/packages/feature-flags/es/index.js +42 -2
  567. package/es-custom/packages/feature-flags/es/index.js.map +1 -1
  568. package/lib/components/accordion/accordion-item.d.ts +4 -1
  569. package/lib/components/accordion/accordion-item.d.ts.map +1 -1
  570. package/lib/components/accordion/accordion-skeleton.d.ts +4 -1
  571. package/lib/components/accordion/accordion-skeleton.d.ts.map +1 -1
  572. package/lib/components/code-snippet/code-snippet.d.ts +11 -0
  573. package/lib/components/code-snippet/code-snippet.d.ts.map +1 -1
  574. package/lib/components/combo-box/combo-box.d.ts.map +1 -1
  575. package/lib/components/content-switcher/content-switcher-item.d.ts +4 -0
  576. package/lib/components/content-switcher/content-switcher-item.d.ts.map +1 -1
  577. package/lib/components/feature-flags/index.d.ts +39 -4
  578. package/lib/components/feature-flags/index.d.ts.map +1 -1
  579. package/lib/components/popover/popover.d.ts.map +1 -1
  580. package/package.json +7 -7
  581. package/scss/components/ai-label/ai-label.scss +7 -5
  582. package/scss/components/content-switcher/content-switcher.scss +14 -7
  583. package/scss/components/notification/actionable-notification.scss +11 -4
  584. package/telemetry.yml +10 -1
@@ -7,7 +7,7 @@
7
7
 
8
8
  import "../../globals/settings.js";
9
9
  import { carbonElement } from "../../globals/decorators/carbon-element.js";
10
- import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.135.0/helpers/esm/decorate.js";
10
+ import __decorate from "../../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorate.js";
11
11
  import iconLoader from "../../globals/internal/icon-loader.js";
12
12
  import checkbox_default from "./checkbox.scss.js";
13
13
  import { CHECKBOX_ORIENTATION } from "./defs.js";
@@ -7,7 +7,7 @@
7
7
 
8
8
  import "../../globals/settings.js";
9
9
  import { carbonElement } from "../../globals/decorators/carbon-element.js";
10
- import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.135.0/helpers/esm/decorate.js";
10
+ import __decorate from "../../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorate.js";
11
11
  import checkbox_default from "./checkbox.scss.js";
12
12
  import { LitElement, html } from "lit";
13
13
  //#region src/components/checkbox/checkbox-skeleton.ts
@@ -7,7 +7,7 @@
7
7
 
8
8
  import "../../globals/settings.js";
9
9
  import { carbonElement } from "../../globals/decorators/carbon-element.js";
10
- import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.135.0/helpers/esm/decorate.js";
10
+ import __decorate from "../../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorate.js";
11
11
  import iconLoader from "../../globals/internal/icon-loader.js";
12
12
  import FocusMixin from "../../globals/mixins/focus.js";
13
13
  import FormMixin from "../../globals/mixins/form.js";
@@ -7,7 +7,7 @@
7
7
 
8
8
  import "../../globals/settings.js";
9
9
  import { carbonElement } from "../../globals/decorators/carbon-element.js";
10
- import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.135.0/helpers/esm/decorate.js";
10
+ import __decorate from "../../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorate.js";
11
11
  import "./defs.js";
12
12
  import code_snippet_default from "./code-snippet.scss.js";
13
13
  import "./code-snippet.js";
@@ -1,3 +1,10 @@
1
+ /**
2
+ * Copyright IBM Corp. 2019, 2026
3
+ *
4
+ * This source code is licensed under the Apache-2.0 license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ /** eslint-disable @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452 */
1
8
  import { LitElement } from 'lit';
2
9
  import { CODE_SNIPPET_COLOR_SCHEME, CODE_SNIPPET_TYPE } from './defs';
3
10
  import '../copy-button/index';
@@ -13,6 +20,10 @@ declare const CDSCodeSnippet_base: (new (...args: any[]) => {
13
20
  * @element cds-custom-code-snippet
14
21
  */
15
22
  declare class CDSCodeSnippet extends CDSCodeSnippet_base {
23
+ /**
24
+ * The code snippet container element.
25
+ */
26
+ private _snippetContainer;
16
27
  /**
17
28
  * `true` to expand multi-line variant of code snippet.
18
29
  */
@@ -1 +1 @@
1
- {"version":3,"file":"code-snippet.d.ts","sourceRoot":"","sources":["../../../src/components/code-snippet/code-snippet.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,UAAU,EAAQ,MAAM,KAAK,CAAC;AAKvC,OAAO,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAGtE,OAAO,sBAAsB,CAAC;AAC9B,OAAO,cAAc,CAAC;AACtB,OAAO,kBAAkB,CAAC;AAI1B,OAAO,EAAE,yBAAyB,EAAE,iBAAiB,EAAE,CAAC;;;;AAqBxD;;;;GAIG;AACH,cACM,cAAe,SAAQ,mBAAsB;IACjD;;OAEG;IACH,OAAO,CAAC,aAAa,CAAS;IAE9B;;OAEG;IACH,OAAO,CAAC,eAAe,CAAuB;IAE9C;;OAEG;IACH,OAAO,CAAC,kBAAkB,CAAM;IAEhC;;OAEG;IACH,OAAO,CAAC,iBAAiB,CAAQ;IAEjC;;OAEG;IACH,OAAO,CAAC,gBAAgB,CAAS;IAEjC;;OAEG;IACH,OAAO,CAAC,sBAAsB,CAAS;IAEvC;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAgCxB,OAAO,CAAC,qBAAqB;IAc7B;;OAEG;IACH,OAAO,CAAC,aAAa;IAgCrB;;OAEG;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H,OAAO,CAAC,eAAe,CAAuB;IAE9C;;OAEG;IACH,OAAO,CAAC,kBAAkB,CAAM;IAEhC;;OAEG;IACH,OAAO,CAAC,iBAAiB,CAAQ;IAEjC;;OAEG;IACH,OAAO,CAAC,gBAAgB,CAAS;IAEjC;;OAEG;IACH,OAAO,CAAC,sBAAsB,CAAS;IAEvC;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAgCxB,OAAO,CAAC,qBAAqB;IAc7B;;OAEG;IACH,OAAO,CAAC,aAAa;IA8BrB;;OAEG;IACH,OAAO,CAAC,oBAAoB;IAK5B;;OAEG;IAIH,OAAO,CAAC,eAAe,CAsCpB;IAEH;;;OAGG;IAEH,QAAQ,SAAM;IAEd;;OAEG;IAEH,QAAQ,UAAS;IAEjB;;OAEG;IAEH,QAAQ,SAAa;IAErB;;OAEG;IAEH,eAAe,SAAQ;IAEvB;;OAEG;IAEH,cAAc,UAAS;IAEvB;;OAEG;IAEH,wBAAwB,SAAM;IAE9B;;OAEG;IAEH,uBAAuB,SAAK;IAE5B;;OAEG;IAEH,wBAAwB,SAAK;IAE7B;;OAEG;IAEH,uBAAuB,SAAM;IAE7B;;;OAGG;IAEH,YAAY,SAAe;IAE3B;;;OAGG;IAEH,YAAY,SAAe;IAE3B;;OAEG;IAEH,cAAc,SAAuB;IAErC;;OAEG;IAEH,QAAQ,UAAS;IAEjB;;OAEG;IAEH,IAAI,oBAA4B;IAEhC,iBAAiB;IAQjB,oBAAoB;IAMpB,OAAO;IAiDP,MAAM;IAiIN,MAAM,CAAC,iBAAiB;;;;;;;MAGtB;IACF,MAAM,CAAC,MAAM,MAAU;CACxB;AAED,eAAe,cAAc,CAAC"}
@@ -7,7 +7,7 @@
7
7
 
8
8
  import "../../globals/settings.js";
9
9
  import { carbonElement } from "../../globals/decorators/carbon-element.js";
10
- import { __decorate } from "../../_virtual/_@oxc-project_runtime@0.135.0/helpers/esm/decorate.js";
10
+ import __decorate from "../../_virtual/_@oxc-project_runtime@0.139.0/helpers/esm/decorate.js";
11
11
  import iconLoader from "../../globals/internal/icon-loader.js";
12
12
  import FocusMixin from "../../globals/mixins/focus.js";
13
13
  import "../button/button.js";
@@ -17,8 +17,7 @@ import code_snippet_default$1 from "./code-snippet.scss.js";
17
17
  import "../copy/copy.js";
18
18
  import "../copy-button/index.js";
19
19
  import { LitElement, html } from "lit";
20
- import { property } from "lit/decorators.js";
21
- import { styleMap } from "lit/directives/style-map.js";
20
+ import { property, query } from "lit/decorators.js";
22
21
  import ChevronDown16 from "@carbon/icons/es/chevron--down/16.js";
23
22
  //#region src/components/code-snippet/code-snippet.ts
24
23
  /**
@@ -57,7 +56,7 @@ let CDSCodeSnippet = class CDSCodeSnippet extends FocusMixin(LitElement) {
57
56
  this._hasLeftOverflow = false;
58
57
  this._shouldShowMoreLessBtn = false;
59
58
  this._resizeObserver = new ResizeObserver(() => {
60
- const codeContainerRef = this.shadowRoot?.querySelector(`.cds-custom--snippet-container`);
59
+ const codeContainerRef = this._snippetContainer;
61
60
  const codeContentRef = codeContainerRef?.querySelector("code");
62
61
  const { type, maxCollapsedNumberOfRows, maxExpandedNumberOfRows, minExpandedNumberOfRows, _rowHeightInPixels: rowHeightInPixels, _handleScroll: handleScroll } = this;
63
62
  if (codeContentRef && type === "multi") {
@@ -119,7 +118,7 @@ let CDSCodeSnippet = class CDSCodeSnippet extends FocusMixin(LitElement) {
119
118
  */
120
119
  _handleScroll() {
121
120
  if (this) {
122
- const codeContainerRef = this?.shadowRoot?.querySelector(`.cds-custom--snippet-container`);
121
+ const codeContainerRef = this._snippetContainer;
123
122
  const codeContentRef = codeContainerRef?.querySelector("pre");
124
123
  if (this.type === "inline" || this.type === "single" && !codeContainerRef || this.type === "multi" && !codeContentRef) return;
125
124
  const { horizontalOverflow, codeClientWidth, codeScrollWidth, codeScrollLeft } = this.type === "single" ? this._getCodeRefDimensions(codeContainerRef) : this._getCodeRefDimensions(codeContentRef);
@@ -146,9 +145,28 @@ let CDSCodeSnippet = class CDSCodeSnippet extends FocusMixin(LitElement) {
146
145
  updated() {
147
146
  if (this._expandedCode) this.setAttribute("expanded-code", "");
148
147
  else this.removeAttribute("expanded-code");
148
+ const { _snippetContainer: container } = this;
149
+ if (!container) return;
150
+ if (this.type === "multi") {
151
+ const { maxExpandedNumberOfRows, minExpandedNumberOfRows, maxCollapsedNumberOfRows, minCollapsedNumberOfRows, _expandedCode: expandedCode, _rowHeightInPixels: rowHeightInPixels } = this;
152
+ let maxHeight = "";
153
+ let minHeight = "";
154
+ if (expandedCode) {
155
+ if (maxExpandedNumberOfRows > 0) maxHeight = `${maxExpandedNumberOfRows * rowHeightInPixels}px`;
156
+ if (minExpandedNumberOfRows > 0) minHeight = `${minExpandedNumberOfRows * rowHeightInPixels}px`;
157
+ } else {
158
+ if (maxCollapsedNumberOfRows > 0) maxHeight = `${maxCollapsedNumberOfRows * rowHeightInPixels}px`;
159
+ if (minCollapsedNumberOfRows > 0) minHeight = `${minCollapsedNumberOfRows * rowHeightInPixels}px`;
160
+ }
161
+ container.style.maxHeight = maxHeight;
162
+ container.style.minHeight = minHeight;
163
+ } else {
164
+ container.style.maxHeight = "";
165
+ container.style.minHeight = "";
166
+ }
149
167
  }
150
168
  render() {
151
- const { disabled, feedback, feedbackTimeout, hideCopyButton, maxExpandedNumberOfRows, minExpandedNumberOfRows, maxCollapsedNumberOfRows, minCollapsedNumberOfRows, type, wrapText, tooltipContent, showMoreText, showLessText, _expandedCode: expandedCode, _handleCopyClick: handleCopyClick, _handleScroll: handleScroll, _hasRightOverflow: hasRightOverflow, _hasLeftOverflow: hasLeftOverflow, _rowHeightInPixels: rowHeightInPixels, _shouldShowMoreLessBtn: shouldShowMoreLessBtn } = this;
169
+ const { disabled, feedback, feedbackTimeout, hideCopyButton, type, wrapText, tooltipContent, showMoreText, showLessText, _expandedCode: expandedCode, _handleCopyClick: handleCopyClick, _handleScroll: handleScroll, _hasRightOverflow: hasRightOverflow, _hasLeftOverflow: hasLeftOverflow, _shouldShowMoreLessBtn: shouldShowMoreLessBtn } = this;
152
170
  let classes = `cds-custom--snippet`;
153
171
  if (type) classes += ` cds-custom--snippet--${type}`;
154
172
  if (type !== "inline" && disabled) classes += ` cds-custom--snippet--disabled`;
@@ -164,14 +182,6 @@ let CDSCodeSnippet = class CDSCodeSnippet extends FocusMixin(LitElement) {
164
182
  <span slot="tooltip-content">${tooltipContent}</span>
165
183
  </cds-custom-copy>
166
184
  `;
167
- const styles = {};
168
- if (type === "multi") if (expandedCode) {
169
- if (maxExpandedNumberOfRows > 0) styles["max-height"] = maxExpandedNumberOfRows * rowHeightInPixels + "px";
170
- if (minExpandedNumberOfRows > 0) styles["min-height"] = minExpandedNumberOfRows * rowHeightInPixels + "px";
171
- } else {
172
- if (maxCollapsedNumberOfRows > 0) styles["max-height"] = maxCollapsedNumberOfRows * rowHeightInPixels + "px";
173
- if (minCollapsedNumberOfRows > 0) styles["min-height"] = minCollapsedNumberOfRows * rowHeightInPixels + "px";
174
- }
175
185
  return html`
176
186
  <div
177
187
  role="${type === "single" || type === "multi" ? "textbox" : null}"
@@ -180,8 +190,7 @@ let CDSCodeSnippet = class CDSCodeSnippet extends FocusMixin(LitElement) {
180
190
  aria-label="${"code-snippet"}"
181
191
  aria-readonly="${type === "single" || type === "multi" ? true : null}"
182
192
  aria-multiline="${type === "multi" ? true : null}"
183
- @scroll="${type === "single" && handleScroll || null}"
184
- style=${styleMap(styles)}>
193
+ @scroll="${type === "single" && handleScroll || null}">
185
194
  <pre
186
195
  @scroll="${type === "multi" && handleScroll || null}"><code><slot></slot></code></pre>
187
196
  </div>
@@ -231,6 +240,7 @@ let CDSCodeSnippet = class CDSCodeSnippet extends FocusMixin(LitElement) {
231
240
  this.styles = code_snippet_default$1;
232
241
  }
233
242
  };
243
+ __decorate([query(`.cds-custom--snippet-container`)], CDSCodeSnippet.prototype, "_snippetContainer", void 0);
234
244
  __decorate([property({ attribute: "copy-text" })], CDSCodeSnippet.prototype, "copyText", void 0);
235
245
  __decorate([property({
236
246
  type: Boolean,
@@ -246,10 +256,10 @@ __decorate([property({
246
256
  reflect: true,
247
257
  attribute: "hide-copy-button"
248
258
  })], CDSCodeSnippet.prototype, "hideCopyButton", void 0);
249
- __decorate([property()], CDSCodeSnippet.prototype, "maxCollapsedNumberOfRows", void 0);
250
- __decorate([property()], CDSCodeSnippet.prototype, "maxExpandedNumberOfRows", void 0);
251
- __decorate([property()], CDSCodeSnippet.prototype, "minCollapsedNumberOfRows", void 0);
252
- __decorate([property()], CDSCodeSnippet.prototype, "minExpandedNumberOfRows", void 0);
259
+ __decorate([property({ type: Number })], CDSCodeSnippet.prototype, "maxCollapsedNumberOfRows", void 0);
260
+ __decorate([property({ type: Number })], CDSCodeSnippet.prototype, "maxExpandedNumberOfRows", void 0);
261
+ __decorate([property({ type: Number })], CDSCodeSnippet.prototype, "minCollapsedNumberOfRows", void 0);
262
+ __decorate([property({ type: Number })], CDSCodeSnippet.prototype, "minExpandedNumberOfRows", void 0);
253
263
  __decorate([property({ attribute: "show-less-text" })], CDSCodeSnippet.prototype, "showLessText", void 0);
254
264
  __decorate([property({ attribute: "show-more-text" })], CDSCodeSnippet.prototype, "showMoreText", void 0);
255
265
  __decorate([property({ attribute: "tooltip-content" })], CDSCodeSnippet.prototype, "tooltipContent", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"code-snippet.js","names":["styles","customElement"],"sources":["../../../src/components/code-snippet/code-snippet.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/** eslint-disable @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452 */\nimport { styleMap } from 'lit/directives/style-map.js';\nimport { LitElement, html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { prefix } from '../../globals/settings';\nimport ChevronDown16 from '@carbon/icons/es/chevron--down/16.js';\nimport FocusMixin from '../../globals/mixins/focus';\nimport { CODE_SNIPPET_COLOR_SCHEME, CODE_SNIPPET_TYPE } from './defs';\nimport styles from './code-snippet.scss?lit';\nimport Handle from '../../globals/internal/handle';\nimport '../copy-button/index';\nimport '../copy/copy';\nimport '../button/button';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\nimport { iconLoader } from '../../globals/internal/icon-loader';\n\nexport { CODE_SNIPPET_COLOR_SCHEME, CODE_SNIPPET_TYPE };\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 if (!elem) {\n return null;\n }\n observer.observe(elem);\n return {\n release() {\n observer.unobserve(elem);\n return null;\n },\n } as Handle;\n};\n\n/**\n * Basic code snippet.\n *\n * @element cds-custom-code-snippet\n */\n@customElement(`${prefix}-code-snippet`)\nclass CDSCodeSnippet extends FocusMixin(LitElement) {\n /**\n * `true` to expand multi-line variant of code snippet.\n */\n private _expandedCode = false;\n\n /**\n * The handle for observing resize of the parent element of this element.\n */\n private _hObserveResize: Handle | null = null;\n\n /**\n * Row height in pixels\n */\n private _rowHeightInPixels = 16;\n\n /**\n * `true` if code-snippet has right overflow\n */\n private _hasRightOverflow = true;\n\n /**\n * `true` if code-snippet has left overflow\n */\n private _hasLeftOverflow = false;\n\n /**\n * `true` if show more or show less btn is visible\n */\n private _shouldShowMoreLessBtn = false;\n\n /**\n * Handles `click` event on the copy button.\n */\n private _handleCopyClick() {\n const { ownerDocument: doc } = this;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452\n const selection = doc!.defaultView!.getSelection();\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452\n selection!.removeAllRanges();\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452\n const code = doc!.createElement('code');\n code.className = `${prefix}--visually-hidden`;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452\n const pre = doc!.createElement('pre');\n const text = Array.from(this.childNodes).filter(\n (node) => node.nodeType === Node.TEXT_NODE\n );\n pre.textContent = this.copyText || text[0].textContent;\n code.appendChild(pre);\n // Using `<code>` in shadow DOM seems to lose the LFs in some browsers\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452\n doc!.body.appendChild(code);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452\n const range = doc!.createRange();\n range.selectNodeContents(code);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452\n selection!.addRange(range);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452\n doc!.execCommand('copy');\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452\n doc!.body.removeChild(code);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452\n selection!.removeAllRanges();\n }\n\n private _getCodeRefDimensions(ref) {\n const {\n clientWidth: codeClientWidth,\n scrollLeft: codeScrollLeft,\n scrollWidth: codeScrollWidth,\n } = ref;\n\n return {\n horizontalOverflow: codeScrollWidth > codeClientWidth,\n codeClientWidth,\n codeScrollWidth,\n codeScrollLeft,\n };\n }\n /**\n * Handles `scroll` event.\n */\n private _handleScroll() {\n if (this) {\n const codeContainerRef = this?.shadowRoot?.querySelector(\n `.${prefix}--snippet-container`\n );\n const codeContentRef = codeContainerRef?.querySelector('pre');\n if (\n this.type === CODE_SNIPPET_TYPE.INLINE ||\n (this.type === CODE_SNIPPET_TYPE.SINGLE && !codeContainerRef) ||\n (this.type === CODE_SNIPPET_TYPE.MULTI && !codeContentRef)\n ) {\n return;\n }\n\n const {\n horizontalOverflow,\n codeClientWidth,\n codeScrollWidth,\n codeScrollLeft,\n } =\n this.type === CODE_SNIPPET_TYPE.SINGLE\n ? this._getCodeRefDimensions(codeContainerRef)\n : this._getCodeRefDimensions(codeContentRef);\n\n this._hasLeftOverflow = horizontalOverflow && !!codeScrollLeft;\n this._hasRightOverflow =\n horizontalOverflow &&\n codeScrollLeft + codeClientWidth !== codeScrollWidth;\n this.requestUpdate();\n }\n }\n\n /**\n * Handles `click` event on the show more or show less button.\n */\n private _handleClickExpanded() {\n this._expandedCode = !this._expandedCode;\n this.requestUpdate();\n }\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 codeContainerRef = this.shadowRoot?.querySelector(\n `.${prefix}--snippet-container`\n );\n const codeContentRef = codeContainerRef?.querySelector('code'); // PRE?\n const {\n type,\n maxCollapsedNumberOfRows,\n maxExpandedNumberOfRows,\n minExpandedNumberOfRows,\n _rowHeightInPixels: rowHeightInPixels,\n _handleScroll: handleScroll,\n } = this;\n if (codeContentRef && type === CODE_SNIPPET_TYPE.MULTI) {\n const { height } = codeContentRef.getBoundingClientRect();\n if (\n maxCollapsedNumberOfRows > 0 &&\n (maxExpandedNumberOfRows <= 0 ||\n maxExpandedNumberOfRows > maxCollapsedNumberOfRows) &&\n height > maxCollapsedNumberOfRows * rowHeightInPixels\n ) {\n this._shouldShowMoreLessBtn = true;\n } else {\n this._shouldShowMoreLessBtn = false;\n }\n if (\n this._expandedCode &&\n minExpandedNumberOfRows > 0 &&\n height <= minExpandedNumberOfRows * rowHeightInPixels\n ) {\n this._expandedCode = false;\n }\n }\n if (\n (codeContentRef && type === CODE_SNIPPET_TYPE.MULTI) ||\n (codeContainerRef && type === CODE_SNIPPET_TYPE.SINGLE)\n ) {\n handleScroll();\n }\n this.requestUpdate();\n });\n\n /**\n * Optional text to copy. If not specified, the `children` node's `innerText`\n * will be used as the copy value.\n */\n @property({ attribute: 'copy-text' })\n copyText = '';\n\n /**\n * `true` if the button should be disabled.\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Specify the string displayed when the snippet is copied\n */\n @property()\n feedback = 'Copied!';\n\n /**\n * Specify the time it takes for the feedback message to timeout\n */\n @property({ type: Number, attribute: 'feedback-timeout' })\n feedbackTimeout = 2000;\n\n /**\n * Specify whether or not a copy button should be used/rendered.\n */\n @property({ type: Boolean, reflect: true, attribute: 'hide-copy-button' })\n hideCopyButton = false;\n\n /**\n * Specify the maximum number of rows to be shown when in collapsed view\n */\n @property()\n maxCollapsedNumberOfRows = 15;\n\n /**\n * Specify the maximum number of rows to be shown when in expanded view\n */\n @property()\n maxExpandedNumberOfRows = 0;\n\n /**\n * Specify the minimum number of rows to be shown when in collapsed view\n */\n @property()\n minCollapsedNumberOfRows = 3;\n\n /**\n * Specify the minimum number of rows to be shown when in expanded view\n */\n @property()\n minExpandedNumberOfRows = 16;\n\n /**\n * Specify a string that is displayed when the Code Snippet has been\n * interacted with to show less lines\n */\n @property({ attribute: 'show-less-text' })\n showLessText = 'Show less';\n\n /**\n * Specify a string that is displayed when the Code Snippet text is more\n * than 15 lines\n */\n @property({ attribute: 'show-more-text' })\n showMoreText = 'Show more';\n\n /**\n * Tooltip content for the copy button.\n */\n @property({ attribute: 'tooltip-content' })\n tooltipContent = 'Copy to clipboard';\n\n /**\n * `true` if the button should be disabled.\n */\n @property({ type: Boolean, reflect: true, attribute: 'wrap-text' })\n wrapText = false;\n\n /**\n * The type of code snippet.\n */\n @property({ reflect: true })\n type = CODE_SNIPPET_TYPE.SINGLE;\n\n connectedCallback() {\n super.connectedCallback();\n if (this._hObserveResize) {\n this._hObserveResize = this._hObserveResize.release();\n }\n this._hObserveResize = observeResize(this._resizeObserver, this);\n }\n\n disconnectedCallback() {\n if (this._hObserveResize) {\n this._hObserveResize = this._hObserveResize.release();\n }\n }\n\n updated() {\n if (this._expandedCode) {\n this.setAttribute('expanded-code', '');\n } else {\n this.removeAttribute('expanded-code');\n }\n }\n\n render() {\n const {\n disabled,\n feedback,\n feedbackTimeout,\n hideCopyButton,\n maxExpandedNumberOfRows,\n minExpandedNumberOfRows,\n maxCollapsedNumberOfRows,\n minCollapsedNumberOfRows,\n type,\n wrapText,\n tooltipContent,\n showMoreText,\n showLessText,\n _expandedCode: expandedCode,\n _handleCopyClick: handleCopyClick,\n _handleScroll: handleScroll,\n _hasRightOverflow: hasRightOverflow,\n _hasLeftOverflow: hasLeftOverflow,\n _rowHeightInPixels: rowHeightInPixels,\n _shouldShowMoreLessBtn: shouldShowMoreLessBtn,\n } = this;\n\n let classes = `${prefix}--snippet`;\n\n if (type) {\n classes += ` ${prefix}--snippet--${type}`;\n }\n\n if (type !== 'inline' && disabled) {\n classes += ` ${prefix}--snippet--disabled`;\n }\n\n if (hideCopyButton) {\n classes += ` ${prefix}--snippet--no-copy`;\n }\n\n if (wrapText) {\n classes += ` ${prefix}--snippet--wraptext`;\n }\n\n if (type == 'multi' && hasRightOverflow) {\n classes += ` ${prefix}--snippet--has-right-overflow`;\n }\n\n const expandButtonClass = `${prefix}--snippet-btn--expand`;\n\n const disabledCopyButtonClasses = disabled\n ? `${prefix}--snippet--disabled`\n : '';\n\n const expandCodeBtnText = expandedCode ? showLessText : showMoreText;\n\n if (type === CODE_SNIPPET_TYPE.INLINE) {\n // Ensures no extra whitespace text node\n // prettier-ignore\n return html`\n <cds-custom-copy ?disabled=${disabled} button-class-name=\"${classes}\" @click=\"${handleCopyClick}\">\n <code slot=\"icon\"><slot></slot></code>\n <span slot=\"tooltip-content\">${tooltipContent}</span>\n </cds-custom-copy>\n `;\n }\n\n const styles = {};\n if (type === 'multi') {\n if (expandedCode) {\n if (maxExpandedNumberOfRows > 0) {\n styles['max-height'] =\n maxExpandedNumberOfRows * rowHeightInPixels + 'px';\n }\n if (minExpandedNumberOfRows > 0) {\n styles['min-height'] =\n minExpandedNumberOfRows * rowHeightInPixels + 'px';\n }\n } else {\n if (maxCollapsedNumberOfRows > 0) {\n styles['max-height'] =\n maxCollapsedNumberOfRows * rowHeightInPixels + 'px';\n }\n if (minCollapsedNumberOfRows > 0) {\n styles['min-height'] =\n minCollapsedNumberOfRows * rowHeightInPixels + 'px';\n }\n }\n }\n\n return html`\n <div\n role=\"${type === CODE_SNIPPET_TYPE.SINGLE ||\n type === CODE_SNIPPET_TYPE.MULTI\n ? 'textbox'\n : null}\"\n tabindex=\"${(type === CODE_SNIPPET_TYPE.SINGLE ||\n type === CODE_SNIPPET_TYPE.MULTI) &&\n !disabled\n ? 0\n : null}\"\n class=\"${prefix}--snippet-container\"\n aria-label=\"${'code-snippet'}\"\n aria-readonly=\"${type === CODE_SNIPPET_TYPE.SINGLE ||\n type === CODE_SNIPPET_TYPE.MULTI\n ? true\n : null}\"\n aria-multiline=\"${type === CODE_SNIPPET_TYPE.MULTI ? true : null}\"\n @scroll=\"${(type === CODE_SNIPPET_TYPE.SINGLE && handleScroll) || null}\"\n style=${styleMap(styles)}>\n <pre\n @scroll=\"${(type === CODE_SNIPPET_TYPE.MULTI && handleScroll) ||\n null}\"><code><slot></slot></code></pre>\n </div>\n\n ${hasLeftOverflow\n ? html`\n <div class=\"${prefix}--snippet__overflow-indicator--left\"></div>\n `\n : ``}\n ${hasRightOverflow && type !== CODE_SNIPPET_TYPE.MULTI\n ? html`\n <div class=\"${prefix}--snippet__overflow-indicator--right\"></div>\n `\n : ``}\n ${hideCopyButton\n ? ``\n : html`\n <cds-custom-copy-button\n ?disabled=${disabled}\n button-class-name=${disabledCopyButtonClasses}\n feedback=${feedback}\n feedback-timeout=${feedbackTimeout}\n @click=\"${handleCopyClick}\">\n ${tooltipContent}\n </cds-custom-copy-button>\n `}\n ${shouldShowMoreLessBtn\n ? html`\n <cds-custom-button\n kind=\"ghost\"\n size=\"sm\"\n button-class-name=${expandButtonClass}\n ?disabled=${disabled}\n @click=${() => this._handleClickExpanded()}>\n <span class=\"${prefix}--snippet-btn--text\">\n ${expandCodeBtnText}\n </span>\n ${iconLoader(ChevronDown16, {\n class: `${prefix}--icon-chevron--down ${prefix}--snippet__icon`,\n role: 'img',\n slot: 'icon',\n })}\n </cds-custom-button>\n `\n : ``}\n `;\n }\n\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n static styles = styles;\n}\n\nexport default CDSCodeSnippet;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BA,MAAM,iBAAiB,UAA0B,SAAkB;CACjE,IAAI,CAAC,MACH,OAAO;CAET,SAAS,QAAQ,IAAI;CACrB,OAAO,EACL,UAAU;EACR,SAAS,UAAU,IAAI;EACvB,OAAO;CACT,EACF;AACF;;;;;;AAOA,IAAA,iBAAA,MACM,uBAAuB,WAAW,UAAU,CAAC,CAAC;;;uBAI1B;yBAKiB;4BAKZ;2BAKD;0BAKD;gCAKM;yBAoGP,IAAI,qBAAqB;GACjD,MAAM,mBAAmB,KAAK,YAAY,cACxC,yBACF;GACA,MAAM,iBAAiB,kBAAkB,cAAc,MAAM;GAC7D,MAAM,EACJ,MACA,0BACA,yBACA,yBACA,oBAAoB,mBACpB,eAAe,iBACb;GACJ,IAAI,kBAAkB,SAAA,SAAkC;IACtD,MAAM,EAAE,WAAW,eAAe,sBAAsB;IACxD,IACE,2BAA2B,MAC1B,2BAA2B,KAC1B,0BAA0B,6BAC5B,SAAS,2BAA2B,mBAEpC,KAAK,yBAAyB;SAE9B,KAAK,yBAAyB;IAEhC,IACE,KAAK,iBACL,0BAA0B,KAC1B,UAAU,0BAA0B,mBAEpC,KAAK,gBAAgB;GAEzB;GACA,IACG,kBAAkB,SAAA,WAClB,oBAAoB,SAAA,UAErB,aAAa;GAEf,KAAK,cAAc;EACrB,CAAC;kBAOU;kBAMA;kBAMA;yBAMO;wBAMD;kCAMU;iCAMD;kCAMC;iCAMD;sBAOX;sBAOA;wBAME;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,2BAAA,KAAA,CAAA;YAMT,SAAS,CAAA,GAAA,eAAA,WAAA,4BAAA,KAAA,CAAA;YAMT,SAAS,CAAA,GAAA,eAAA,WAAA,2BAAA,KAAA,CAAA;YAOT,SAAS,EAAE,WAAW,iBAAiB,CAAC,CAAA,GAAA,eAAA,WAAA,gBAAA,KAAA,CAAA;YAOxC,SAAS,EAAE,WAAW,iBAAiB,CAAC,CAAA,GAAA,eAAA,WAAA,gBAAA,KAAA,CAAA;YAMxC,SAAS,EAAE,WAAW,kBAAkB,CAAC,CAAA,GAAA,eAAA,WAAA,kBAAA,KAAA,CAAA;YAMzC,SAAS;CAAE,MAAM;CAAS,SAAS;CAAM,WAAW;AAAY,CAAC,CAAA,GAAA,eAAA,WAAA,YAAA,KAAA,CAAA;YAMjE,SAAS,EAAE,SAAS,KAAK,CAAC,CAAA,GAAA,eAAA,WAAA,QAAA,KAAA,CAAA;6BAhQ5BC,cAAc,kBAAwB,CAAA,GAAA,cAAA;AA6bvC,IAAA,uBAAe"}
1
+ {"version":3,"file":"code-snippet.js","names":["styles","customElement"],"sources":["../../../src/components/code-snippet/code-snippet.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/** eslint-disable @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452 */\nimport { LitElement, html } from 'lit';\nimport { property, query } from 'lit/decorators.js';\nimport { prefix } from '../../globals/settings';\nimport ChevronDown16 from '@carbon/icons/es/chevron--down/16.js';\nimport FocusMixin from '../../globals/mixins/focus';\nimport { CODE_SNIPPET_COLOR_SCHEME, CODE_SNIPPET_TYPE } from './defs';\nimport styles from './code-snippet.scss?lit';\nimport Handle from '../../globals/internal/handle';\nimport '../copy-button/index';\nimport '../copy/copy';\nimport '../button/button';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\nimport { iconLoader } from '../../globals/internal/icon-loader';\n\nexport { CODE_SNIPPET_COLOR_SCHEME, CODE_SNIPPET_TYPE };\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 if (!elem) {\n return null;\n }\n observer.observe(elem);\n return {\n release() {\n observer.unobserve(elem);\n return null;\n },\n } as Handle;\n};\n\n/**\n * Basic code snippet.\n *\n * @element cds-custom-code-snippet\n */\n@customElement(`${prefix}-code-snippet`)\nclass CDSCodeSnippet extends FocusMixin(LitElement) {\n /**\n * The code snippet container element.\n */\n @query(`.${prefix}--snippet-container`)\n private _snippetContainer!: HTMLDivElement;\n\n /**\n * `true` to expand multi-line variant of code snippet.\n */\n private _expandedCode = false;\n\n /**\n * The handle for observing resize of the parent element of this element.\n */\n private _hObserveResize: Handle | null = null;\n\n /**\n * Row height in pixels\n */\n private _rowHeightInPixels = 16;\n\n /**\n * `true` if code-snippet has right overflow\n */\n private _hasRightOverflow = true;\n\n /**\n * `true` if code-snippet has left overflow\n */\n private _hasLeftOverflow = false;\n\n /**\n * `true` if show more or show less btn is visible\n */\n private _shouldShowMoreLessBtn = false;\n\n /**\n * Handles `click` event on the copy button.\n */\n private _handleCopyClick() {\n const { ownerDocument: doc } = this;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452\n const selection = doc!.defaultView!.getSelection();\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452\n selection!.removeAllRanges();\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452\n const code = doc!.createElement('code');\n code.className = `${prefix}--visually-hidden`;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452\n const pre = doc!.createElement('pre');\n const text = Array.from(this.childNodes).filter(\n (node) => node.nodeType === Node.TEXT_NODE\n );\n pre.textContent = this.copyText || text[0].textContent;\n code.appendChild(pre);\n // Using `<code>` in shadow DOM seems to lose the LFs in some browsers\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452\n doc!.body.appendChild(code);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452\n const range = doc!.createRange();\n range.selectNodeContents(code);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452\n selection!.addRange(range);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452\n doc!.execCommand('copy');\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452\n doc!.body.removeChild(code);\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452\n selection!.removeAllRanges();\n }\n\n private _getCodeRefDimensions(ref) {\n const {\n clientWidth: codeClientWidth,\n scrollLeft: codeScrollLeft,\n scrollWidth: codeScrollWidth,\n } = ref;\n\n return {\n horizontalOverflow: codeScrollWidth > codeClientWidth,\n codeClientWidth,\n codeScrollWidth,\n codeScrollLeft,\n };\n }\n /**\n * Handles `scroll` event.\n */\n private _handleScroll() {\n if (this) {\n const codeContainerRef = this._snippetContainer;\n const codeContentRef = codeContainerRef?.querySelector('pre');\n if (\n this.type === CODE_SNIPPET_TYPE.INLINE ||\n (this.type === CODE_SNIPPET_TYPE.SINGLE && !codeContainerRef) ||\n (this.type === CODE_SNIPPET_TYPE.MULTI && !codeContentRef)\n ) {\n return;\n }\n\n const {\n horizontalOverflow,\n codeClientWidth,\n codeScrollWidth,\n codeScrollLeft,\n } =\n this.type === CODE_SNIPPET_TYPE.SINGLE\n ? this._getCodeRefDimensions(codeContainerRef)\n : this._getCodeRefDimensions(codeContentRef);\n\n this._hasLeftOverflow = horizontalOverflow && !!codeScrollLeft;\n this._hasRightOverflow =\n horizontalOverflow &&\n codeScrollLeft + codeClientWidth !== codeScrollWidth;\n this.requestUpdate();\n }\n }\n\n /**\n * Handles `click` event on the show more or show less button.\n */\n private _handleClickExpanded() {\n this._expandedCode = !this._expandedCode;\n this.requestUpdate();\n }\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 codeContainerRef = this._snippetContainer;\n const codeContentRef = codeContainerRef?.querySelector('code'); // PRE?\n const {\n type,\n maxCollapsedNumberOfRows,\n maxExpandedNumberOfRows,\n minExpandedNumberOfRows,\n _rowHeightInPixels: rowHeightInPixels,\n _handleScroll: handleScroll,\n } = this;\n if (codeContentRef && type === CODE_SNIPPET_TYPE.MULTI) {\n const { height } = codeContentRef.getBoundingClientRect();\n if (\n maxCollapsedNumberOfRows > 0 &&\n (maxExpandedNumberOfRows <= 0 ||\n maxExpandedNumberOfRows > maxCollapsedNumberOfRows) &&\n height > maxCollapsedNumberOfRows * rowHeightInPixels\n ) {\n this._shouldShowMoreLessBtn = true;\n } else {\n this._shouldShowMoreLessBtn = false;\n }\n if (\n this._expandedCode &&\n minExpandedNumberOfRows > 0 &&\n height <= minExpandedNumberOfRows * rowHeightInPixels\n ) {\n this._expandedCode = false;\n }\n }\n if (\n (codeContentRef && type === CODE_SNIPPET_TYPE.MULTI) ||\n (codeContainerRef && type === CODE_SNIPPET_TYPE.SINGLE)\n ) {\n handleScroll();\n }\n this.requestUpdate();\n });\n\n /**\n * Optional text to copy. If not specified, the `children` node's `innerText`\n * will be used as the copy value.\n */\n @property({ attribute: 'copy-text' })\n copyText = '';\n\n /**\n * `true` if the button should be disabled.\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * Specify the string displayed when the snippet is copied\n */\n @property()\n feedback = 'Copied!';\n\n /**\n * Specify the time it takes for the feedback message to timeout\n */\n @property({ type: Number, attribute: 'feedback-timeout' })\n feedbackTimeout = 2000;\n\n /**\n * Specify whether or not a copy button should be used/rendered.\n */\n @property({ type: Boolean, reflect: true, attribute: 'hide-copy-button' })\n hideCopyButton = false;\n\n /**\n * Specify the maximum number of rows to be shown when in collapsed view\n */\n @property({ type: Number })\n maxCollapsedNumberOfRows = 15;\n\n /**\n * Specify the maximum number of rows to be shown when in expanded view\n */\n @property({ type: Number })\n maxExpandedNumberOfRows = 0;\n\n /**\n * Specify the minimum number of rows to be shown when in collapsed view\n */\n @property({ type: Number })\n minCollapsedNumberOfRows = 3;\n\n /**\n * Specify the minimum number of rows to be shown when in expanded view\n */\n @property({ type: Number })\n minExpandedNumberOfRows = 16;\n\n /**\n * Specify a string that is displayed when the Code Snippet has been\n * interacted with to show less lines\n */\n @property({ attribute: 'show-less-text' })\n showLessText = 'Show less';\n\n /**\n * Specify a string that is displayed when the Code Snippet text is more\n * than 15 lines\n */\n @property({ attribute: 'show-more-text' })\n showMoreText = 'Show more';\n\n /**\n * Tooltip content for the copy button.\n */\n @property({ attribute: 'tooltip-content' })\n tooltipContent = 'Copy to clipboard';\n\n /**\n * `true` if the button should be disabled.\n */\n @property({ type: Boolean, reflect: true, attribute: 'wrap-text' })\n wrapText = false;\n\n /**\n * The type of code snippet.\n */\n @property({ reflect: true })\n type = CODE_SNIPPET_TYPE.SINGLE;\n\n connectedCallback() {\n super.connectedCallback();\n if (this._hObserveResize) {\n this._hObserveResize = this._hObserveResize.release();\n }\n this._hObserveResize = observeResize(this._resizeObserver, this);\n }\n\n disconnectedCallback() {\n if (this._hObserveResize) {\n this._hObserveResize = this._hObserveResize.release();\n }\n }\n\n updated() {\n if (this._expandedCode) {\n this.setAttribute('expanded-code', '');\n } else {\n this.removeAttribute('expanded-code');\n }\n\n const { _snippetContainer: container } = this;\n if (!container) {\n return;\n }\n\n if (this.type === CODE_SNIPPET_TYPE.MULTI) {\n const {\n maxExpandedNumberOfRows,\n minExpandedNumberOfRows,\n maxCollapsedNumberOfRows,\n minCollapsedNumberOfRows,\n _expandedCode: expandedCode,\n _rowHeightInPixels: rowHeightInPixels,\n } = this;\n\n let maxHeight = '';\n let minHeight = '';\n\n if (expandedCode) {\n if (maxExpandedNumberOfRows > 0) {\n maxHeight = `${maxExpandedNumberOfRows * rowHeightInPixels}px`;\n }\n if (minExpandedNumberOfRows > 0) {\n minHeight = `${minExpandedNumberOfRows * rowHeightInPixels}px`;\n }\n } else {\n if (maxCollapsedNumberOfRows > 0) {\n maxHeight = `${maxCollapsedNumberOfRows * rowHeightInPixels}px`;\n }\n if (minCollapsedNumberOfRows > 0) {\n minHeight = `${minCollapsedNumberOfRows * rowHeightInPixels}px`;\n }\n }\n\n container.style.maxHeight = maxHeight;\n container.style.minHeight = minHeight;\n } else {\n container.style.maxHeight = '';\n container.style.minHeight = '';\n }\n }\n\n render() {\n const {\n disabled,\n feedback,\n feedbackTimeout,\n hideCopyButton,\n type,\n wrapText,\n tooltipContent,\n showMoreText,\n showLessText,\n _expandedCode: expandedCode,\n _handleCopyClick: handleCopyClick,\n _handleScroll: handleScroll,\n _hasRightOverflow: hasRightOverflow,\n _hasLeftOverflow: hasLeftOverflow,\n _shouldShowMoreLessBtn: shouldShowMoreLessBtn,\n } = this;\n\n let classes = `${prefix}--snippet`;\n\n if (type) {\n classes += ` ${prefix}--snippet--${type}`;\n }\n\n if (type !== 'inline' && disabled) {\n classes += ` ${prefix}--snippet--disabled`;\n }\n\n if (hideCopyButton) {\n classes += ` ${prefix}--snippet--no-copy`;\n }\n\n if (wrapText) {\n classes += ` ${prefix}--snippet--wraptext`;\n }\n\n if (type == 'multi' && hasRightOverflow) {\n classes += ` ${prefix}--snippet--has-right-overflow`;\n }\n\n const expandButtonClass = `${prefix}--snippet-btn--expand`;\n\n const disabledCopyButtonClasses = disabled\n ? `${prefix}--snippet--disabled`\n : '';\n\n const expandCodeBtnText = expandedCode ? showLessText : showMoreText;\n\n if (type === CODE_SNIPPET_TYPE.INLINE) {\n // Ensures no extra whitespace text node\n // prettier-ignore\n return html`\n <cds-custom-copy ?disabled=${disabled} button-class-name=\"${classes}\" @click=\"${handleCopyClick}\">\n <code slot=\"icon\"><slot></slot></code>\n <span slot=\"tooltip-content\">${tooltipContent}</span>\n </cds-custom-copy>\n `;\n }\n\n return html`\n <div\n role=\"${type === CODE_SNIPPET_TYPE.SINGLE ||\n type === CODE_SNIPPET_TYPE.MULTI\n ? 'textbox'\n : null}\"\n tabindex=\"${(type === CODE_SNIPPET_TYPE.SINGLE ||\n type === CODE_SNIPPET_TYPE.MULTI) &&\n !disabled\n ? 0\n : null}\"\n class=\"${prefix}--snippet-container\"\n aria-label=\"${'code-snippet'}\"\n aria-readonly=\"${type === CODE_SNIPPET_TYPE.SINGLE ||\n type === CODE_SNIPPET_TYPE.MULTI\n ? true\n : null}\"\n aria-multiline=\"${type === CODE_SNIPPET_TYPE.MULTI ? true : null}\"\n @scroll=\"${(type === CODE_SNIPPET_TYPE.SINGLE && handleScroll) ||\n null}\">\n <pre\n @scroll=\"${(type === CODE_SNIPPET_TYPE.MULTI && handleScroll) ||\n null}\"><code><slot></slot></code></pre>\n </div>\n\n ${hasLeftOverflow\n ? html`\n <div class=\"${prefix}--snippet__overflow-indicator--left\"></div>\n `\n : ``}\n ${hasRightOverflow && type !== CODE_SNIPPET_TYPE.MULTI\n ? html`\n <div class=\"${prefix}--snippet__overflow-indicator--right\"></div>\n `\n : ``}\n ${hideCopyButton\n ? ``\n : html`\n <cds-custom-copy-button\n ?disabled=${disabled}\n button-class-name=${disabledCopyButtonClasses}\n feedback=${feedback}\n feedback-timeout=${feedbackTimeout}\n @click=\"${handleCopyClick}\">\n ${tooltipContent}\n </cds-custom-copy-button>\n `}\n ${shouldShowMoreLessBtn\n ? html`\n <cds-custom-button\n kind=\"ghost\"\n size=\"sm\"\n button-class-name=${expandButtonClass}\n ?disabled=${disabled}\n @click=${() => this._handleClickExpanded()}>\n <span class=\"${prefix}--snippet-btn--text\">\n ${expandCodeBtnText}\n </span>\n ${iconLoader(ChevronDown16, {\n class: `${prefix}--icon-chevron--down ${prefix}--snippet__icon`,\n role: 'img',\n slot: 'icon',\n })}\n </cds-custom-button>\n `\n : ``}\n `;\n }\n\n static shadowRootOptions = {\n ...LitElement.shadowRootOptions,\n delegatesFocus: true,\n };\n static styles = styles;\n}\n\nexport default CDSCodeSnippet;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,MAAM,iBAAiB,UAA0B,SAAkB;CACjE,IAAI,CAAC,MACH,OAAO;CAET,SAAS,QAAQ,IAAI;CACrB,OAAO,EACL,UAAU;EACR,SAAS,UAAU,IAAI;EACvB,OAAO;CACT,EACF;AACF;;;;;;AAOA,IAAA,iBAAA,MACM,uBAAuB,WAAW,UAAU,CAAC,CAAC;;;uBAU1B;yBAKiB;4BAKZ;2BAKD;0BAKD;gCAKM;yBAkGP,IAAI,qBAAqB;GACjD,MAAM,mBAAmB,KAAK;GAC9B,MAAM,iBAAiB,kBAAkB,cAAc,MAAM;GAC7D,MAAM,EACJ,MACA,0BACA,yBACA,yBACA,oBAAoB,mBACpB,eAAe,iBACb;GACJ,IAAI,kBAAkB,SAAA,SAAkC;IACtD,MAAM,EAAE,WAAW,eAAe,sBAAsB;IACxD,IACE,2BAA2B,MAC1B,2BAA2B,KAC1B,0BAA0B,6BAC5B,SAAS,2BAA2B,mBAEpC,KAAK,yBAAyB;SAE9B,KAAK,yBAAyB;IAEhC,IACE,KAAK,iBACL,0BAA0B,KAC1B,UAAU,0BAA0B,mBAEpC,KAAK,gBAAgB;GAEzB;GACA,IACG,kBAAkB,SAAA,WAClB,oBAAoB,SAAA,UAErB,aAAa;GAEf,KAAK,cAAc;EACrB,CAAC;kBAOU;kBAMA;kBAMA;yBAMO;wBAMD;kCAMU;iCAMD;kCAMC;iCAMD;sBAOX;sBAOA;wBAME;kBAMN;;;;;;CApN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