@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.
- package/custom-elements.json +54 -1
- package/es/_virtual/{_@oxc-project_runtime@0.135.0 → _@oxc-project_runtime@0.139.0}/helpers/esm/decorate.js +2 -2
- package/es/components/accordion/accordion-item-skeleton.js +1 -1
- package/es/components/accordion/accordion-item.d.ts +4 -1
- package/es/components/accordion/accordion-item.d.ts.map +1 -1
- package/es/components/accordion/accordion-item.js +4 -7
- package/es/components/accordion/accordion-item.js.map +1 -1
- package/es/components/accordion/accordion-skeleton.d.ts +4 -1
- package/es/components/accordion/accordion-skeleton.d.ts.map +1 -1
- package/es/components/accordion/accordion-skeleton.js +5 -7
- package/es/components/accordion/accordion-skeleton.js.map +1 -1
- package/es/components/accordion/accordion.js +1 -1
- package/es/components/ai-label/ai-label-action-button.js +1 -1
- package/es/components/ai-label/ai-label.js +1 -1
- package/es/components/ai-label/ai-label.scss.js +1 -1
- package/es/components/ai-label/ai-label.scss.js.map +1 -1
- package/es/components/ai-skeleton/ai-skeleton-icon.js +1 -1
- package/es/components/ai-skeleton/ai-skeleton-placeholder.js +1 -1
- package/es/components/ai-skeleton/ai-skeleton-text.js +1 -1
- package/es/components/badge-indicator/badge-indicator.js +1 -1
- package/es/components/breadcrumb/breadcrumb-item.js +1 -1
- package/es/components/breadcrumb/breadcrumb-link.js +1 -1
- package/es/components/breadcrumb/breadcrumb-overflow-menu.js +1 -1
- package/es/components/breadcrumb/breadcrumb-skeleton.js +1 -1
- package/es/components/breadcrumb/breadcrumb.js +1 -1
- package/es/components/button/button-set-base.js +1 -1
- package/es/components/button/button-set.js +1 -1
- package/es/components/button/button-skeleton.js +3 -3
- package/es/components/button/button-skeleton.js.map +1 -1
- package/es/components/button/button.js +1 -1
- package/es/components/button/button.scss.js +1 -1
- package/es/components/chat-button/chat-button-skeleton.js +1 -1
- package/es/components/chat-button/chat-button.js +1 -1
- package/es/components/checkbox/checkbox-group.js +1 -1
- package/es/components/checkbox/checkbox-skeleton.js +1 -1
- package/es/components/checkbox/checkbox.js +1 -1
- package/es/components/code-snippet/code-snippet-skeleton.js +1 -1
- package/es/components/code-snippet/code-snippet.d.ts +11 -0
- package/es/components/code-snippet/code-snippet.d.ts.map +1 -1
- package/es/components/code-snippet/code-snippet.js +30 -20
- package/es/components/code-snippet/code-snippet.js.map +1 -1
- package/es/components/code-snippet/code-snippet.scss.js +1 -1
- package/es/components/combo-box/combo-box-item.js +1 -1
- package/es/components/combo-box/combo-box.d.ts.map +1 -1
- package/es/components/combo-box/combo-box.js +16 -12
- package/es/components/combo-box/combo-box.js.map +1 -1
- package/es/components/combo-button/combo-button.js +1 -1
- package/es/components/contained-list/contained-list-description.js +1 -1
- package/es/components/contained-list/contained-list-item.js +1 -1
- package/es/components/contained-list/contained-list.js +1 -1
- package/es/components/content-switcher/content-switcher-item.d.ts +4 -0
- package/es/components/content-switcher/content-switcher-item.d.ts.map +1 -1
- package/es/components/content-switcher/content-switcher-item.js +4 -3
- package/es/components/content-switcher/content-switcher-item.js.map +1 -1
- package/es/components/content-switcher/content-switcher.js +1 -1
- package/es/components/content-switcher/content-switcher.scss.js +1 -1
- package/es/components/content-switcher/content-switcher.scss.js.map +1 -1
- package/es/components/copy/copy.js +1 -1
- package/es/components/copy-button/copy-button.js +1 -1
- package/es/components/copy-button/copy-button.scss.js +1 -1
- package/es/components/data-table/table-batch-actions.js +1 -1
- package/es/components/data-table/table-body.js +1 -1
- package/es/components/data-table/table-cell-content.js +1 -1
- package/es/components/data-table/table-cell.js +1 -1
- package/es/components/data-table/table-expanded-row.js +1 -1
- package/es/components/data-table/table-head.js +1 -1
- package/es/components/data-table/table-header-cell.js +1 -1
- package/es/components/data-table/table-header-description.js +1 -1
- package/es/components/data-table/table-header-row.js +1 -1
- package/es/components/data-table/table-header-title.js +1 -1
- package/es/components/data-table/table-row.js +1 -1
- package/es/components/data-table/table-skeleton.js +1 -1
- package/es/components/data-table/table-toolbar-content.js +1 -1
- package/es/components/data-table/table-toolbar-search.js +1 -1
- package/es/components/data-table/table-toolbar.js +1 -1
- package/es/components/data-table/table.js +1 -1
- package/es/components/date-picker/date-picker-input-skeleton.js +1 -1
- package/es/components/date-picker/date-picker-input.js +1 -1
- package/es/components/date-picker/date-picker.js +1 -1
- package/es/components/dialog/dialog-body.js +1 -1
- package/es/components/dialog/dialog-close-button.js +1 -1
- package/es/components/dialog/dialog-controls.js +1 -1
- package/es/components/dialog/dialog-footer-button.js +1 -1
- package/es/components/dialog/dialog-footer.js +1 -1
- package/es/components/dialog/dialog-header.js +1 -1
- package/es/components/dialog/dialog-subtitle.js +1 -1
- package/es/components/dialog/dialog-title.js +1 -1
- package/es/components/dialog/dialog.js +1 -1
- package/es/components/dropdown/dropdown-item.js +1 -1
- package/es/components/dropdown/dropdown-skeleton.js +1 -1
- package/es/components/dropdown/dropdown.js +2 -2
- package/es/components/dropdown/dropdown.js.map +1 -1
- package/es/components/feature-flags/index.d.ts +39 -4
- package/es/components/feature-flags/index.d.ts.map +1 -1
- package/es/components/feature-flags/index.js +44 -7
- package/es/components/feature-flags/index.js.map +1 -1
- package/es/components/file-uploader/demo-file-uploader.js +1 -1
- package/es/components/file-uploader/file-uploader-button.js +1 -1
- package/es/components/file-uploader/file-uploader-drop-container.js +1 -1
- package/es/components/file-uploader/file-uploader-item.js +1 -1
- package/es/components/file-uploader/file-uploader-skeleton.js +1 -1
- package/es/components/file-uploader/file-uploader.js +1 -1
- package/es/components/floating-menu/floating-menu.js +1 -1
- package/es/components/fluid-combo-box/fluid-combo-box-skeleton.js +1 -1
- package/es/components/fluid-combo-box/fluid-combo-box.js +1 -1
- package/es/components/fluid-dropdown/fluid-dropdown-skeleton.js +1 -1
- package/es/components/fluid-dropdown/fluid-dropdown.js +1 -1
- package/es/components/fluid-form/fluid-form.js +1 -1
- package/es/components/fluid-multi-select/fluid-multi-select-skeleton.js +1 -1
- package/es/components/fluid-multi-select/fluid-multi-select.js +1 -1
- package/es/components/fluid-number-input/fluid-number-input-skeleton.js +1 -1
- package/es/components/fluid-number-input/fluid-number-input.js +1 -1
- package/es/components/fluid-password-input/fluid-password-input.js +1 -1
- package/es/components/fluid-search/fluid-search-skeleton.js +1 -1
- package/es/components/fluid-search/fluid-search.js +1 -1
- package/es/components/fluid-select/fluid-select-skeleton.js +1 -1
- package/es/components/fluid-select/fluid-select.js +1 -1
- package/es/components/fluid-text-input/fluid-text-input-skeleton.js +1 -1
- package/es/components/fluid-text-input/fluid-text-input.js +1 -1
- package/es/components/fluid-textarea/fluid-textarea-skeleton.js +1 -1
- package/es/components/fluid-textarea/fluid-textarea.js +1 -1
- package/es/components/fluid-time-picker/fluid-time-picker-select.js +1 -1
- package/es/components/fluid-time-picker/fluid-time-picker-skeleton.js +1 -1
- package/es/components/fluid-time-picker/fluid-time-picker.js +1 -1
- package/es/components/form/form-item.js +1 -1
- package/es/components/form/form.js +1 -1
- package/es/components/form-group/form-group.js +1 -1
- package/es/components/grid/column-hang.js +1 -1
- package/es/components/grid/column.js +1 -1
- package/es/components/grid/grid.js +1 -1
- package/es/components/heading/heading.js +1 -1
- package/es/components/icon/icon.js +1 -1
- package/es/components/icon-button/icon-button.js +1 -1
- package/es/components/icon-indicator/icon-indicator.js +1 -1
- package/es/components/inline-loading/inline-loading.js +1 -1
- package/es/components/layer/layer.js +1 -1
- package/es/components/layout/layout-constraint.js +1 -1
- package/es/components/layout/layout.js +1 -1
- package/es/components/link/link.js +1 -1
- package/es/components/list/list-item.js +1 -1
- package/es/components/list/ordered-list.js +1 -1
- package/es/components/list/unordered-list.js +1 -1
- package/es/components/loading/loading.js +1 -1
- package/es/components/menu/menu-item-divider.js +1 -1
- package/es/components/menu/menu-item-group.js +1 -1
- package/es/components/menu/menu-item-radio-group.js +1 -1
- package/es/components/menu/menu-item-selectable.js +1 -1
- package/es/components/menu/menu-item.js +1 -1
- package/es/components/menu/menu.js +1 -1
- package/es/components/menu-button/menu-button.js +1 -1
- package/es/components/modal/modal-base.js +1 -1
- package/es/components/modal/modal-body-content.js +1 -1
- package/es/components/modal/modal-body.js +1 -1
- package/es/components/modal/modal-close-button.js +1 -1
- package/es/components/modal/modal-footer-button.js +1 -1
- package/es/components/modal/modal-footer.js +1 -1
- package/es/components/modal/modal-header.js +1 -1
- package/es/components/modal/modal-heading.js +1 -1
- package/es/components/modal/modal-label.js +1 -1
- package/es/components/modal/modal.js +1 -1
- package/es/components/multi-select/multi-select-item.js +1 -1
- package/es/components/multi-select/multi-select.js +1 -1
- package/es/components/notification/actionable-notification-button.js +1 -1
- package/es/components/notification/actionable-notification.js +1 -1
- package/es/components/notification/actionable-notification.scss.js +1 -1
- package/es/components/notification/actionable-notification.scss.js.map +1 -1
- package/es/components/notification/callout-notification.js +1 -1
- package/es/components/notification/inline-notification.js +2 -2
- package/es/components/notification/inline-notification.js.map +1 -1
- package/es/components/notification/inline-notification.scss.js +1 -1
- package/es/components/notification/toast-notification.js +1 -1
- package/es/components/notification/toast-notification.scss.js +1 -1
- package/es/components/number-input/number-input-skeleton.js +1 -1
- package/es/components/number-input/number-input.js +1 -1
- package/es/components/overflow-menu/overflow-menu-body.js +1 -1
- package/es/components/overflow-menu/overflow-menu-item.js +1 -1
- package/es/components/overflow-menu/overflow-menu.js +2 -2
- package/es/components/overflow-menu/overflow-menu.js.map +1 -1
- package/es/components/page-header/page-header-breadcrumb.js +1 -1
- package/es/components/page-header/page-header-content-text.js +1 -1
- package/es/components/page-header/page-header-content.js +1 -1
- package/es/components/page-header/page-header-hero-image.js +1 -1
- package/es/components/page-header/page-header-tabs.js +1 -1
- package/es/components/page-header/page-header.js +1 -1
- package/es/components/pagination/pagination.js +1 -1
- package/es/components/pagination-nav/pagination-nav.js +1 -1
- package/es/components/password-input/password-input-skeleton.js +1 -1
- package/es/components/password-input/password-input.js +1 -1
- package/es/components/popover/popover-content.js +1 -1
- package/es/components/popover/popover.d.ts.map +1 -1
- package/es/components/popover/popover.js +20 -1
- package/es/components/popover/popover.js.map +1 -1
- package/es/components/progress-bar/progress-bar.js +1 -1
- package/es/components/progress-indicator/progress-indicator-skeleton.js +1 -1
- package/es/components/progress-indicator/progress-indicator.js +1 -1
- package/es/components/progress-indicator/progress-indicator.scss.js +1 -1
- package/es/components/progress-indicator/progress-step-skeleton.js +1 -1
- package/es/components/progress-indicator/progress-step.js +1 -1
- package/es/components/radio-button/radio-button-group.js +1 -1
- package/es/components/radio-button/radio-button-skeleton.js +1 -1
- package/es/components/radio-button/radio-button.js +1 -1
- package/es/components/search/search-skeleton.js +1 -1
- package/es/components/search/search.js +1 -1
- package/es/components/select/select-item-group.js +1 -1
- package/es/components/select/select-item.js +1 -1
- package/es/components/select/select-skeleton.js +1 -1
- package/es/components/select/select.js +1 -1
- package/es/components/shape-indicator/shape-indicator.js +1 -1
- package/es/components/side-panel/side-panel.js +5 -3
- package/es/components/side-panel/side-panel.js.map +1 -1
- package/es/components/skeleton-icon/skeleton-icon.js +1 -1
- package/es/components/skeleton-placeholder/skeleton-placeholder.js +1 -1
- package/es/components/skeleton-text/skeleton-text.js +1 -1
- package/es/components/skip-to-content/skip-to-content.js +1 -1
- package/es/components/slider/slider-input.js +1 -1
- package/es/components/slider/slider-skeleton.js +1 -1
- package/es/components/slider/slider.js +1 -1
- package/es/components/slug/slug-action-button.js +1 -1
- package/es/components/slug/slug.js +1 -1
- package/es/components/slug/slug.scss.js +1 -1
- package/es/components/stack/stack.js +1 -1
- package/es/components/structured-list/structured-list-body.js +1 -1
- package/es/components/structured-list/structured-list-cell.js +1 -1
- package/es/components/structured-list/structured-list-head.js +1 -1
- package/es/components/structured-list/structured-list-header-cell-skeleton.js +1 -1
- package/es/components/structured-list/structured-list-header-cell.js +1 -1
- package/es/components/structured-list/structured-list-header-row.js +1 -1
- package/es/components/structured-list/structured-list-row.js +1 -1
- package/es/components/structured-list/structured-list.js +1 -1
- package/es/components/tabs/stories/tabs-wrapper.js +1 -1
- package/es/components/tabs/tab-skeleton.js +1 -1
- package/es/components/tabs/tab.js +1 -1
- package/es/components/tabs/tabs-skeleton.js +1 -1
- package/es/components/tabs/tabs-vertical.js +1 -1
- package/es/components/tabs/tabs.js +2 -2
- package/es/components/tabs/tabs.js.map +1 -1
- package/es/components/tag/dismissible-tag.js +1 -1
- package/es/components/tag/operational-tag.js +1 -1
- package/es/components/tag/selectable-tag.js +1 -1
- package/es/components/tag/tag-skeleton.js +1 -1
- package/es/components/tag/tag.js +1 -1
- package/es/components/tearsheet/tearsheet.js +1 -1
- package/es/components/text-input/text-input-skeleton.js +1 -1
- package/es/components/text-input/text-input.js +1 -1
- package/es/components/textarea/textarea-skeleton.js +1 -1
- package/es/components/textarea/textarea.js +1 -1
- package/es/components/tile/clickable-tile.js +1 -1
- package/es/components/tile/expandable-tile.js +1 -1
- package/es/components/tile/radio-tile.js +1 -1
- package/es/components/tile/selectable-tile.js +1 -1
- package/es/components/tile/tile-group.js +1 -1
- package/es/components/tile/tile.js +1 -1
- package/es/components/time-picker/time-picker-select.js +1 -1
- package/es/components/time-picker/time-picker.js +1 -1
- package/es/components/toggle/toggle-skeleton.js +1 -1
- package/es/components/toggle/toggle.js +1 -1
- package/es/components/toggle-tip/toggletip.js +1 -1
- package/es/components/tooltip/definition-tooltip.js +1 -1
- package/es/components/tooltip/tooltip-content.js +1 -1
- package/es/components/tooltip/tooltip.js +1 -1
- package/es/components/tree-view/tree-node.js +1 -1
- package/es/components/tree-view/tree-view.js +1 -1
- package/es/components/ui-shell/header-global-action.js +1 -1
- package/es/components/ui-shell/header-menu-button.js +1 -1
- package/es/components/ui-shell/header-menu-item.js +1 -1
- package/es/components/ui-shell/header-menu.js +1 -1
- package/es/components/ui-shell/header-name.js +1 -1
- package/es/components/ui-shell/header-nav-item.js +1 -1
- package/es/components/ui-shell/header-nav.js +1 -1
- package/es/components/ui-shell/header-panel.js +1 -1
- package/es/components/ui-shell/header-side-nav-items.js +1 -1
- package/es/components/ui-shell/header.js +1 -1
- package/es/components/ui-shell/side-nav-divider.js +1 -1
- package/es/components/ui-shell/side-nav-items.js +1 -1
- package/es/components/ui-shell/side-nav-link.js +1 -1
- package/es/components/ui-shell/side-nav-menu-item.js +1 -1
- package/es/components/ui-shell/side-nav-menu.js +1 -1
- package/es/components/ui-shell/side-nav.js +1 -1
- package/es/components/ui-shell/switcher-divider.js +1 -1
- package/es/components/ui-shell/switcher-item.js +1 -1
- package/es/components/ui-shell/switcher.js +1 -1
- package/es/node_modules/flatpickr/dist/esm/l10n/default.js +1 -1
- package/es/packages/feature-flags/es/index.js +42 -2
- package/es/packages/feature-flags/es/index.js.map +1 -1
- package/es-custom/_virtual/{_@oxc-project_runtime@0.135.0 → _@oxc-project_runtime@0.139.0}/helpers/esm/decorate.js +2 -2
- package/es-custom/components/accordion/accordion-item-skeleton.js +1 -1
- package/es-custom/components/accordion/accordion-item.d.ts +4 -1
- package/es-custom/components/accordion/accordion-item.d.ts.map +1 -1
- package/es-custom/components/accordion/accordion-item.js +4 -7
- package/es-custom/components/accordion/accordion-item.js.map +1 -1
- package/es-custom/components/accordion/accordion-skeleton.d.ts +4 -1
- package/es-custom/components/accordion/accordion-skeleton.d.ts.map +1 -1
- package/es-custom/components/accordion/accordion-skeleton.js +5 -7
- package/es-custom/components/accordion/accordion-skeleton.js.map +1 -1
- package/es-custom/components/accordion/accordion.js +1 -1
- package/es-custom/components/ai-label/ai-label-action-button.js +1 -1
- package/es-custom/components/ai-label/ai-label.js +1 -1
- package/es-custom/components/ai-label/ai-label.scss.js +1 -1
- package/es-custom/components/ai-label/ai-label.scss.js.map +1 -1
- package/es-custom/components/ai-skeleton/ai-skeleton-icon.js +1 -1
- package/es-custom/components/ai-skeleton/ai-skeleton-placeholder.js +1 -1
- package/es-custom/components/ai-skeleton/ai-skeleton-text.js +1 -1
- package/es-custom/components/badge-indicator/badge-indicator.js +1 -1
- package/es-custom/components/breadcrumb/breadcrumb-item.js +1 -1
- package/es-custom/components/breadcrumb/breadcrumb-link.js +1 -1
- package/es-custom/components/breadcrumb/breadcrumb-overflow-menu.js +1 -1
- package/es-custom/components/breadcrumb/breadcrumb-skeleton.js +1 -1
- package/es-custom/components/breadcrumb/breadcrumb.js +1 -1
- package/es-custom/components/button/button-set-base.js +1 -1
- package/es-custom/components/button/button-set.js +1 -1
- package/es-custom/components/button/button-skeleton.js +3 -3
- package/es-custom/components/button/button-skeleton.js.map +1 -1
- package/es-custom/components/button/button.js +1 -1
- package/es-custom/components/button/button.scss.js +1 -1
- package/es-custom/components/chat-button/chat-button-skeleton.js +1 -1
- package/es-custom/components/chat-button/chat-button.js +1 -1
- package/es-custom/components/checkbox/checkbox-group.js +1 -1
- package/es-custom/components/checkbox/checkbox-skeleton.js +1 -1
- package/es-custom/components/checkbox/checkbox.js +1 -1
- package/es-custom/components/code-snippet/code-snippet-skeleton.js +1 -1
- package/es-custom/components/code-snippet/code-snippet.d.ts +11 -0
- package/es-custom/components/code-snippet/code-snippet.d.ts.map +1 -1
- package/es-custom/components/code-snippet/code-snippet.js +30 -20
- package/es-custom/components/code-snippet/code-snippet.js.map +1 -1
- package/es-custom/components/code-snippet/code-snippet.scss.js +1 -1
- package/es-custom/components/combo-box/combo-box-item.js +1 -1
- package/es-custom/components/combo-box/combo-box.d.ts.map +1 -1
- package/es-custom/components/combo-box/combo-box.js +16 -12
- package/es-custom/components/combo-box/combo-box.js.map +1 -1
- package/es-custom/components/combo-button/combo-button.js +1 -1
- package/es-custom/components/contained-list/contained-list-description.js +1 -1
- package/es-custom/components/contained-list/contained-list-item.js +1 -1
- package/es-custom/components/contained-list/contained-list.js +1 -1
- package/es-custom/components/content-switcher/content-switcher-item.d.ts +4 -0
- package/es-custom/components/content-switcher/content-switcher-item.d.ts.map +1 -1
- package/es-custom/components/content-switcher/content-switcher-item.js +4 -3
- package/es-custom/components/content-switcher/content-switcher-item.js.map +1 -1
- package/es-custom/components/content-switcher/content-switcher.js +1 -1
- package/es-custom/components/content-switcher/content-switcher.scss.js +1 -1
- package/es-custom/components/content-switcher/content-switcher.scss.js.map +1 -1
- package/es-custom/components/copy/copy.js +1 -1
- package/es-custom/components/copy-button/copy-button.js +1 -1
- package/es-custom/components/copy-button/copy-button.scss.js +1 -1
- package/es-custom/components/data-table/table-batch-actions.js +1 -1
- package/es-custom/components/data-table/table-body.js +1 -1
- package/es-custom/components/data-table/table-cell-content.js +1 -1
- package/es-custom/components/data-table/table-cell.js +1 -1
- package/es-custom/components/data-table/table-expanded-row.js +1 -1
- package/es-custom/components/data-table/table-head.js +1 -1
- package/es-custom/components/data-table/table-header-cell.js +1 -1
- package/es-custom/components/data-table/table-header-description.js +1 -1
- package/es-custom/components/data-table/table-header-row.js +1 -1
- package/es-custom/components/data-table/table-header-title.js +1 -1
- package/es-custom/components/data-table/table-row.js +1 -1
- package/es-custom/components/data-table/table-skeleton.js +1 -1
- package/es-custom/components/data-table/table-toolbar-content.js +1 -1
- package/es-custom/components/data-table/table-toolbar-search.js +1 -1
- package/es-custom/components/data-table/table-toolbar.js +1 -1
- package/es-custom/components/data-table/table.js +1 -1
- package/es-custom/components/date-picker/date-picker-input-skeleton.js +1 -1
- package/es-custom/components/date-picker/date-picker-input.js +1 -1
- package/es-custom/components/date-picker/date-picker.js +1 -1
- package/es-custom/components/dialog/dialog-body.js +1 -1
- package/es-custom/components/dialog/dialog-close-button.js +1 -1
- package/es-custom/components/dialog/dialog-controls.js +1 -1
- package/es-custom/components/dialog/dialog-footer-button.js +1 -1
- package/es-custom/components/dialog/dialog-footer.js +1 -1
- package/es-custom/components/dialog/dialog-header.js +1 -1
- package/es-custom/components/dialog/dialog-subtitle.js +1 -1
- package/es-custom/components/dialog/dialog-title.js +1 -1
- package/es-custom/components/dialog/dialog.js +1 -1
- package/es-custom/components/dropdown/dropdown-item.js +1 -1
- package/es-custom/components/dropdown/dropdown-skeleton.js +1 -1
- package/es-custom/components/dropdown/dropdown.js +2 -2
- package/es-custom/components/dropdown/dropdown.js.map +1 -1
- package/es-custom/components/feature-flags/index.d.ts +39 -4
- package/es-custom/components/feature-flags/index.d.ts.map +1 -1
- package/es-custom/components/feature-flags/index.js +44 -7
- package/es-custom/components/feature-flags/index.js.map +1 -1
- package/es-custom/components/file-uploader/demo-file-uploader.js +1 -1
- package/es-custom/components/file-uploader/file-uploader-button.js +1 -1
- package/es-custom/components/file-uploader/file-uploader-drop-container.js +1 -1
- package/es-custom/components/file-uploader/file-uploader-item.js +1 -1
- package/es-custom/components/file-uploader/file-uploader-skeleton.js +1 -1
- package/es-custom/components/file-uploader/file-uploader.js +1 -1
- package/es-custom/components/floating-menu/floating-menu.js +1 -1
- package/es-custom/components/fluid-combo-box/fluid-combo-box-skeleton.js +1 -1
- package/es-custom/components/fluid-combo-box/fluid-combo-box.js +1 -1
- package/es-custom/components/fluid-dropdown/fluid-dropdown-skeleton.js +1 -1
- package/es-custom/components/fluid-dropdown/fluid-dropdown.js +1 -1
- package/es-custom/components/fluid-form/fluid-form.js +1 -1
- package/es-custom/components/fluid-multi-select/fluid-multi-select-skeleton.js +1 -1
- package/es-custom/components/fluid-multi-select/fluid-multi-select.js +1 -1
- package/es-custom/components/fluid-number-input/fluid-number-input-skeleton.js +1 -1
- package/es-custom/components/fluid-number-input/fluid-number-input.js +1 -1
- package/es-custom/components/fluid-password-input/fluid-password-input.js +1 -1
- package/es-custom/components/fluid-search/fluid-search-skeleton.js +1 -1
- package/es-custom/components/fluid-search/fluid-search.js +1 -1
- package/es-custom/components/fluid-select/fluid-select-skeleton.js +1 -1
- package/es-custom/components/fluid-select/fluid-select.js +1 -1
- package/es-custom/components/fluid-text-input/fluid-text-input-skeleton.js +1 -1
- package/es-custom/components/fluid-text-input/fluid-text-input.js +1 -1
- package/es-custom/components/fluid-textarea/fluid-textarea-skeleton.js +1 -1
- package/es-custom/components/fluid-textarea/fluid-textarea.js +1 -1
- package/es-custom/components/fluid-time-picker/fluid-time-picker-select.js +1 -1
- package/es-custom/components/fluid-time-picker/fluid-time-picker-skeleton.js +1 -1
- package/es-custom/components/fluid-time-picker/fluid-time-picker.js +1 -1
- package/es-custom/components/form/form-item.js +1 -1
- package/es-custom/components/form/form.js +1 -1
- package/es-custom/components/form-group/form-group.js +1 -1
- package/es-custom/components/grid/column-hang.js +1 -1
- package/es-custom/components/grid/column.js +1 -1
- package/es-custom/components/grid/grid.js +1 -1
- package/es-custom/components/heading/heading.js +1 -1
- package/es-custom/components/icon/icon.js +1 -1
- package/es-custom/components/icon-button/icon-button.js +1 -1
- package/es-custom/components/icon-indicator/icon-indicator.js +1 -1
- package/es-custom/components/inline-loading/inline-loading.js +1 -1
- package/es-custom/components/layer/layer.js +1 -1
- package/es-custom/components/layout/layout-constraint.js +1 -1
- package/es-custom/components/layout/layout.js +1 -1
- package/es-custom/components/link/link.js +1 -1
- package/es-custom/components/list/list-item.js +1 -1
- package/es-custom/components/list/ordered-list.js +1 -1
- package/es-custom/components/list/unordered-list.js +1 -1
- package/es-custom/components/loading/loading.js +1 -1
- package/es-custom/components/menu/menu-item-divider.js +1 -1
- package/es-custom/components/menu/menu-item-group.js +1 -1
- package/es-custom/components/menu/menu-item-radio-group.js +1 -1
- package/es-custom/components/menu/menu-item-selectable.js +1 -1
- package/es-custom/components/menu/menu-item.js +1 -1
- package/es-custom/components/menu/menu.js +1 -1
- package/es-custom/components/menu-button/menu-button.js +1 -1
- package/es-custom/components/modal/modal-base.js +1 -1
- package/es-custom/components/modal/modal-body-content.js +1 -1
- package/es-custom/components/modal/modal-body.js +1 -1
- package/es-custom/components/modal/modal-close-button.js +1 -1
- package/es-custom/components/modal/modal-footer-button.js +1 -1
- package/es-custom/components/modal/modal-footer.js +1 -1
- package/es-custom/components/modal/modal-header.js +1 -1
- package/es-custom/components/modal/modal-heading.js +1 -1
- package/es-custom/components/modal/modal-label.js +1 -1
- package/es-custom/components/modal/modal.js +1 -1
- package/es-custom/components/multi-select/multi-select-item.js +1 -1
- package/es-custom/components/multi-select/multi-select.js +1 -1
- package/es-custom/components/notification/actionable-notification-button.js +1 -1
- package/es-custom/components/notification/actionable-notification.js +1 -1
- package/es-custom/components/notification/actionable-notification.scss.js +1 -1
- package/es-custom/components/notification/actionable-notification.scss.js.map +1 -1
- package/es-custom/components/notification/callout-notification.js +1 -1
- package/es-custom/components/notification/inline-notification.js +2 -2
- package/es-custom/components/notification/inline-notification.js.map +1 -1
- package/es-custom/components/notification/inline-notification.scss.js +1 -1
- package/es-custom/components/notification/toast-notification.js +1 -1
- package/es-custom/components/notification/toast-notification.scss.js +1 -1
- package/es-custom/components/number-input/number-input-skeleton.js +1 -1
- package/es-custom/components/number-input/number-input.js +1 -1
- package/es-custom/components/overflow-menu/overflow-menu-body.js +1 -1
- package/es-custom/components/overflow-menu/overflow-menu-item.js +1 -1
- package/es-custom/components/overflow-menu/overflow-menu.js +2 -2
- package/es-custom/components/overflow-menu/overflow-menu.js.map +1 -1
- package/es-custom/components/page-header/page-header-breadcrumb.js +1 -1
- package/es-custom/components/page-header/page-header-content-text.js +1 -1
- package/es-custom/components/page-header/page-header-content.js +1 -1
- package/es-custom/components/page-header/page-header-hero-image.js +1 -1
- package/es-custom/components/page-header/page-header-tabs.js +1 -1
- package/es-custom/components/page-header/page-header.js +1 -1
- package/es-custom/components/pagination/pagination.js +1 -1
- package/es-custom/components/pagination-nav/pagination-nav.js +1 -1
- package/es-custom/components/password-input/password-input-skeleton.js +1 -1
- package/es-custom/components/password-input/password-input.js +1 -1
- package/es-custom/components/popover/popover-content.js +1 -1
- package/es-custom/components/popover/popover.d.ts.map +1 -1
- package/es-custom/components/popover/popover.js +20 -1
- package/es-custom/components/popover/popover.js.map +1 -1
- package/es-custom/components/progress-bar/progress-bar.js +1 -1
- package/es-custom/components/progress-indicator/progress-indicator-skeleton.js +1 -1
- package/es-custom/components/progress-indicator/progress-indicator.js +1 -1
- package/es-custom/components/progress-indicator/progress-indicator.scss.js +1 -1
- package/es-custom/components/progress-indicator/progress-step-skeleton.js +1 -1
- package/es-custom/components/progress-indicator/progress-step.js +1 -1
- package/es-custom/components/radio-button/radio-button-group.js +1 -1
- package/es-custom/components/radio-button/radio-button-skeleton.js +1 -1
- package/es-custom/components/radio-button/radio-button.js +1 -1
- package/es-custom/components/search/search-skeleton.js +1 -1
- package/es-custom/components/search/search.js +1 -1
- package/es-custom/components/select/select-item-group.js +1 -1
- package/es-custom/components/select/select-item.js +1 -1
- package/es-custom/components/select/select-skeleton.js +1 -1
- package/es-custom/components/select/select.js +1 -1
- package/es-custom/components/shape-indicator/shape-indicator.js +1 -1
- package/es-custom/components/side-panel/side-panel.js +5 -3
- package/es-custom/components/side-panel/side-panel.js.map +1 -1
- package/es-custom/components/skeleton-icon/skeleton-icon.js +1 -1
- package/es-custom/components/skeleton-placeholder/skeleton-placeholder.js +1 -1
- package/es-custom/components/skeleton-text/skeleton-text.js +1 -1
- package/es-custom/components/skip-to-content/skip-to-content.js +1 -1
- package/es-custom/components/slider/slider-input.js +1 -1
- package/es-custom/components/slider/slider-skeleton.js +1 -1
- package/es-custom/components/slider/slider.js +1 -1
- package/es-custom/components/slug/slug-action-button.js +1 -1
- package/es-custom/components/slug/slug.js +1 -1
- package/es-custom/components/slug/slug.scss.js +1 -1
- package/es-custom/components/stack/stack.js +1 -1
- package/es-custom/components/structured-list/structured-list-body.js +1 -1
- package/es-custom/components/structured-list/structured-list-cell.js +1 -1
- package/es-custom/components/structured-list/structured-list-head.js +1 -1
- package/es-custom/components/structured-list/structured-list-header-cell-skeleton.js +1 -1
- package/es-custom/components/structured-list/structured-list-header-cell.js +1 -1
- package/es-custom/components/structured-list/structured-list-header-row.js +1 -1
- package/es-custom/components/structured-list/structured-list-row.js +1 -1
- package/es-custom/components/structured-list/structured-list.js +1 -1
- package/es-custom/components/tabs/stories/tabs-wrapper.js +1 -1
- package/es-custom/components/tabs/tab-skeleton.js +1 -1
- package/es-custom/components/tabs/tab.js +1 -1
- package/es-custom/components/tabs/tabs-skeleton.js +1 -1
- package/es-custom/components/tabs/tabs-vertical.js +1 -1
- package/es-custom/components/tabs/tabs.js +2 -2
- package/es-custom/components/tabs/tabs.js.map +1 -1
- package/es-custom/components/tag/dismissible-tag.js +1 -1
- package/es-custom/components/tag/operational-tag.js +1 -1
- package/es-custom/components/tag/selectable-tag.js +1 -1
- package/es-custom/components/tag/tag-skeleton.js +1 -1
- package/es-custom/components/tag/tag.js +1 -1
- package/es-custom/components/tearsheet/tearsheet.js +1 -1
- package/es-custom/components/text-input/text-input-skeleton.js +1 -1
- package/es-custom/components/text-input/text-input.js +1 -1
- package/es-custom/components/textarea/textarea-skeleton.js +1 -1
- package/es-custom/components/textarea/textarea.js +1 -1
- package/es-custom/components/tile/clickable-tile.js +1 -1
- package/es-custom/components/tile/expandable-tile.js +1 -1
- package/es-custom/components/tile/radio-tile.js +1 -1
- package/es-custom/components/tile/selectable-tile.js +1 -1
- package/es-custom/components/tile/tile-group.js +1 -1
- package/es-custom/components/tile/tile.js +1 -1
- package/es-custom/components/time-picker/time-picker-select.js +1 -1
- package/es-custom/components/time-picker/time-picker.js +1 -1
- package/es-custom/components/toggle/toggle-skeleton.js +1 -1
- package/es-custom/components/toggle/toggle.js +1 -1
- package/es-custom/components/toggle-tip/toggletip.js +1 -1
- package/es-custom/components/tooltip/definition-tooltip.js +1 -1
- package/es-custom/components/tooltip/tooltip-content.js +1 -1
- package/es-custom/components/tooltip/tooltip.js +1 -1
- package/es-custom/components/tree-view/tree-node.js +1 -1
- package/es-custom/components/tree-view/tree-view.js +1 -1
- package/es-custom/components/ui-shell/header-global-action.js +1 -1
- package/es-custom/components/ui-shell/header-menu-button.js +1 -1
- package/es-custom/components/ui-shell/header-menu-item.js +1 -1
- package/es-custom/components/ui-shell/header-menu.js +1 -1
- package/es-custom/components/ui-shell/header-name.js +1 -1
- package/es-custom/components/ui-shell/header-nav-item.js +1 -1
- package/es-custom/components/ui-shell/header-nav.js +1 -1
- package/es-custom/components/ui-shell/header-panel.js +1 -1
- package/es-custom/components/ui-shell/header-side-nav-items.js +1 -1
- package/es-custom/components/ui-shell/header.js +1 -1
- package/es-custom/components/ui-shell/side-nav-divider.js +1 -1
- package/es-custom/components/ui-shell/side-nav-items.js +1 -1
- package/es-custom/components/ui-shell/side-nav-link.js +1 -1
- package/es-custom/components/ui-shell/side-nav-menu-item.js +1 -1
- package/es-custom/components/ui-shell/side-nav-menu.js +1 -1
- package/es-custom/components/ui-shell/side-nav.js +1 -1
- package/es-custom/components/ui-shell/switcher-divider.js +1 -1
- package/es-custom/components/ui-shell/switcher-item.js +1 -1
- package/es-custom/components/ui-shell/switcher.js +1 -1
- package/es-custom/node_modules/flatpickr/dist/esm/l10n/default.js +1 -1
- package/es-custom/packages/feature-flags/es/index.js +42 -2
- package/es-custom/packages/feature-flags/es/index.js.map +1 -1
- package/lib/components/accordion/accordion-item.d.ts +4 -1
- package/lib/components/accordion/accordion-item.d.ts.map +1 -1
- package/lib/components/accordion/accordion-skeleton.d.ts +4 -1
- package/lib/components/accordion/accordion-skeleton.d.ts.map +1 -1
- package/lib/components/code-snippet/code-snippet.d.ts +11 -0
- package/lib/components/code-snippet/code-snippet.d.ts.map +1 -1
- package/lib/components/combo-box/combo-box.d.ts.map +1 -1
- package/lib/components/content-switcher/content-switcher-item.d.ts +4 -0
- package/lib/components/content-switcher/content-switcher-item.d.ts.map +1 -1
- package/lib/components/feature-flags/index.d.ts +39 -4
- package/lib/components/feature-flags/index.d.ts.map +1 -1
- package/lib/components/popover/popover.d.ts.map +1 -1
- package/package.json +7 -7
- package/scss/components/ai-label/ai-label.scss +7 -5
- package/scss/components/content-switcher/content-switcher.scss +14 -7
- package/scss/components/notification/actionable-notification.scss +11 -4
- 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
|
|
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
|
|
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
|
|
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
|
|
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":"
|
|
1
|
+
{"version":3,"file":"code-snippet.d.ts","sourceRoot":"","sources":["../../../src/components/code-snippet/code-snippet.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,8HAA8H;AAC9H,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;IAEH,OAAO,CAAC,iBAAiB,CAAkB;IAE3C;;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;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
|
|
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.
|
|
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
|
|
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,
|
|
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,IAC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CAAC,CAAA,GAAA,eAAA,WAAA,mBAAA,KAAA,CAAA;YAMxD,SAAS;CAAE,MAAM;CAAS,SAAS;CAAM,WAAW;AAAmB,CAAC,CAAA,GAAA,eAAA,WAAA,kBAAA,KAAA,CAAA;YAMxE,SAAS,CAAA,GAAA,eAAA,WAAA,4BAAA,KAAA,CAAA;YAMT,SAAS,CAAA,GAAA,eAAA,WAAA,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,i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