@carbon/web-components 2.39.1 → 2.40.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 +115 -50
- package/dist/accordion.min.js +2 -2
- package/dist/ai-label.min.js +2 -2
- package/dist/ai-skeleton.min.js +2 -2
- package/dist/badge-indicator.min.js +2 -2
- package/dist/breadcrumb.min.js +8 -8
- package/dist/button-Co3aPX0Y.js +93 -0
- package/dist/{button-skeleton-DdBk5C_N.js → button-skeleton-DKiPqzwa.js} +2 -2
- package/dist/button.min.js +2 -2
- package/dist/chat-button.min.js +4 -4
- package/dist/{checkbox-DIG0hVuh.js → checkbox-DVx3ui3h.js} +2 -2
- package/dist/checkbox.min.js +2 -2
- package/dist/{class-map-n49vbqqp.js → class-map-CJoc5JjN.js} +2 -2
- package/dist/code-snippet.min.js +14 -14
- package/dist/combo-box.min.js +2 -2
- package/dist/combo-button.min.js +3 -3
- package/dist/content-switcher-item-BDJMJLCb.js +54 -0
- package/dist/content-switcher.min.js +2 -2
- package/dist/copy-button.min.js +2 -2
- package/dist/data-table.min.js +2 -2
- package/dist/date-picker.min.js +2 -2
- package/dist/{dropdown-item-PvWtkb2E.js → dropdown-item-B6uTaLa3.js} +2 -2
- package/dist/dropdown.min.js +2 -2
- package/dist/feature-flags.min.js +2 -2
- package/dist/file-uploader.min.js +8 -8
- package/dist/floating-menu.min.js +2 -2
- package/dist/fluid-text-input.min.js +2 -2
- package/dist/{focus-CAqkEBYM.js → focus-JSuV9CsT.js} +2 -2
- package/dist/{form-BNblI_Op.js → form-BaYTr2z0.js} +2 -2
- package/dist/form-group.min.js +2 -2
- package/dist/form.min.js +2 -2
- package/dist/grid.min.js +2 -2
- package/dist/heading.min.js +2 -2
- package/dist/{host-listener-mPtggheY.js → host-listener-BJsBtsIt.js} +2 -2
- package/dist/icon-button.min.js +2 -2
- package/dist/icon-indicator.min.js +2 -2
- package/dist/{icon-loader-3bNrhxYK.js → icon-loader-CqB9WRMP.js} +2 -2
- package/dist/{icon-loader-utils-C4QltTKl.js → icon-loader-utils-DUl0vwdh.js} +2 -2
- package/dist/icon.min.js +2 -2
- package/dist/{if-defined-exabhQMq.js → if-defined-IxozbDOJ.js} +2 -2
- package/dist/{if-non-empty-DV7gZi2W.js → if-non-empty-CqQHBHdQ.js} +2 -2
- package/dist/inline-loading.min.js +2 -2
- package/dist/layer.min.js +2 -2
- package/dist/link.min.js +2 -2
- package/dist/list.min.js +2 -2
- package/dist/{loading-icon-CIx9N4-w.js → loading-icon-DCf6kyWs.js} +2 -2
- package/dist/loading.min.js +2 -2
- package/dist/menu-button.min.js +3 -3
- package/dist/menu.min.js +2 -2
- package/dist/modal.min.js +9 -9
- package/dist/multi-select.min.js +2 -2
- package/dist/notification.min.js +4 -4
- package/dist/number-input.min.js +2 -2
- package/dist/overflow-menu.min.js +3 -3
- package/dist/page-header.min.js +2 -2
- package/dist/pagination.min.js +17 -25
- package/dist/password-input.min.js +2 -2
- package/dist/popover.min.js +2 -2
- package/dist/progress-bar.min.js +2 -2
- package/dist/progress-indicator.min.js +16 -10
- package/dist/{property-lZbmspq2.js → property-B_F7V5eB.js} +2 -2
- package/dist/{query-assigned-elements-DkjA2wnD.js → query-assigned-elements-DeMmXVMb.js} +2 -2
- package/dist/radio-button.min.js +2 -2
- package/dist/{search-xhqtCabY.js → search-DRY-RtlJ.js} +2 -2
- package/dist/search.min.js +2 -2
- package/dist/{select-CL5lr0mN.js → select-9WcKYA1M.js} +17 -16
- package/dist/select.min.js +2 -2
- package/dist/shape-indicator.min.js +2 -2
- package/dist/side-panel.min.js +2 -2
- package/dist/skeleton-icon.min.js +2 -2
- package/dist/skeleton-placeholder.min.js +2 -2
- package/dist/skeleton-text.min.js +2 -2
- package/dist/skip-to-content.min.js +2 -2
- package/dist/slider.min.js +2 -2
- package/dist/slug.min.js +2 -2
- package/dist/stack.min.js +2 -2
- package/dist/{state-CocwM4nH.js → state-CJQmj6wG.js} +2 -2
- package/dist/structured-list.min.js +2 -2
- package/dist/tabs.min.js +6 -6
- package/dist/tag.min.js +17 -17
- package/dist/tearsheet.min.js +2 -2
- package/dist/{text-input-rzf9bVlH.js → text-input-B80oQMaX.js} +2 -2
- package/dist/text-input.min.js +2 -2
- package/dist/textarea.min.js +2 -2
- package/dist/tile.min.js +2 -2
- package/dist/time-picker.min.js +2 -2
- package/dist/toggle-tip.min.js +4 -4
- package/dist/toggle.min.js +5 -5
- package/dist/tooltip-content-BZBP-szv.js +30 -0
- package/dist/tooltip.min.js +2 -2
- package/dist/tree-view.min.js +2 -2
- package/dist/ui-shell.min.js +2 -2
- package/dist/{unsafe-html-B5l1xysL.js → unsafe-html-Dqv0UqC_.js} +2 -2
- package/es/components/accordion/accordion-item.js +4 -4
- package/es/components/accordion/accordion-item.js.map +1 -1
- package/es/components/accordion/accordion-skeleton.js +3 -3
- package/es/components/accordion/accordion-skeleton.js.map +1 -1
- package/es/components/accordion/accordion.js +1 -1
- package/es/components/accordion/accordion.js.map +1 -1
- package/es/components/ai-label/ai-label.js +2 -2
- package/es/components/ai-label/ai-label.js.map +1 -1
- package/es/components/ai-label/ai-label.scss.js +1 -1
- package/es/components/breadcrumb/breadcrumb-item.js +1 -1
- package/es/components/breadcrumb/breadcrumb-item.js.map +1 -1
- package/es/components/breadcrumb/breadcrumb.js +1 -1
- package/es/components/breadcrumb/breadcrumb.js.map +1 -1
- package/es/components/breadcrumb/breadcrumb.scss.js +1 -1
- package/es/components/button/button.js +7 -7
- package/es/components/button/button.js.map +1 -1
- package/es/components/button/button.scss.js +1 -1
- package/es/components/chat-button/chat-button.js +1 -1
- package/es/components/chat-button/chat-button.js.map +1 -1
- package/es/components/chat-button/chat-button.scss.js +1 -1
- package/es/components/checkbox/checkbox.js +1 -1
- package/es/components/checkbox/checkbox.js.map +1 -1
- package/es/components/code-snippet/code-snippet.js +16 -16
- 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.js +7 -7
- package/es/components/combo-box/combo-box.js.map +1 -1
- package/es/components/combo-button/combo-button.js +2 -2
- package/es/components/combo-button/combo-button.js.map +1 -1
- package/es/components/combo-button/combo-button.scss.js +1 -1
- package/es/components/combo-button/defs.d.ts +4 -0
- package/es/components/combo-button/defs.js +4 -0
- package/es/components/combo-button/defs.js.map +1 -1
- package/es/components/content-switcher/content-switcher.js +2 -2
- package/es/components/content-switcher/content-switcher.js.map +1 -1
- package/es/components/content-switcher/content-switcher.scss.js +1 -1
- package/es/components/copy/copy.js +2 -2
- package/es/components/copy/copy.js.map +1 -1
- package/es/components/copy-button/copy-button.scss.js +1 -1
- package/es/components/data-table/data-table.scss.js +1 -1
- package/es/components/data-table/table-expanded-row.js +2 -2
- package/es/components/data-table/table-expanded-row.js.map +1 -1
- package/es/components/data-table/table-row.js +2 -2
- package/es/components/data-table/table-row.js.map +1 -1
- package/es/components/data-table/table.js +20 -20
- package/es/components/data-table/table.js.map +1 -1
- package/es/components/date-picker/append-to-plugin.js +3 -3
- package/es/components/date-picker/append-to-plugin.js.map +1 -1
- package/es/components/date-picker/css-class-plugin.js +2 -2
- package/es/components/date-picker/css-class-plugin.js.map +1 -1
- package/es/components/date-picker/date-picker-input.js +1 -1
- package/es/components/date-picker/date-picker-input.js.map +1 -1
- package/es/components/date-picker/date-picker.js +5 -5
- package/es/components/date-picker/date-picker.js.map +1 -1
- package/es/components/date-picker/fix-events-plugin.js +1 -1
- package/es/components/date-picker/fix-events-plugin.js.map +1 -1
- package/es/components/date-picker/range-plugin.js +2 -2
- package/es/components/date-picker/range-plugin.js.map +1 -1
- package/es/components/date-picker/shadow-dom-events-plugin.js +10 -10
- package/es/components/date-picker/shadow-dom-events-plugin.js.map +1 -1
- package/es/components/dropdown/dropdown-item.js +1 -1
- package/es/components/dropdown/dropdown-item.js.map +1 -1
- package/es/components/dropdown/dropdown.js +8 -8
- package/es/components/dropdown/dropdown.js.map +1 -1
- package/es/components/feature-flags/index.d.ts +4 -0
- package/es/components/feature-flags/index.js +20 -9
- package/es/components/feature-flags/index.js.map +1 -1
- package/es/components/file-uploader/file-uploader-drop-container.js +1 -1
- package/es/components/file-uploader/file-uploader-drop-container.js.map +1 -1
- package/es/components/file-uploader/file-uploader.scss.js +1 -1
- package/es/components/floating-menu/floating-menu.js +9 -9
- package/es/components/floating-menu/floating-menu.js.map +1 -1
- package/es/components/icon-button/icon-button.scss.js +1 -1
- package/es/components/link/link.js +2 -2
- package/es/components/link/link.js.map +1 -1
- package/es/components/menu/menu-context.js.map +1 -1
- package/es/components/menu/menu-item.js +1 -1
- package/es/components/menu/menu-item.js.map +1 -1
- package/es/components/menu/menu.js +1 -1
- package/es/components/menu/menu.js.map +1 -1
- package/es/components/menu-button/menu-button.js +2 -2
- package/es/components/menu-button/menu-button.js.map +1 -1
- package/es/components/menu-button/menu-button.scss.js +1 -1
- package/es/components/modal/modal.js +8 -8
- package/es/components/modal/modal.js.map +1 -1
- package/es/components/modal/modal.scss.js +1 -1
- package/es/components/multi-select/multi-select.js +8 -8
- package/es/components/multi-select/multi-select.js.map +1 -1
- package/es/components/notification/actionable-notification-button.js +1 -1
- package/es/components/notification/actionable-notification-button.js.map +1 -1
- package/es/components/notification/actionable-notification.js +5 -5
- package/es/components/notification/actionable-notification.js.map +1 -1
- package/es/components/notification/actionable-notification.scss.js +1 -1
- package/es/components/notification/inline-notification.scss.js +1 -1
- package/es/components/notification/toast-notification.scss.js +1 -1
- package/es/components/overflow-menu/defs.d.ts +4 -0
- package/es/components/overflow-menu/defs.js +4 -0
- package/es/components/overflow-menu/defs.js.map +1 -1
- package/es/components/overflow-menu/overflow-menu-body.js +2 -2
- package/es/components/overflow-menu/overflow-menu-body.js.map +1 -1
- package/es/components/overflow-menu/overflow-menu.js +4 -8
- package/es/components/overflow-menu/overflow-menu.js.map +1 -1
- package/es/components/overflow-menu/overflow-menu.scss.js +1 -1
- package/es/components/page-header/page-header-tabs.js.map +1 -1
- package/es/components/page-header/page-header.js.map +1 -1
- package/es/components/pagination/pagination.d.ts +1 -1
- package/es/components/pagination/pagination.js +86 -56
- package/es/components/pagination/pagination.js.map +1 -1
- package/es/components/pagination/pagination.scss.js +1 -1
- package/es/components/popover/popover.js +2 -2
- package/es/components/popover/popover.js.map +1 -1
- package/es/components/popover/popover.scss.js +1 -1
- package/es/components/progress-bar/progress-bar.js +1 -1
- package/es/components/progress-bar/progress-bar.js.map +1 -1
- package/es/components/progress-indicator/progress-indicator.d.ts +16 -2
- package/es/components/progress-indicator/progress-indicator.js +75 -4
- package/es/components/progress-indicator/progress-indicator.js.map +1 -1
- package/es/components/progress-indicator/progress-indicator.scss.js +1 -1
- package/es/components/progress-indicator/progress-step.d.ts +34 -9
- package/es/components/progress-indicator/progress-step.js +100 -16
- package/es/components/progress-indicator/progress-step.js.map +1 -1
- package/es/components/radio-button/radio-button-group.js +1 -1
- package/es/components/radio-button/radio-button-group.js.map +1 -1
- package/es/components/radio-button/radio-button.js +5 -5
- package/es/components/radio-button/radio-button.js.map +1 -1
- package/es/components/search/search.js +4 -4
- package/es/components/search/search.js.map +1 -1
- package/es/components/select/select.js +15 -8
- package/es/components/select/select.js.map +1 -1
- package/es/components/select/select.scss.js +1 -1
- package/es/components/side-panel/side-panel.js +6 -6
- package/es/components/side-panel/side-panel.js.map +1 -1
- package/es/components/skip-to-content/skip-to-content.scss.js +1 -1
- package/es/components/slider/slider.js +7 -7
- package/es/components/slider/slider.js.map +1 -1
- package/es/components/slug/slug.js +2 -2
- package/es/components/slug/slug.js.map +1 -1
- package/es/components/slug/slug.scss.js +1 -1
- package/es/components/structured-list/structured-list-row.js +2 -2
- package/es/components/structured-list/structured-list-row.js.map +1 -1
- package/es/components/structured-list/structured-list.js +1 -1
- package/es/components/structured-list/structured-list.js.map +1 -1
- package/es/components/tabs/tabs.js +12 -12
- package/es/components/tabs/tabs.js.map +1 -1
- package/es/components/tabs/tabs.scss.js +1 -1
- package/es/components/tag/dismissible-tag.js +2 -2
- package/es/components/tag/dismissible-tag.js.map +1 -1
- package/es/components/tag/operational-tag.js +2 -2
- package/es/components/tag/operational-tag.js.map +1 -1
- package/es/components/tag/selectable-tag.js +2 -2
- package/es/components/tag/selectable-tag.js.map +1 -1
- package/es/components/tag/tag.js +2 -2
- package/es/components/tag/tag.js.map +1 -1
- package/es/components/tag/tag.scss.js +1 -1
- package/es/components/tearsheet/tearsheet.js +10 -10
- package/es/components/tearsheet/tearsheet.js.map +1 -1
- package/es/components/tile/clickable-tile.js +1 -1
- package/es/components/tile/clickable-tile.js.map +1 -1
- package/es/components/tile/expandable-tile.js +2 -2
- package/es/components/tile/expandable-tile.js.map +1 -1
- package/es/components/tile/tile-group.js +2 -2
- package/es/components/tile/tile-group.js.map +1 -1
- package/es/components/time-picker/time-picker-select.js +1 -1
- package/es/components/time-picker/time-picker-select.js.map +1 -1
- package/es/components/time-picker/time-picker.js +2 -2
- package/es/components/time-picker/time-picker.js.map +1 -1
- package/es/components/toggle/toggle.d.ts +20 -3
- package/es/components/toggle/toggle.js +47 -10
- package/es/components/toggle/toggle.js.map +1 -1
- package/es/components/toggle/toggle.scss.js +1 -1
- package/es/components/toggle-tip/toggletip.js +3 -3
- package/es/components/toggle-tip/toggletip.js.map +1 -1
- package/es/components/toggle-tip/toggletip.scss.js +1 -1
- package/es/components/tooltip/tooltip.js +4 -4
- package/es/components/tooltip/tooltip.js.map +1 -1
- package/es/components/tooltip/tooltip.scss.js +1 -1
- package/es/components/tree-view/tree-node.js +1 -1
- package/es/components/tree-view/tree-node.js.map +1 -1
- package/es/components/tree-view/tree-view.js +7 -7
- package/es/components/tree-view/tree-view.js.map +1 -1
- package/es/components/ui-shell/header-global-action.js +3 -3
- package/es/components/ui-shell/header-global-action.js.map +1 -1
- package/es/components/ui-shell/header-menu.js +2 -2
- package/es/components/ui-shell/header-menu.js.map +1 -1
- package/es/components/ui-shell/header.scss.js +1 -1
- package/es/components/ui-shell/side-nav.js +1 -1
- package/es/components/ui-shell/side-nav.js.map +1 -1
- package/es/globals/controllers/floating-controller.js +2 -2
- package/es/globals/controllers/floating-controller.js.map +1 -1
- package/es/globals/decorators/carbon-element.js +4 -4
- package/es/globals/decorators/carbon-element.js.map +1 -1
- package/es/globals/decorators/host-listener.js +2 -2
- package/es/globals/decorators/host-listener.js.map +1 -1
- package/es/globals/internal/collection-helpers.js +4 -4
- package/es/globals/internal/collection-helpers.js.map +1 -1
- package/es/globals/internal/feature-flags.js +2 -2
- package/es/globals/internal/feature-flags.js.map +1 -1
- package/es/globals/mixins/focus.js +2 -2
- package/es/globals/mixins/focus.js.map +1 -1
- package/es/globals/mixins/host-listener.js +1 -1
- package/es/globals/mixins/host-listener.js.map +1 -1
- package/es/globals/mixins/on.js +1 -1
- package/es/globals/mixins/on.js.map +1 -1
- package/es-custom/components/accordion/accordion-item.js +4 -4
- package/es-custom/components/accordion/accordion-item.js.map +1 -1
- package/es-custom/components/accordion/accordion-skeleton.js +3 -3
- package/es-custom/components/accordion/accordion-skeleton.js.map +1 -1
- package/es-custom/components/accordion/accordion.js +1 -1
- package/es-custom/components/accordion/accordion.js.map +1 -1
- package/es-custom/components/ai-label/ai-label.js +2 -2
- package/es-custom/components/ai-label/ai-label.js.map +1 -1
- package/es-custom/components/ai-label/ai-label.scss.js +1 -1
- package/es-custom/components/breadcrumb/breadcrumb-item.js +1 -1
- package/es-custom/components/breadcrumb/breadcrumb-item.js.map +1 -1
- package/es-custom/components/breadcrumb/breadcrumb.js +1 -1
- package/es-custom/components/breadcrumb/breadcrumb.js.map +1 -1
- package/es-custom/components/breadcrumb/breadcrumb.scss.js +1 -1
- package/es-custom/components/button/button.js +7 -7
- package/es-custom/components/button/button.js.map +1 -1
- package/es-custom/components/button/button.scss.js +1 -1
- package/es-custom/components/chat-button/chat-button.js +1 -1
- package/es-custom/components/chat-button/chat-button.js.map +1 -1
- package/es-custom/components/chat-button/chat-button.scss.js +1 -1
- package/es-custom/components/checkbox/checkbox.js +1 -1
- package/es-custom/components/checkbox/checkbox.js.map +1 -1
- package/es-custom/components/code-snippet/code-snippet.js +16 -16
- 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.js +7 -7
- package/es-custom/components/combo-box/combo-box.js.map +1 -1
- package/es-custom/components/combo-button/combo-button.js +2 -2
- package/es-custom/components/combo-button/combo-button.js.map +1 -1
- package/es-custom/components/combo-button/combo-button.scss.js +1 -1
- package/es-custom/components/combo-button/defs.d.ts +4 -0
- package/es-custom/components/combo-button/defs.js +4 -0
- package/es-custom/components/combo-button/defs.js.map +1 -1
- package/es-custom/components/content-switcher/content-switcher.js +2 -2
- package/es-custom/components/content-switcher/content-switcher.js.map +1 -1
- package/es-custom/components/content-switcher/content-switcher.scss.js +1 -1
- package/es-custom/components/copy/copy.js +2 -2
- package/es-custom/components/copy/copy.js.map +1 -1
- package/es-custom/components/copy-button/copy-button.scss.js +1 -1
- package/es-custom/components/data-table/data-table.scss.js +1 -1
- package/es-custom/components/data-table/table-expanded-row.js +2 -2
- package/es-custom/components/data-table/table-expanded-row.js.map +1 -1
- package/es-custom/components/data-table/table-row.js +2 -2
- package/es-custom/components/data-table/table-row.js.map +1 -1
- package/es-custom/components/data-table/table.js +20 -20
- package/es-custom/components/data-table/table.js.map +1 -1
- package/es-custom/components/date-picker/append-to-plugin.js +3 -3
- package/es-custom/components/date-picker/append-to-plugin.js.map +1 -1
- package/es-custom/components/date-picker/css-class-plugin.js +2 -2
- package/es-custom/components/date-picker/css-class-plugin.js.map +1 -1
- package/es-custom/components/date-picker/date-picker-input.js +1 -1
- package/es-custom/components/date-picker/date-picker-input.js.map +1 -1
- package/es-custom/components/date-picker/date-picker.js +5 -5
- package/es-custom/components/date-picker/date-picker.js.map +1 -1
- package/es-custom/components/date-picker/fix-events-plugin.js +1 -1
- package/es-custom/components/date-picker/fix-events-plugin.js.map +1 -1
- package/es-custom/components/date-picker/range-plugin.js +2 -2
- package/es-custom/components/date-picker/range-plugin.js.map +1 -1
- package/es-custom/components/date-picker/shadow-dom-events-plugin.js +10 -10
- package/es-custom/components/date-picker/shadow-dom-events-plugin.js.map +1 -1
- package/es-custom/components/dropdown/dropdown-item.js +1 -1
- package/es-custom/components/dropdown/dropdown-item.js.map +1 -1
- package/es-custom/components/dropdown/dropdown.js +8 -8
- package/es-custom/components/dropdown/dropdown.js.map +1 -1
- package/es-custom/components/feature-flags/index.d.ts +4 -0
- package/es-custom/components/feature-flags/index.js +20 -9
- package/es-custom/components/feature-flags/index.js.map +1 -1
- package/es-custom/components/file-uploader/file-uploader-drop-container.js +1 -1
- package/es-custom/components/file-uploader/file-uploader-drop-container.js.map +1 -1
- package/es-custom/components/file-uploader/file-uploader.scss.js +1 -1
- package/es-custom/components/floating-menu/floating-menu.js +9 -9
- package/es-custom/components/floating-menu/floating-menu.js.map +1 -1
- package/es-custom/components/icon-button/icon-button.scss.js +1 -1
- package/es-custom/components/link/link.js +2 -2
- package/es-custom/components/link/link.js.map +1 -1
- package/es-custom/components/menu/menu-context.js.map +1 -1
- package/es-custom/components/menu/menu-item.js +1 -1
- package/es-custom/components/menu/menu-item.js.map +1 -1
- package/es-custom/components/menu/menu.js +1 -1
- package/es-custom/components/menu/menu.js.map +1 -1
- package/es-custom/components/menu-button/menu-button.js +2 -2
- package/es-custom/components/menu-button/menu-button.js.map +1 -1
- package/es-custom/components/menu-button/menu-button.scss.js +1 -1
- package/es-custom/components/modal/modal.js +8 -8
- package/es-custom/components/modal/modal.js.map +1 -1
- package/es-custom/components/modal/modal.scss.js +1 -1
- package/es-custom/components/multi-select/multi-select.js +8 -8
- package/es-custom/components/multi-select/multi-select.js.map +1 -1
- package/es-custom/components/notification/actionable-notification-button.js +1 -1
- package/es-custom/components/notification/actionable-notification-button.js.map +1 -1
- package/es-custom/components/notification/actionable-notification.js +5 -5
- package/es-custom/components/notification/actionable-notification.js.map +1 -1
- package/es-custom/components/notification/actionable-notification.scss.js +1 -1
- package/es-custom/components/notification/inline-notification.scss.js +1 -1
- package/es-custom/components/notification/toast-notification.scss.js +1 -1
- package/es-custom/components/overflow-menu/defs.d.ts +4 -0
- package/es-custom/components/overflow-menu/defs.js +4 -0
- package/es-custom/components/overflow-menu/defs.js.map +1 -1
- package/es-custom/components/overflow-menu/overflow-menu-body.js +2 -2
- package/es-custom/components/overflow-menu/overflow-menu-body.js.map +1 -1
- package/es-custom/components/overflow-menu/overflow-menu.js +4 -8
- package/es-custom/components/overflow-menu/overflow-menu.js.map +1 -1
- package/es-custom/components/overflow-menu/overflow-menu.scss.js +1 -1
- package/es-custom/components/page-header/page-header-tabs.js.map +1 -1
- package/es-custom/components/page-header/page-header.js.map +1 -1
- package/es-custom/components/pagination/pagination.d.ts +1 -1
- package/es-custom/components/pagination/pagination.js +86 -56
- package/es-custom/components/pagination/pagination.js.map +1 -1
- package/es-custom/components/pagination/pagination.scss.js +1 -1
- package/es-custom/components/popover/popover.js +2 -2
- package/es-custom/components/popover/popover.js.map +1 -1
- package/es-custom/components/popover/popover.scss.js +1 -1
- package/es-custom/components/progress-bar/progress-bar.js +1 -1
- package/es-custom/components/progress-bar/progress-bar.js.map +1 -1
- package/es-custom/components/progress-indicator/progress-indicator.d.ts +16 -2
- package/es-custom/components/progress-indicator/progress-indicator.js +75 -4
- package/es-custom/components/progress-indicator/progress-indicator.js.map +1 -1
- package/es-custom/components/progress-indicator/progress-indicator.scss.js +1 -1
- package/es-custom/components/progress-indicator/progress-step.d.ts +34 -9
- package/es-custom/components/progress-indicator/progress-step.js +100 -16
- package/es-custom/components/progress-indicator/progress-step.js.map +1 -1
- package/es-custom/components/radio-button/radio-button-group.js +1 -1
- package/es-custom/components/radio-button/radio-button-group.js.map +1 -1
- package/es-custom/components/radio-button/radio-button.js +5 -5
- package/es-custom/components/radio-button/radio-button.js.map +1 -1
- package/es-custom/components/search/search.js +4 -4
- package/es-custom/components/search/search.js.map +1 -1
- package/es-custom/components/select/select.js +15 -8
- package/es-custom/components/select/select.js.map +1 -1
- package/es-custom/components/select/select.scss.js +1 -1
- package/es-custom/components/side-panel/side-panel.js +6 -6
- package/es-custom/components/side-panel/side-panel.js.map +1 -1
- package/es-custom/components/skip-to-content/skip-to-content.scss.js +1 -1
- package/es-custom/components/slider/slider.js +7 -7
- package/es-custom/components/slider/slider.js.map +1 -1
- package/es-custom/components/slug/slug.js +2 -2
- package/es-custom/components/slug/slug.js.map +1 -1
- package/es-custom/components/slug/slug.scss.js +1 -1
- package/es-custom/components/structured-list/structured-list-row.js +2 -2
- package/es-custom/components/structured-list/structured-list-row.js.map +1 -1
- package/es-custom/components/structured-list/structured-list.js +1 -1
- package/es-custom/components/structured-list/structured-list.js.map +1 -1
- package/es-custom/components/tabs/tabs.js +12 -12
- package/es-custom/components/tabs/tabs.js.map +1 -1
- package/es-custom/components/tabs/tabs.scss.js +1 -1
- package/es-custom/components/tag/dismissible-tag.js +2 -2
- package/es-custom/components/tag/dismissible-tag.js.map +1 -1
- package/es-custom/components/tag/operational-tag.js +2 -2
- package/es-custom/components/tag/operational-tag.js.map +1 -1
- package/es-custom/components/tag/selectable-tag.js +2 -2
- package/es-custom/components/tag/selectable-tag.js.map +1 -1
- package/es-custom/components/tag/tag.js +2 -2
- package/es-custom/components/tag/tag.js.map +1 -1
- package/es-custom/components/tag/tag.scss.js +1 -1
- package/es-custom/components/tearsheet/tearsheet.js +10 -10
- package/es-custom/components/tearsheet/tearsheet.js.map +1 -1
- package/es-custom/components/tile/clickable-tile.js +1 -1
- package/es-custom/components/tile/clickable-tile.js.map +1 -1
- package/es-custom/components/tile/expandable-tile.js +2 -2
- package/es-custom/components/tile/expandable-tile.js.map +1 -1
- package/es-custom/components/tile/tile-group.js +2 -2
- package/es-custom/components/tile/tile-group.js.map +1 -1
- package/es-custom/components/time-picker/time-picker-select.js +1 -1
- package/es-custom/components/time-picker/time-picker-select.js.map +1 -1
- package/es-custom/components/time-picker/time-picker.js +2 -2
- package/es-custom/components/time-picker/time-picker.js.map +1 -1
- package/es-custom/components/toggle/toggle.d.ts +20 -3
- package/es-custom/components/toggle/toggle.js +47 -10
- package/es-custom/components/toggle/toggle.js.map +1 -1
- package/es-custom/components/toggle/toggle.scss.js +1 -1
- package/es-custom/components/toggle-tip/toggletip.js +3 -3
- package/es-custom/components/toggle-tip/toggletip.js.map +1 -1
- package/es-custom/components/toggle-tip/toggletip.scss.js +1 -1
- package/es-custom/components/tooltip/tooltip.js +4 -4
- package/es-custom/components/tooltip/tooltip.js.map +1 -1
- package/es-custom/components/tooltip/tooltip.scss.js +1 -1
- package/es-custom/components/tree-view/tree-node.js +1 -1
- package/es-custom/components/tree-view/tree-node.js.map +1 -1
- package/es-custom/components/tree-view/tree-view.js +7 -7
- package/es-custom/components/tree-view/tree-view.js.map +1 -1
- package/es-custom/components/ui-shell/header-global-action.js +3 -3
- package/es-custom/components/ui-shell/header-global-action.js.map +1 -1
- package/es-custom/components/ui-shell/header-menu.js +2 -2
- package/es-custom/components/ui-shell/header-menu.js.map +1 -1
- package/es-custom/components/ui-shell/header.scss.js +1 -1
- package/es-custom/components/ui-shell/side-nav.js +1 -1
- package/es-custom/components/ui-shell/side-nav.js.map +1 -1
- package/es-custom/globals/controllers/floating-controller.js +2 -2
- package/es-custom/globals/controllers/floating-controller.js.map +1 -1
- package/es-custom/globals/decorators/carbon-element.js +4 -4
- package/es-custom/globals/decorators/carbon-element.js.map +1 -1
- package/es-custom/globals/decorators/host-listener.js +2 -2
- package/es-custom/globals/decorators/host-listener.js.map +1 -1
- package/es-custom/globals/internal/collection-helpers.js +4 -4
- package/es-custom/globals/internal/collection-helpers.js.map +1 -1
- package/es-custom/globals/internal/feature-flags.js +2 -2
- package/es-custom/globals/internal/feature-flags.js.map +1 -1
- package/es-custom/globals/mixins/focus.js +2 -2
- package/es-custom/globals/mixins/focus.js.map +1 -1
- package/es-custom/globals/mixins/host-listener.js +1 -1
- package/es-custom/globals/mixins/host-listener.js.map +1 -1
- package/es-custom/globals/mixins/on.js +1 -1
- package/es-custom/globals/mixins/on.js.map +1 -1
- package/lib/components/combo-button/defs.d.ts +4 -0
- package/lib/components/combo-button/defs.js +4 -0
- package/lib/components/combo-button/defs.js.map +1 -1
- package/lib/components/feature-flags/index.d.ts +4 -0
- package/lib/components/overflow-menu/defs.d.ts +4 -0
- package/lib/components/overflow-menu/defs.js +4 -0
- package/lib/components/overflow-menu/defs.js.map +1 -1
- package/lib/components/pagination/pagination.d.ts +1 -1
- package/lib/components/progress-indicator/progress-indicator.d.ts +16 -2
- package/lib/components/progress-indicator/progress-step.d.ts +34 -9
- package/lib/components/toggle/toggle.d.ts +20 -3
- package/lib/globals/controllers/floating-controller.js +2 -2
- package/lib/globals/controllers/floating-controller.js.map +1 -1
- package/package.json +7 -7
- package/scss/components/button/button.scss +1 -1
- package/scss/components/overflow-menu/overflow-menu.scss +13 -0
- package/scss/components/progress-indicator/progress-indicator.scss +27 -6
- package/scss/components/select/select.scss +1 -0
- package/scss/components/toggle/toggle.scss +7 -0
- package/telemetry.yml +7 -9
- package/dist/button-CZUc-YJY.js +0 -93
- package/dist/content-switcher-item-BwX297Wt.js +0 -54
- package/dist/tooltip-content-Dpafcwrj.js +0 -30
- package/dist/{16-mnk48Km_.js → 16-B3Yskhl0.js} +1 -1
- package/dist/{16-Dm1C38gy.js → 16-B46MLj4i.js} +1 -1
- package/dist/{16-D7S2mZfx.js → 16-B7MRS_3W.js} +1 -1
- package/dist/{16-D5qURVFK.js → 16-BWlgPBcu.js} +1 -1
- package/dist/{16-_VZZTjD5.js → 16-Bf2P7KMJ.js} +1 -1
- package/dist/{16-CsCwHiDB.js → 16-Bxm7Omxq.js} +1 -1
- package/dist/{16-CBMBwbRd.js → 16-CJNlj_0b.js} +1 -1
- package/dist/{16-CUSZxKi3.js → 16-CdxGkvXO.js} +1 -1
- package/dist/{16-CpQfhph0.js → 16-DTvjc9uv.js} +1 -1
- package/dist/{16-qteMrX0q.js → 16-DhAznVKm.js} +1 -1
- package/dist/{16-CvYO9Wcs.js → 16-DoN7q01_.js} +1 -1
- package/dist/{16-CDsZibnu.js → 16-GKRs-ALp.js} +1 -1
- package/dist/{20-CxH6T12Q.js → 20-CuEbZLGA.js} +1 -1
- package/dist/{20-D2L4OBED.js → 20-DlknbFYR.js} +1 -1
- package/dist/{carbon-element-Bz4hUejX.js → carbon-element-DDrYm3XO.js} +1 -1
- package/dist/{collection-helpers-rDLReFyQ.js → collection-helpers-BslvaZFE.js} +1 -1
- package/dist/{consume-D-Uxx41O.js → consume-BeeFGGfo.js} +1 -1
- package/dist/{defs-B8Ti5atv.js → defs-CBJRLDfw.js} +1 -1
- package/dist/{directive-BnmT0ewj.js → directive-Dlo2OKiC.js} +1 -1
- package/dist/{floating-controller-C6KWPbMX.js → floating-controller-CnuSelc_.js} +1 -1
- package/dist/{host-listener-DtqTZPgM.js → host-listener-BCnAWDV7.js} +1 -1
- package/dist/{lit-element-ClYpehYk.js → lit-element-eFlPHqE1.js} +1 -1
- package/dist/{on-DsfjLQFb.js → on-DvnWS_DB.js} +1 -1
- package/dist/{query-C6TAHe0V.js → query-BdmT5Ln1.js} +1 -1
- package/dist/{radio-group-manager-dJ3qt5K5.js → radio-group-manager-B_pENWmT.js} +1 -1
- package/dist/{settings-BPpYX8TV.js → settings-FSuH8xHs.js} +1 -1
- package/dist/{shared-enums-DUU0Uftc.js → shared-enums-D8TrS6Ts.js} +1 -1
- package/dist/{validity-j3foP4ed.js → validity-BUGyJDQ6.js} +1 -1
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* @type {boolean}
|
|
21
21
|
*/
|
|
22
22
|
const CDS_FLAGS_ALL =
|
|
23
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
24
24
|
process.env.CDS_FLAGS_ALL === 'true' || false;
|
|
25
25
|
/**
|
|
26
26
|
* Enables experimental component
|
|
@@ -28,7 +28,7 @@ process.env.CDS_FLAGS_ALL === 'true' || false;
|
|
|
28
28
|
* @type {boolean}
|
|
29
29
|
*/
|
|
30
30
|
const CDS_EXPERIEMENTAL_COMPONENT_NAME =
|
|
31
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/
|
|
31
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
32
32
|
process.env.CDS_EXPERIEMENTAL_COMPONENT_NAME === 'true' ||
|
|
33
33
|
CDS_FLAGS_ALL ||
|
|
34
34
|
false;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feature-flags.js","sources":["../../../src/globals/internal/feature-flags.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2023\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\n/**\n * This file contains the list of the default values of compile-time feature flags.\n */\n\n/**\n * This flag will determine if all feature flags should be enabled\n *\n * @type {boolean}\n */\nexport const CDS_FLAGS_ALL: boolean =\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/
|
|
1
|
+
{"version":3,"file":"feature-flags.js","sources":["../../../src/globals/internal/feature-flags.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2023\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\n/**\n * This file contains the list of the default values of compile-time feature flags.\n */\n\n/**\n * This flag will determine if all feature flags should be enabled\n *\n * @type {boolean}\n */\nexport const CDS_FLAGS_ALL: boolean =\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452\n process!.env.CDS_FLAGS_ALL === 'true' || false;\n\n/**\n * Enables experimental component\n *\n * @type {boolean}\n */\nexport const CDS_EXPERIEMENTAL_COMPONENT_NAME: boolean =\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452\n process!.env.CDS_EXPERIEMENTAL_COMPONENT_NAME === 'true' ||\n CDS_FLAGS_ALL ||\n false;\n"],"names":[],"mappings":";;;;;;;AAAA;;;;;AAKG;AAEH;;AAEG;AAEH;;;;AAIG;MACU,aAAa;AACxB;AACA,OAAQ,CAAC,GAAG,CAAC,aAAa,KAAK,MAAM,IAAI;AAE3C;;;;AAIG;MACU,gCAAgC;AAC3C;AACA,OAAQ,CAAC,GAAG,CAAC,gCAAgC,KAAK,MAAM;IACxD,aAAa;AACb,IAAA;;;;"}
|
|
@@ -22,13 +22,13 @@ const FocusMixin = (Base) => class extends Base {
|
|
|
22
22
|
* Focuses on the first focusable element in the shadow DOM.
|
|
23
23
|
*/
|
|
24
24
|
focus() {
|
|
25
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/
|
|
25
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
26
26
|
if (this.shadowRoot.delegatesFocus) {
|
|
27
27
|
super.focus();
|
|
28
28
|
}
|
|
29
29
|
else {
|
|
30
30
|
const delegateTarget =
|
|
31
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/
|
|
31
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
32
32
|
this.shadowRoot.querySelector(selectorTabbable) ||
|
|
33
33
|
this.querySelector(selectorTabbable);
|
|
34
34
|
if (delegateTarget) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focus.js","sources":["../../../src/globals/mixins/focus.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2019, 2022\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { selectorTabbable } from '../settings';\n\n/**\n * @param Base The base class.\n * @returns A mix-in implementing `.focus()` method that focuses on the first focusable element in the shadow DOM.\n */\nconst FocusMixin = <T extends Constructor<HTMLElement>>(Base: T) =>\n class extends Base {\n /**\n * Focuses on the first focusable element in the shadow DOM.\n */\n focus() {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/
|
|
1
|
+
{"version":3,"file":"focus.js","sources":["../../../src/globals/mixins/focus.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2019, 2022\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { selectorTabbable } from '../settings';\n\n/**\n * @param Base The base class.\n * @returns A mix-in implementing `.focus()` method that focuses on the first focusable element in the shadow DOM.\n */\nconst FocusMixin = <T extends Constructor<HTMLElement>>(Base: T) =>\n class extends Base {\n /**\n * Focuses on the first focusable element in the shadow DOM.\n */\n focus() {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452\n if (this.shadowRoot!.delegatesFocus) {\n super.focus();\n } else {\n const delegateTarget =\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452\n this.shadowRoot!.querySelector(selectorTabbable) ||\n this.querySelector(selectorTabbable);\n if (delegateTarget) {\n (delegateTarget as HTMLElement).focus();\n } else {\n super.focus();\n }\n }\n }\n };\n\nexport default FocusMixin;\n"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;AAKG;AAIH;;;AAGG;AACG,MAAA,UAAU,GAAG,CAAqC,IAAO,KAC7D,cAAc,IAAI,CAAA;AAChB;;AAEG;IACH,KAAK,GAAA;;AAEH,QAAA,IAAI,IAAI,CAAC,UAAW,CAAC,cAAc,EAAE;YACnC,KAAK,CAAC,KAAK,EAAE;;aACR;AACL,YAAA,MAAM,cAAc;;AAElB,YAAA,IAAI,CAAC,UAAW,CAAC,aAAa,CAAC,gBAAgB,CAAC;AAChD,gBAAA,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC;YACtC,IAAI,cAAc,EAAE;gBACjB,cAA8B,CAAC,KAAK,EAAE;;iBAClC;gBACL,KAAK,CAAC,KAAK,EAAE;;;;;;;;"}
|
|
@@ -51,7 +51,7 @@ const HostListenerMixin = (Base) => {
|
|
|
51
51
|
const [, , targetName, unprefixedType] = tokens;
|
|
52
52
|
const target = {
|
|
53
53
|
document: this.ownerDocument,
|
|
54
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/
|
|
54
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
55
55
|
window: this.ownerDocument.defaultView,
|
|
56
56
|
parentRoot: this.getRootNode(),
|
|
57
57
|
shadowRoot: this.shadowRoot,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"host-listener.js","sources":["../../../src/globals/mixins/host-listener.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2019, 2023\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport on from './on';\nimport Handle from '../internal/handle';\n\n/**\n * The format for the event name used by `@HostListener` decorator.\n */\nconst EVENT_NAME_FORMAT =\n /^((document|window|parentRoot|shadowRoot):)?([\\w-]+)$/;\n\n/**\n * @param Base The base class.\n * @returns A mix-in that sets up and cleans up event listeners defined by `@HostListener` decorator.\n */\nconst HostListenerMixin = <T extends Constructor<HTMLElement>>(Base: T) => {\n /**\n * A mix-in class that sets up and cleans up event listeners defined by `@HostListener` decorator.\n */\n class HostListenerMixinImpl extends Base {\n /**\n * The list of handles managed by this mix-in.\n *\n * @private\n */\n _handles: Set<Handle> = new Set(); // Not using TypeScript `private` due to: microsoft/TypeScript#17744\n\n connectedCallback() {\n // @ts-expect-error: Until `connectedCallback` is added to `HTMLElement` definition\n super.connectedCallback();\n const hostListeners = (this.constructor as typeof HostListenerMixinImpl)\n ._hostListeners;\n Object.keys(hostListeners).forEach((listenerName) => {\n Object.keys(hostListeners[listenerName]).forEach((type) => {\n // Parses `document:click`/`window:click` format\n const tokens = EVENT_NAME_FORMAT.exec(type);\n if (!tokens) {\n throw new Error(`Could not parse the event name: ${listenerName}`);\n }\n const [, , targetName, unprefixedType] = tokens;\n const target: EventTarget =\n {\n document: this.ownerDocument,\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/
|
|
1
|
+
{"version":3,"file":"host-listener.js","sources":["../../../src/globals/mixins/host-listener.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2019, 2023\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport on from './on';\nimport Handle from '../internal/handle';\n\n/**\n * The format for the event name used by `@HostListener` decorator.\n */\nconst EVENT_NAME_FORMAT =\n /^((document|window|parentRoot|shadowRoot):)?([\\w-]+)$/;\n\n/**\n * @param Base The base class.\n * @returns A mix-in that sets up and cleans up event listeners defined by `@HostListener` decorator.\n */\nconst HostListenerMixin = <T extends Constructor<HTMLElement>>(Base: T) => {\n /**\n * A mix-in class that sets up and cleans up event listeners defined by `@HostListener` decorator.\n */\n class HostListenerMixinImpl extends Base {\n /**\n * The list of handles managed by this mix-in.\n *\n * @private\n */\n _handles: Set<Handle> = new Set(); // Not using TypeScript `private` due to: microsoft/TypeScript#17744\n\n connectedCallback() {\n // @ts-expect-error: Until `connectedCallback` is added to `HTMLElement` definition\n super.connectedCallback();\n const hostListeners = (this.constructor as typeof HostListenerMixinImpl)\n ._hostListeners;\n Object.keys(hostListeners).forEach((listenerName) => {\n Object.keys(hostListeners[listenerName]).forEach((type) => {\n // Parses `document:click`/`window:click` format\n const tokens = EVENT_NAME_FORMAT.exec(type);\n if (!tokens) {\n throw new Error(`Could not parse the event name: ${listenerName}`);\n }\n const [, , targetName, unprefixedType] = tokens;\n const target: EventTarget =\n {\n document: this.ownerDocument,\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452\n window: this.ownerDocument!.defaultView,\n parentRoot: this.getRootNode(),\n shadowRoot: this.shadowRoot,\n }[targetName] || this;\n\n const { options } = hostListeners[listenerName][type];\n\n this._handles.add(\n on(\n target,\n ((this.constructor as typeof Base)[unprefixedType] ??\n unprefixedType) as keyof HTMLElementEventMap,\n this[listenerName],\n options\n )\n );\n });\n });\n }\n\n disconnectedCallback() {\n this._handles.forEach((handle) => {\n handle.release();\n this._handles.delete(handle);\n });\n // @ts-expect-error: Until `disconnectedCallback` is added to `HTMLElement` definition\n super.disconnectedCallback();\n }\n\n /**\n * The map, keyed by method name, of event listeners that should be attached to host element or host document.\n *\n * @private\n */\n static _hostListeners: {\n [listenerName: string]: {\n [type: string]: {\n options?: boolean | AddEventListenerOptions;\n };\n };\n } = {}; // Not using TypeScript `private` due to: microsoft/TypeScript#17744\n }\n\n return HostListenerMixinImpl;\n};\n\nexport default HostListenerMixin;\n"],"names":[],"mappings":";;;;;;;;;AAAA;;;;;AAKG;AAKH;;AAEG;AACH,MAAM,iBAAiB,GACrB,uDAAuD;AAEzD;;;AAGG;AACH,MAAM,iBAAiB,GAAG,CAAqC,IAAO,KAAI;AACxE;;AAEG;IACH,MAAM,qBAAsB,SAAQ,IAAI,CAAA;AAAxC,QAAA,WAAA,GAAA;;AACE;;;;AAIG;AACH,YAAA,IAAA,CAAA,QAAQ,GAAgB,IAAI,GAAG,EAAE,CAAC;;QAElC,iBAAiB,GAAA;;YAEf,KAAK,CAAC,iBAAiB,EAAE;AACzB,YAAA,MAAM,aAAa,GAAI,IAAI,CAAC;AACzB,iBAAA,cAAc;YACjB,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC,OAAO,CAAC,CAAC,YAAY,KAAI;AAClD,gBAAA,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,IA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,7 @@
|
|
|
11
11
|
* This source code is licensed under the Apache-2.0 license found in the
|
|
12
12
|
* LICENSE file in the root directory of this source tree.
|
|
13
13
|
*/
|
|
14
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
15
15
|
function on(element, ...args) {
|
|
16
16
|
element.addEventListener(...args);
|
|
17
17
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"on.js","sources":["../../../src/globals/mixins/on.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2016, 2023\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\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/
|
|
1
|
+
{"version":3,"file":"on.js","sources":["../../../src/globals/mixins/on.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2016, 2023\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\n// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/carbon-design-system/carbon/issues/20452\nexport default function on(element: any, ...args: any) {\n element.addEventListener(...args);\n return {\n release() {\n element.removeEventListener(...args);\n return null;\n },\n };\n}\n"],"names":[],"mappings":";;;;;;;AAAA;;;;;AAKG;AAEH;AACwB,SAAA,EAAE,CAAC,OAAY,EAAE,GAAG,IAAS,EAAA;AACnD,IAAA,OAAO,CAAC,gBAAgB,CAAC,GAAG,IAAI,CAAC;IACjC,OAAO;QACL,OAAO,GAAA;AACL,YAAA,OAAO,CAAC,mBAAmB,CAAC,GAAG,IAAI,CAAC;AACpC,YAAA,OAAO,IAAI;SACZ;KACF;AACH;;;;"}
|
|
@@ -71,7 +71,7 @@ let CDSAccordionItem = class CDSAccordionItem extends FocusMixin(LitElement) {
|
|
|
71
71
|
* The `ResizeObserver` instance for observing element resizes for re-positioning floating menu position.
|
|
72
72
|
*/
|
|
73
73
|
// TODO: Wait for `.d.ts` update to support `ResizeObserver`
|
|
74
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/
|
|
74
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
75
75
|
// @ts-ignore
|
|
76
76
|
this._resizeObserver = new ResizeObserver((records) => {
|
|
77
77
|
const { width } = records[records.length - 1].contentRect;
|
|
@@ -112,11 +112,11 @@ let CDSAccordionItem = class CDSAccordionItem extends FocusMixin(LitElement) {
|
|
|
112
112
|
if (this.dispatchEvent(new CustomEvent(this.constructor.eventBeforeToggle, init))) {
|
|
113
113
|
const { selectorAccordionContent } = this
|
|
114
114
|
.constructor;
|
|
115
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/
|
|
115
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
116
116
|
!this.open
|
|
117
117
|
? this.setAttribute('expanding', '')
|
|
118
118
|
: this.setAttribute('collapsing', '');
|
|
119
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/
|
|
119
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
120
120
|
this.shadowRoot.querySelector(selectorAccordionContent).addEventListener('animationend', () => {
|
|
121
121
|
this.removeAttribute('expanding');
|
|
122
122
|
this.removeAttribute('collapsing');
|
|
@@ -150,7 +150,7 @@ let CDSAccordionItem = class CDSAccordionItem extends FocusMixin(LitElement) {
|
|
|
150
150
|
const { disabled, title, open, _currentBreakpoint: currentBreakpoint, _handleClickExpando: handleClickExpando, _handleKeydownExpando: handleKeydownExpando, } = this;
|
|
151
151
|
const { _classesBreakpoints: classesBreakpoints } = this
|
|
152
152
|
.constructor;
|
|
153
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/
|
|
153
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
154
154
|
const { [currentBreakpoint]: classBreakpoint } = classesBreakpoints;
|
|
155
155
|
const contentClasses = classMap({
|
|
156
156
|
[classBreakpoint]: classBreakpoint,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion-item.js","sources":["../../../src/components/accordion/accordion-item.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2019, 2023\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { classMap } from 'lit/directives/class-map.js';\nimport { LitElement, html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { prefix } from '../../globals/settings';\nimport ChevronRight16 from '@carbon/icons/es/chevron--right/16.js';\nimport { iconLoader } from '../../globals/internal/icon-loader';\nimport FocusMixin from '../../globals/mixins/focus';\nimport Handle from '../../globals/internal/handle';\nimport { ACCORDION_ITEM_BREAKPOINT } from './defs';\nimport styles from './accordion.scss?lit';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\n\nexport { ACCORDION_ITEM_BREAKPOINT };\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 * Accordion item.\n *\n * @element cds-custom-accordion-item\n * @fires cds-custom-accordion-item-beingtoggled\n * The custom event fired before this accordion item is being toggled upon a user gesture.\n * Cancellation of this event stops the user-initiated action of toggling this accordion item.\n * @fires cds-custom-accordion-item-toggled - The custom event fired after this accordion item is toggled upon a user gesture.\n * @csspart title The title.\n * @csspart content The content.\n */\n@customElement(`${prefix}-accordion-item`)\nclass CDSAccordionItem extends FocusMixin(LitElement) {\n /**\n * The current breakpoint.\n */\n private _currentBreakpoint?: ACCORDION_ITEM_BREAKPOINT;\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 * Handles user-initiated toggle request of this accordion item.\n *\n * @param open The new open state.\n */\n private _handleUserInitiatedToggle(open = !this.open) {\n const init = {\n bubbles: true,\n cancelable: true,\n composed: true,\n detail: {\n open,\n },\n };\n if (\n this.dispatchEvent(\n new CustomEvent(\n (this.constructor as typeof CDSAccordionItem).eventBeforeToggle,\n init\n )\n )\n ) {\n const { selectorAccordionContent } = this\n .constructor as typeof CDSAccordionItem;\n\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20071\n !this.open\n ? this.setAttribute('expanding', '')\n : this.setAttribute('collapsing', '');\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20071\n this.shadowRoot!.querySelector(\n selectorAccordionContent\n )!.addEventListener('animationend', () => {\n this.removeAttribute('expanding');\n this.removeAttribute('collapsing');\n });\n\n this.open = open;\n this.dispatchEvent(\n new CustomEvent(\n (this.constructor as typeof CDSAccordionItem).eventToggle,\n init\n )\n );\n }\n }\n\n /**\n * Handler for the `click` event on the expando button.\n */\n private _handleClickExpando() {\n this._handleUserInitiatedToggle();\n }\n\n /**\n * Handler for the `keydown` event on the expando button.\n */\n private _handleKeydownExpando = ({ key }: KeyboardEvent) => {\n if (this.open && (key === 'Esc' || key === 'Escape')) {\n this._handleUserInitiatedToggle(false);\n }\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/20071\n // @ts-ignore\n private _resizeObserver = new ResizeObserver(\n (records: ResizeObserverEntry[]) => {\n const { width } = records[records.length - 1].contentRect;\n const { _sizesBreakpoints: sizesBreakpoints } = this\n .constructor as typeof CDSAccordionItem;\n this._currentBreakpoint = Object.keys(sizesBreakpoints)\n .sort((lhs, rhs) => sizesBreakpoints[rhs] - sizesBreakpoints[lhs])\n .find(\n (size) => width >= sizesBreakpoints[size]\n ) as ACCORDION_ITEM_BREAKPOINT;\n this.requestUpdate();\n }\n );\n\n /**\n * `true` if the accordion item should be disabled.\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * `true` if the accordion item should be open.\n */\n @property({ type: Boolean, reflect: true })\n open = false;\n\n /**\n * The title text.\n */\n @property({ attribute: 'title' })\n title = '';\n\n connectedCallback() {\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'listitem');\n }\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 render() {\n const {\n disabled,\n title,\n open,\n _currentBreakpoint: currentBreakpoint,\n _handleClickExpando: handleClickExpando,\n _handleKeydownExpando: handleKeydownExpando,\n } = this;\n const { _classesBreakpoints: classesBreakpoints } = this\n .constructor as typeof CDSAccordionItem;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20071\n const { [currentBreakpoint!]: classBreakpoint } = classesBreakpoints;\n const contentClasses = classMap({\n [classBreakpoint]: classBreakpoint,\n [`${prefix}--accordion__content`]: true,\n });\n return html`\n <button\n ?disabled=\"${disabled}\"\n type=\"button\"\n part=\"expando\"\n class=\"${prefix}--accordion__heading\"\n aria-controls=\"content\"\n aria-expanded=\"${open}\"\n @click=\"${handleClickExpando}\"\n @keydown=\"${handleKeydownExpando}\">\n ${iconLoader(ChevronRight16, {\n part: 'expando-icon',\n class: `${prefix}--accordion__arrow`,\n })}\n <div part=\"title\" class=\"${prefix}--accordion__title\">\n <slot name=\"title\">${title}</slot>\n </div>\n </button>\n <div class=\"${prefix}--accordion__wrapper\" part=\"wrapper\">\n <div id=\"content\" part=\"content\" class=\"${contentClasses}\">\n <slot></slot>\n </div>\n </div>\n `;\n }\n\n /**\n * The CSS classes for breakpoints.\n *\n * @private\n */\n static get _classesBreakpoints() {\n return {\n [ACCORDION_ITEM_BREAKPOINT.SMALL]: `${prefix}-ce--accordion__content--${ACCORDION_ITEM_BREAKPOINT.SMALL}`,\n [ACCORDION_ITEM_BREAKPOINT.MEDIUM]: `${prefix}-ce--accordion__content--${ACCORDION_ITEM_BREAKPOINT.MEDIUM}`,\n };\n }\n\n /**\n * The breakpoints.\n *\n * @private\n */\n static get _sizesBreakpoints() {\n return {\n [ACCORDION_ITEM_BREAKPOINT.SMALL]: 480,\n [ACCORDION_ITEM_BREAKPOINT.MEDIUM]: 640,\n };\n }\n\n /**\n * The name of the custom event fired before this accordion item is being toggled upon a user gesture.\n * Cancellation of this event stops the user-initiated action of toggling this accordion item.\n */\n static get eventBeforeToggle() {\n return `${prefix}-accordion-item-beingtoggled`;\n }\n\n /**\n * The name of the custom event fired after this accordion item is toggled upon a user gesture.\n */\n static get eventToggle() {\n return `${prefix}-accordion-item-toggled`;\n }\n\n static get selectorAccordionContent() {\n return `.${prefix}--accordion__content`;\n }\n\n static styles = styles;\n}\n\nexport default CDSAccordionItem;\n"],"names":["customElement"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;AAKG;AAgBH;;;;;AAKG;AACH,MAAM,aAAa,GAAG,CAAC,QAAwB,EAAE,IAAa,KAAI;IAChE,IAAI,CAAC,IAAI,EAAE;AACT,QAAA,OAAO,IAAI;;AAEb,IAAA,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC;IACtB,OAAO;QACL,OAAO,GAAA;AACL,YAAA,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC;AAC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;;"}
|
|
1
|
+
{"version":3,"file":"accordion-item.js","sources":["../../../src/components/accordion/accordion-item.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2019, 2023\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { classMap } from 'lit/directives/class-map.js';\nimport { LitElement, html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { prefix } from '../../globals/settings';\nimport ChevronRight16 from '@carbon/icons/es/chevron--right/16.js';\nimport { iconLoader } from '../../globals/internal/icon-loader';\nimport FocusMixin from '../../globals/mixins/focus';\nimport Handle from '../../globals/internal/handle';\nimport { ACCORDION_ITEM_BREAKPOINT } from './defs';\nimport styles from './accordion.scss?lit';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\n\nexport { ACCORDION_ITEM_BREAKPOINT };\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 * Accordion item.\n *\n * @element cds-custom-accordion-item\n * @fires cds-custom-accordion-item-beingtoggled\n * The custom event fired before this accordion item is being toggled upon a user gesture.\n * Cancellation of this event stops the user-initiated action of toggling this accordion item.\n * @fires cds-custom-accordion-item-toggled - The custom event fired after this accordion item is toggled upon a user gesture.\n * @csspart title The title.\n * @csspart content The content.\n */\n@customElement(`${prefix}-accordion-item`)\nclass CDSAccordionItem extends FocusMixin(LitElement) {\n /**\n * The current breakpoint.\n */\n private _currentBreakpoint?: ACCORDION_ITEM_BREAKPOINT;\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 * Handles user-initiated toggle request of this accordion item.\n *\n * @param open The new open state.\n */\n private _handleUserInitiatedToggle(open = !this.open) {\n const init = {\n bubbles: true,\n cancelable: true,\n composed: true,\n detail: {\n open,\n },\n };\n if (\n this.dispatchEvent(\n new CustomEvent(\n (this.constructor as typeof CDSAccordionItem).eventBeforeToggle,\n init\n )\n )\n ) {\n const { selectorAccordionContent } = this\n .constructor as typeof CDSAccordionItem;\n\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20452\n !this.open\n ? this.setAttribute('expanding', '')\n : this.setAttribute('collapsing', '');\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452\n this.shadowRoot!.querySelector(\n selectorAccordionContent\n )!.addEventListener('animationend', () => {\n this.removeAttribute('expanding');\n this.removeAttribute('collapsing');\n });\n\n this.open = open;\n this.dispatchEvent(\n new CustomEvent(\n (this.constructor as typeof CDSAccordionItem).eventToggle,\n init\n )\n );\n }\n }\n\n /**\n * Handler for the `click` event on the expando button.\n */\n private _handleClickExpando() {\n this._handleUserInitiatedToggle();\n }\n\n /**\n * Handler for the `keydown` event on the expando button.\n */\n private _handleKeydownExpando = ({ key }: KeyboardEvent) => {\n if (this.open && (key === 'Esc' || key === 'Escape')) {\n this._handleUserInitiatedToggle(false);\n }\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 (records: ResizeObserverEntry[]) => {\n const { width } = records[records.length - 1].contentRect;\n const { _sizesBreakpoints: sizesBreakpoints } = this\n .constructor as typeof CDSAccordionItem;\n this._currentBreakpoint = Object.keys(sizesBreakpoints)\n .sort((lhs, rhs) => sizesBreakpoints[rhs] - sizesBreakpoints[lhs])\n .find(\n (size) => width >= sizesBreakpoints[size]\n ) as ACCORDION_ITEM_BREAKPOINT;\n this.requestUpdate();\n }\n );\n\n /**\n * `true` if the accordion item should be disabled.\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n /**\n * `true` if the accordion item should be open.\n */\n @property({ type: Boolean, reflect: true })\n open = false;\n\n /**\n * The title text.\n */\n @property({ attribute: 'title' })\n title = '';\n\n connectedCallback() {\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'listitem');\n }\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 render() {\n const {\n disabled,\n title,\n open,\n _currentBreakpoint: currentBreakpoint,\n _handleClickExpando: handleClickExpando,\n _handleKeydownExpando: handleKeydownExpando,\n } = this;\n const { _classesBreakpoints: classesBreakpoints } = this\n .constructor as typeof CDSAccordionItem;\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452\n const { [currentBreakpoint!]: classBreakpoint } = classesBreakpoints;\n const contentClasses = classMap({\n [classBreakpoint]: classBreakpoint,\n [`${prefix}--accordion__content`]: true,\n });\n return html`\n <button\n ?disabled=\"${disabled}\"\n type=\"button\"\n part=\"expando\"\n class=\"${prefix}--accordion__heading\"\n aria-controls=\"content\"\n aria-expanded=\"${open}\"\n @click=\"${handleClickExpando}\"\n @keydown=\"${handleKeydownExpando}\">\n ${iconLoader(ChevronRight16, {\n part: 'expando-icon',\n class: `${prefix}--accordion__arrow`,\n })}\n <div part=\"title\" class=\"${prefix}--accordion__title\">\n <slot name=\"title\">${title}</slot>\n </div>\n </button>\n <div class=\"${prefix}--accordion__wrapper\" part=\"wrapper\">\n <div id=\"content\" part=\"content\" class=\"${contentClasses}\">\n <slot></slot>\n </div>\n </div>\n `;\n }\n\n /**\n * The CSS classes for breakpoints.\n *\n * @private\n */\n static get _classesBreakpoints() {\n return {\n [ACCORDION_ITEM_BREAKPOINT.SMALL]: `${prefix}-ce--accordion__content--${ACCORDION_ITEM_BREAKPOINT.SMALL}`,\n [ACCORDION_ITEM_BREAKPOINT.MEDIUM]: `${prefix}-ce--accordion__content--${ACCORDION_ITEM_BREAKPOINT.MEDIUM}`,\n };\n }\n\n /**\n * The breakpoints.\n *\n * @private\n */\n static get _sizesBreakpoints() {\n return {\n [ACCORDION_ITEM_BREAKPOINT.SMALL]: 480,\n [ACCORDION_ITEM_BREAKPOINT.MEDIUM]: 640,\n };\n }\n\n /**\n * The name of the custom event fired before this accordion item is being toggled upon a user gesture.\n * Cancellation of this event stops the user-initiated action of toggling this accordion item.\n */\n static get eventBeforeToggle() {\n return `${prefix}-accordion-item-beingtoggled`;\n }\n\n /**\n * The name of the custom event fired after this accordion item is toggled upon a user gesture.\n */\n static get eventToggle() {\n return `${prefix}-accordion-item-toggled`;\n }\n\n static get selectorAccordionContent() {\n return `.${prefix}--accordion__content`;\n }\n\n static styles = styles;\n}\n\nexport default CDSAccordionItem;\n"],"names":["customElement"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;AAKG;AAgBH;;;;;AAKG;AACH,MAAM,aAAa,GAAG,CAAC,QAAwB,EAAE,IAAa,KAAI;IAChE,IAAI,CAAC,IAAI,EAAE;AACT,QAAA,OAAO,IAAI;;AAEb,IAAA,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC;IACtB,OAAO;QACL,OAAO,GAAA;AACL,YAAA,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC;AACxB,YAAA,OAAO,IAAI;SACZ;KACQ;AACb,CAAC;AAED;;;;;;;;;;AAUG;AAEH,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,UAAU,CAAC,UAAU,CAAC,CAAA;AAArD,IAAA,WAAA,GAAA;;AAME;;AAEG;QACK,IAAe,CAAA,eAAA,GAAkB,IAAI;AAwD7C;;AAEG;AACK,QAAA,IAAA,CAAA,qBAAqB,GAAG,CAAC,EAAE,GAAG,EAAiB,KAAI;AACzD,YAAA,IAAI,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,WAAW,iBAAiB,GAAA;QAC1B,OAAO,CAAA,EAAG,MAAM,CAAA,4BAAA,CAA8B;;AAGhD;;AAEG;AACH,IAAA,WAAW,WAAW,GAAA;QACpB,OAAO,CAAA,EAAG,MAAM,CAAA,uBAAA,CAAyB;;AAG3C,IAAA,WAAW,wBAAwB,GAAA;QACjC,OAAO,CAAA,CAAA,EAAI,MAAM,CAAA,oBAAA,CAAsB;;;AAGlC,gBAAM,CAAA,MAAA,GAAG,MAAH;AArHb,UAAA,CAAA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;AACzB,CAAA,EAAA,gBAAA,CAAA,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;AAMjB,UAAA,CAAA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;AAC7B,CAAA,EAAA,gBAAA,CAAA,SAAA,EAAA,MAAA,EAAA,MAAA,CAAA;AAMb,UAAA,CAAA;AADC,IAAA,QAAQ,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE;AACrB,CAAA,EAAA,gBAAA,CAAA,SAAA,EAAA,OAAA,EAAA,MAAA,CAAA;AA9GP,gBAAgB,GAAA,UAAA,CAAA;AADrB,IAAAA,aAAa,CAAC,CAAA,EAAG,MAAM,CAAA,eAAA,CAAiB;AACnC,CAAA,EAAA,gBAAgB,CAwNrB;AAED,yBAAe,gBAAgB;;;;"}
|
|
@@ -53,7 +53,7 @@ let CDSAccordionSkeleton = class CDSAccordionSkeleton extends LitElement {
|
|
|
53
53
|
if (changedProperties.has('alignment')) {
|
|
54
54
|
// Propagate `alignment` attribute to descendants until `:host-context()` gets supported in all major browsers
|
|
55
55
|
forEach(
|
|
56
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/
|
|
56
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
57
57
|
this.shadowRoot.querySelectorAll(this.constructor
|
|
58
58
|
.selectorAccordionItemSkeletons), (elem) => {
|
|
59
59
|
elem.setAttribute('alignment', this.alignment);
|
|
@@ -63,10 +63,10 @@ let CDSAccordionSkeleton = class CDSAccordionSkeleton extends LitElement {
|
|
|
63
63
|
changedProperties.has('alignment')) {
|
|
64
64
|
// Propagate `isFlush` attribute to descendants until `:host-context()` gets supported in all major browsers
|
|
65
65
|
forEach(
|
|
66
|
-
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/
|
|
66
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
67
67
|
this.shadowRoot.querySelectorAll(this.constructor
|
|
68
68
|
.selectorAccordionItemSkeletons), (elem) => {
|
|
69
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/
|
|
69
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
70
70
|
this.isFlush && this.alignment !== 'start'
|
|
71
71
|
? elem.setAttribute('isFlush', '')
|
|
72
72
|
: elem.removeAttribute('isFlush');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion-skeleton.js","sources":["../../../src/components/accordion/accordion-skeleton.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2019, 2025\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { classMap } from 'lit/directives/class-map.js';\nimport { LitElement, html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { prefix } from '../../globals/settings';\nimport { ACCORDION_ALIGNMENT } from './accordion';\nimport { forEach } from '../../globals/internal/collection-helpers';\nimport ChevronRight16 from '@carbon/icons/es/chevron--right/16.js';\nimport { iconLoader } from '../../globals/internal/icon-loader';\nimport './accordion-item-skeleton';\nimport '../skeleton-text/index';\nimport styles from './accordion.scss?lit';\n\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\n\n/**\n * Skeleton of code snippet.\n */\n@customElement(`${prefix}-accordion-skeleton`)\nclass CDSAccordionSkeleton extends LitElement {\n /**\n * Specify the alignment of the accordion heading title and chevron\n */\n @property({ reflect: true })\n alignment = ACCORDION_ALIGNMENT.END;\n\n /**\n * Set number of items to render\n */\n @property({ type: Number, attribute: 'count' })\n count = 4;\n\n /**\n * Specify whether Accordion text should be flush, default is false, does not work with align=\"start\"\n */\n @property({ type: Boolean, reflect: true })\n isFlush = false;\n\n /**\n * `true` if the first accordion item should be open.\n */\n @property({ type: Boolean, reflect: true })\n open = true;\n\n updated(changedProperties) {\n if (changedProperties.has('alignment')) {\n // Propagate `alignment` attribute to descendants until `:host-context()` gets supported in all major browsers\n forEach(\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/
|
|
1
|
+
{"version":3,"file":"accordion-skeleton.js","sources":["../../../src/components/accordion/accordion-skeleton.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2019, 2025\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { classMap } from 'lit/directives/class-map.js';\nimport { LitElement, html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { prefix } from '../../globals/settings';\nimport { ACCORDION_ALIGNMENT } from './accordion';\nimport { forEach } from '../../globals/internal/collection-helpers';\nimport ChevronRight16 from '@carbon/icons/es/chevron--right/16.js';\nimport { iconLoader } from '../../globals/internal/icon-loader';\nimport './accordion-item-skeleton';\nimport '../skeleton-text/index';\nimport styles from './accordion.scss?lit';\n\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\n\n/**\n * Skeleton of code snippet.\n */\n@customElement(`${prefix}-accordion-skeleton`)\nclass CDSAccordionSkeleton extends LitElement {\n /**\n * Specify the alignment of the accordion heading title and chevron\n */\n @property({ reflect: true })\n alignment = ACCORDION_ALIGNMENT.END;\n\n /**\n * Set number of items to render\n */\n @property({ type: Number, attribute: 'count' })\n count = 4;\n\n /**\n * Specify whether Accordion text should be flush, default is false, does not work with align=\"start\"\n */\n @property({ type: Boolean, reflect: true })\n isFlush = false;\n\n /**\n * `true` if the first accordion item should be open.\n */\n @property({ type: Boolean, reflect: true })\n open = true;\n\n updated(changedProperties) {\n if (changedProperties.has('alignment')) {\n // Propagate `alignment` attribute to descendants until `:host-context()` gets supported in all major browsers\n forEach(\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452\n this.shadowRoot!.querySelectorAll(\n (this.constructor as typeof CDSAccordionSkeleton)\n .selectorAccordionItemSkeletons\n ),\n (elem) => {\n elem.setAttribute('alignment', this.alignment);\n }\n );\n }\n if (\n changedProperties.has('isFlush') ||\n changedProperties.has('alignment')\n ) {\n // Propagate `isFlush` attribute to descendants until `:host-context()` gets supported in all major browsers\n forEach(\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion -- https://github.com/carbon-design-system/carbon/issues/20452\n this.shadowRoot!.querySelectorAll(\n (this.constructor as typeof CDSAccordionSkeleton)\n .selectorAccordionItemSkeletons\n ),\n (elem) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20452\n this.isFlush && this.alignment !== 'start'\n ? elem.setAttribute('isFlush', '')\n : elem.removeAttribute('isFlush');\n }\n );\n }\n }\n\n render() {\n const classes = classMap({\n [`${prefix}--accordion__item`]: true,\n [`${prefix}--accordion__item--active`]: true,\n [`${prefix}--accordion--${this.alignment}`]: this.alignment,\n [`${prefix}--accordion--flush`]:\n this.isFlush && this.alignment !== 'start',\n });\n const numSkeletonItems = this.open ? this.count - 1 : this.count;\n return html`\n ${this.open\n ? html`\n <li class=\"${classes}\">\n <span class=\"${prefix}--accordion__heading\">\n ${iconLoader(ChevronRight16, {\n class: `${prefix}--accordion__arrow`,\n part: 'expando-icon',\n })}\n <cds-custom-skeleton-text\n class=\"${prefix}--accordion__title\"></cds-custom-skeleton-text>\n </span>\n <div class=\"${prefix}--accordion__content\">\n <cds-custom-skeleton-text width=\"90%\"></cds-custom-skeleton-text>\n <cds-custom-skeleton-text width=\"80%\"></cds-custom-skeleton-text>\n <cds-custom-skeleton-text width=\"95%\"></cds-custom-skeleton-text>\n </div>\n </li>\n `\n : ``}\n ${Array.from({ length: numSkeletonItems }).map(\n (_, i, arr) =>\n html`<cds-custom-accordion-item-skeleton\n key=${i}\n ?data-last-item=${i ===\n arr.length - 1}></cds-custom-accordion-item-skeleton>`\n )}\n `;\n }\n\n static get selectorAccordionItemSkeletons() {\n return `${prefix}-accordion-item-skeleton`;\n }\n\n static styles = styles;\n}\n\nexport default CDSAccordionSkeleton;\n"],"names":["customElement"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;AAKG;AAgBH;;AAEG;AAEH,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,UAAU,CAAA;AAA7C,IAAA,WAAA,GAAA;;AACE;;AAEG;AAEH,QAAA,IAAA,CAAA,SAAS,GAAG,mBAAmB,CAAC,GAAG;AAEnC;;AAEG;QAEH,IAAK,CAAA,KAAA,GAAG,CAAC;AAET;;AAEG;QAEH,IAAO,CAAA,OAAA,GAAG,KAAK;AAEf;;AAEG;QAEH,IAAI,CAAA,IAAA,GAAG,IAAI;;AAEX,IAAA,OAAO,CAAC,iBAAiB,EAAA;AACvB,QAAA,IAAI,iBAAiB,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE;;YAEtC,OAAO;;AAEL,YAAA,IAAI,CAAC,UAAW,CAAC,gBAAgB,CAC9B,IAAI,CAAC;AACH,iBAAA,8BAA8B,CAClC,EACD,CAAC,IAAI,KAAI;gBACP,IAAI,CAAC,YAAY,CAAC,WAAW,EAAE,IAAI,CAAC,SAAS,CAAC;AAChD,aAAC,CACF;;AAEH,QAAA,IACE,iBAAiB,C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
68
|
changedProperties.has('alignment')) {
|
|
69
69
|
// Propagate `isFlush` attribute to descendants until `:host-context()` gets supported in all major browsers
|
|
70
70
|
forEach(this.querySelectorAll(this.constructor.selectorAccordionItems), (elem) => {
|
|
71
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/
|
|
71
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
72
72
|
this.isFlush && this.alignment !== 'start'
|
|
73
73
|
? elem.setAttribute('isFlush', '')
|
|
74
74
|
: elem.removeAttribute('isFlush');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accordion.js","sources":["../../../src/components/accordion/accordion.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2019, 2025\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { LitElement, html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { prefix } from '../../globals/settings';\nimport { forEach } from '../../globals/internal/collection-helpers';\nimport { ACCORDION_SIZE, ACCORDION_ALIGNMENT } from './defs';\nimport styles from './accordion.scss?lit';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\n\nexport { ACCORDION_SIZE, ACCORDION_ALIGNMENT };\n\n/**\n * Accordion container.\n *\n * @element cds-custom-accordion\n */\n@customElement(`${prefix}-accordion`)\nclass CDSAccordion extends LitElement {\n /**\n * Accordion size should be sm, md, lg.\n */\n @property({ reflect: true })\n size = ACCORDION_SIZE.MEDIUM;\n\n /**\n * Specify the alignment of the accordion heading title and chevron\n */\n @property({ reflect: true })\n alignment = ACCORDION_ALIGNMENT.END;\n\n /**\n * Specify whether Accordion text should be flush, default is false, does not work with align=\"start\"\n */\n @property({ type: Boolean, reflect: true })\n isFlush = false;\n\n /**\n * Disable all accordion items inside this accordion.\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n connectedCallback() {\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'list');\n }\n super.connectedCallback();\n }\n\n updated(changedProperties) {\n if (changedProperties.has('size')) {\n // Propagate `size` attribute to descendants until `:host-context()` gets supported in all major browsers\n forEach(\n this.querySelectorAll(\n (this.constructor as typeof CDSAccordion).selectorAccordionItems\n ),\n (elem) => {\n elem.setAttribute('size', this.size);\n }\n );\n }\n if (changedProperties.has('alignment')) {\n // Propagate `alignment` attribute to descendants until `:host-context()` gets supported in all major browsers\n forEach(\n this.querySelectorAll(\n (this.constructor as typeof CDSAccordion).selectorAccordionItems\n ),\n (elem) => {\n elem.setAttribute('alignment', this.alignment);\n }\n );\n }\n if (\n changedProperties.has('isFlush') ||\n changedProperties.has('alignment')\n ) {\n // Propagate `isFlush` attribute to descendants until `:host-context()` gets supported in all major browsers\n forEach(\n this.querySelectorAll(\n (this.constructor as typeof CDSAccordion).selectorAccordionItems\n ),\n (elem) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/
|
|
1
|
+
{"version":3,"file":"accordion.js","sources":["../../../src/components/accordion/accordion.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2019, 2025\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { LitElement, html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { prefix } from '../../globals/settings';\nimport { forEach } from '../../globals/internal/collection-helpers';\nimport { ACCORDION_SIZE, ACCORDION_ALIGNMENT } from './defs';\nimport styles from './accordion.scss?lit';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\n\nexport { ACCORDION_SIZE, ACCORDION_ALIGNMENT };\n\n/**\n * Accordion container.\n *\n * @element cds-custom-accordion\n */\n@customElement(`${prefix}-accordion`)\nclass CDSAccordion extends LitElement {\n /**\n * Accordion size should be sm, md, lg.\n */\n @property({ reflect: true })\n size = ACCORDION_SIZE.MEDIUM;\n\n /**\n * Specify the alignment of the accordion heading title and chevron\n */\n @property({ reflect: true })\n alignment = ACCORDION_ALIGNMENT.END;\n\n /**\n * Specify whether Accordion text should be flush, default is false, does not work with align=\"start\"\n */\n @property({ type: Boolean, reflect: true })\n isFlush = false;\n\n /**\n * Disable all accordion items inside this accordion.\n */\n @property({ type: Boolean, reflect: true })\n disabled = false;\n\n connectedCallback() {\n if (!this.hasAttribute('role')) {\n this.setAttribute('role', 'list');\n }\n super.connectedCallback();\n }\n\n updated(changedProperties) {\n if (changedProperties.has('size')) {\n // Propagate `size` attribute to descendants until `:host-context()` gets supported in all major browsers\n forEach(\n this.querySelectorAll(\n (this.constructor as typeof CDSAccordion).selectorAccordionItems\n ),\n (elem) => {\n elem.setAttribute('size', this.size);\n }\n );\n }\n if (changedProperties.has('alignment')) {\n // Propagate `alignment` attribute to descendants until `:host-context()` gets supported in all major browsers\n forEach(\n this.querySelectorAll(\n (this.constructor as typeof CDSAccordion).selectorAccordionItems\n ),\n (elem) => {\n elem.setAttribute('alignment', this.alignment);\n }\n );\n }\n if (\n changedProperties.has('isFlush') ||\n changedProperties.has('alignment')\n ) {\n // Propagate `isFlush` attribute to descendants until `:host-context()` gets supported in all major browsers\n forEach(\n this.querySelectorAll(\n (this.constructor as typeof CDSAccordion).selectorAccordionItems\n ),\n (elem) => {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20452\n this.isFlush && this.alignment !== 'start'\n ? elem.setAttribute('isFlush', '')\n : elem.removeAttribute('isFlush');\n }\n );\n }\n\n if (changedProperties.has('disabled')) {\n forEach(\n this.querySelectorAll(\n (this.constructor as typeof CDSAccordion).selectorAccordionItems\n ),\n (elem) => {\n if (this.disabled) {\n elem.setAttribute('disabled', '');\n } else {\n elem.removeAttribute('disabled');\n }\n }\n );\n }\n\n // Marks the last accordion item for styling (simulates :last-child in Shadow DOM)\n const items = Array.from(\n this.querySelectorAll(\n (this.constructor as typeof CDSAccordion).selectorAccordionItems\n )\n );\n items.forEach((item) => item.removeAttribute('data-last-item'));\n\n const lastVisible = items\n .reverse()\n .find((item) => !(item as HTMLElement).hidden);\n lastVisible?.setAttribute('data-last-item', '');\n }\n\n render() {\n return html` <slot></slot> `;\n }\n\n static get selectorAccordionItems() {\n return `${prefix}-accordion-item`;\n }\n\n static styles = styles;\n}\n\nexport default CDSAccordion;\n"],"names":["customElement"],"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;AAKG;AAYH;;;;AAIG;AAEH,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,UAAU,CAAA;AAArC,IAAA,WAAA,GAAA;;AACE;;AAEG;AAEH,QAAA,IAAA,CAAA,IAAI,GAAG,cAAc,CAAC,MAAM;AAE5B;;AAEG;AAEH,QAAA,IAAA,CAAA,SAAS,GAAG,mBAAmB,CAAC,GAAG;AAEnC;;AAEG;QAEH,IAAO,CAAA,OAAA,GAAG,KAAK;AAEf;;AAEG;QAEH,IAAQ,CAAA,QAAA,GAAG,KAAK;;IAEhB,iBAAiB,GAAA;QACf,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE;AAC9B,YAAA,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,MAAM,CAAC;;QAEnC,KAAK,CAAC,iBAAiB,EAAE;;AAG3B,IAAA,OAAO,CAAC,iBAAiB,EAAA;AACvB,QAAA,IAAI,iBAAiB,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;;AAEjC,YAAA,OAAO,CACL,IAAI,CAAC,gBAAgB,CAClB,IAAI,CAAC,WAAmC,CAAC,sBAAsB,CACjE,EACD,CAAC,IAAI,KAAI;gBACP,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC;AACtC,aAAC,CACF;;AAEH,QAAA,IAAI,iBAAiB,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE;;AAEtC,YAAA,OAAO,CACL,IAAI,CAAC,gBAAgB,CAClB,IAAI,CAAC,WAAmC,CAAC,sBAAsB,CACj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AX,WAAW,KAAA,MAAA,GAAA,MAAA,GAAX,WAAW,CAAE,YAAY,CAAC,gBAAgB,EAAE,EAAE,CAAC;;IAGjD,MAAM,GAAA;QACJ,OAAO,IAAI,CAAA,CAAA,eAAA,CAAiB;;AAG9B,IAAA,WAAW,sBAAsB,GAAA;QAC/B,OAAO,CAAA,EAAG,MAAM,CAAA,eAAA,CAAiB;;;AAG5B,YAAM,CAAA,MAAA,GAAG,MAAH;AAzGb,UAAA,CAAA;AADC,IAAA,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE;AACE,CAAA,EAAA,YAAA,CAAA,SAAA,EAAA,MAAA,EAAA,MAAA,CAAA;AAM7B,UAAA,CAAA;AADC,IAAA,QAAQ,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE;AACS,CAAA,EAAA,YAAA,CAAA,SAAA,EAAA,WAAA,EAAA,MAAA,CAAA;AAMpC,UAAA,CAAA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;AAC1B,CAAA,EAAA,YAAA,CAAA,SAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AAMhB,UAAA,CAAA;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;AACzB,CAAA,EAAA,YAAA,CAAA,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;AAvBb,YAAY,GAAA,UAAA,CAAA;AADjB,IAAAA,aAAa,CAAC,CAAA,EAAG,MAAM,CAAA,UAAA,CAAY;AAC9B,CAAA,EAAA,YAAY,CA+GjB;AAED,qBAAe,YAAY;;;;"}
|
|
@@ -125,9 +125,9 @@ let CDSAILabel = class CDSAILabel extends CDSToggleTip {
|
|
|
125
125
|
attributeChangedCallback(name, old, newValue) {
|
|
126
126
|
var _a;
|
|
127
127
|
super.attributeChangedCallback(name, old, newValue);
|
|
128
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/
|
|
128
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
129
129
|
//@ts-ignore typescript does not think requestUpdate() exists on parentElement
|
|
130
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/
|
|
130
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20452
|
|
131
131
|
name === 'revert-active' ? (_a = this.parentElement) === null || _a === void 0 ? void 0 : _a.requestUpdate() : ``;
|
|
132
132
|
}
|
|
133
133
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-label.js","sources":["../../../src/components/ai-label/ai-label.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2019, 2024\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { classMap } from 'lit/directives/class-map.js';\nimport { html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { prefix } from '../../globals/settings';\nimport CDSToggleTip from '../toggle-tip/toggletip';\nimport styles from './ai-label.scss?lit';\nimport Undo16 from '@carbon/icons/es/undo/16.js';\nimport { AI_LABEL_SIZE, AI_LABEL_KIND } from './defs';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\nimport { iconLoader } from '../../globals/internal/icon-loader';\n\n/**\n * Basic AI Label.\n *\n * @element cds-custom-ai-label\n */\n@customElement(`${prefix}-ai-label`)\nclass CDSAILabel extends CDSToggleTip {\n /**\n * @deprecated the slot string will be renamed to \"decorator\"\n */\n @property({ reflect: true })\n slot = 'ai-label';\n\n /**\n * Specify the correct translation of the AI text\n */\n @property({ attribute: 'ai-text' })\n aiText = 'AI';\n\n /**\n * Specify additional text to be rendered next to the AI label in the inline variant\n */\n @property({ attribute: 'ai-text-label' })\n aiTextLabel = '';\n\n /**\n * Specify the type of AI Label, from the following list of types: (default, inline)\n */\n @property({ reflect: true })\n kind = AI_LABEL_KIND.DEFAULT;\n\n /**\n * Specify whether the revert button should be visible\n */\n @property({ type: Boolean, attribute: 'revert-active' })\n revertActive = false;\n\n /**\n * Specify whether the revert button should be visible\n */\n @property({ attribute: 'revert-label' })\n revertLabel = 'Revert to AI input';\n\n /**\n * AI Label size should be mini, 2xs, xs, sm, md, lg, xl.\n */\n @property({ reflect: true })\n size = AI_LABEL_SIZE.EXTRA_SMALL;\n\n /**\n * Specify the text that will be provided to the aria-label of the `AI Label` button\n */\n @property({ attribute: 'button-label' })\n buttonLabel = 'Show information';\n\n @property()\n previousValue;\n\n protected _handleClick = () => {\n if (this.revertActive) {\n this.revertActive = false;\n this.removeAttribute('revert-active');\n } else {\n super._handleClick();\n }\n };\n\n protected _renderToggleTipLabel = () => {\n return html``;\n };\n\n protected _renderTooltipButton = () => {\n const { size, kind, aiText, aiTextLabel, buttonLabel } = this;\n const ariaLabel = `${aiText} - ${buttonLabel}`;\n const classes = classMap({\n [`${prefix}--toggletip-button`]: true,\n [`${prefix}--slug__button`]: true,\n [`${prefix}--slug__button--${size}`]: size,\n [`${prefix}--slug__button--${kind}`]: kind,\n [`${prefix}--slug__button--inline-with-content`]:\n kind === AI_LABEL_KIND.INLINE && aiTextLabel,\n });\n return html`\n <button\n aria-controls=\"${this.id}\"\n @click=\"${this._handleClick}\"\n class=${classes}\n aria-label=\"${ariaLabel}\">\n <span class=\"${prefix}--slug__text\">${aiText}</span>\n ${aiTextLabel && kind === AI_LABEL_KIND.INLINE\n ? html`\n <span class=\"${prefix}--slug__additional-text\">\n ${aiTextLabel}\n </span>\n `\n : ``}\n </button>\n `;\n };\n\n protected _renderInnerContent = () => {\n const { autoalign, revertActive, revertLabel } = this;\n return html`\n ${revertActive\n ? html`\n <cds-custom-icon-button\n ?autoalign=${autoalign}\n kind=\"ghost\"\n size=\"sm\"\n @click=\"${this._handleClick}\">\n <span slot=\"tooltip-content\"> ${revertLabel} </span>\n ${iconLoader(Undo16, { slot: 'icon' })}\n </cds-custom-icon-button>\n `\n : html`\n ${this._renderTooltipButton()} ${this._renderTooltipContent()}\n `}\n `;\n };\n\n attributeChangedCallback(name, old, newValue) {\n super.attributeChangedCallback(name, old, newValue);\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/
|
|
1
|
+
{"version":3,"file":"ai-label.js","sources":["../../../src/components/ai-label/ai-label.ts"],"sourcesContent":["/**\n * Copyright IBM Corp. 2019, 2024\n *\n * This source code is licensed under the Apache-2.0 license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport { classMap } from 'lit/directives/class-map.js';\nimport { html } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { prefix } from '../../globals/settings';\nimport CDSToggleTip from '../toggle-tip/toggletip';\nimport styles from './ai-label.scss?lit';\nimport Undo16 from '@carbon/icons/es/undo/16.js';\nimport { AI_LABEL_SIZE, AI_LABEL_KIND } from './defs';\nimport { carbonElement as customElement } from '../../globals/decorators/carbon-element';\nimport { iconLoader } from '../../globals/internal/icon-loader';\n\n/**\n * Basic AI Label.\n *\n * @element cds-custom-ai-label\n */\n@customElement(`${prefix}-ai-label`)\nclass CDSAILabel extends CDSToggleTip {\n /**\n * @deprecated the slot string will be renamed to \"decorator\"\n */\n @property({ reflect: true })\n slot = 'ai-label';\n\n /**\n * Specify the correct translation of the AI text\n */\n @property({ attribute: 'ai-text' })\n aiText = 'AI';\n\n /**\n * Specify additional text to be rendered next to the AI label in the inline variant\n */\n @property({ attribute: 'ai-text-label' })\n aiTextLabel = '';\n\n /**\n * Specify the type of AI Label, from the following list of types: (default, inline)\n */\n @property({ reflect: true })\n kind = AI_LABEL_KIND.DEFAULT;\n\n /**\n * Specify whether the revert button should be visible\n */\n @property({ type: Boolean, attribute: 'revert-active' })\n revertActive = false;\n\n /**\n * Specify whether the revert button should be visible\n */\n @property({ attribute: 'revert-label' })\n revertLabel = 'Revert to AI input';\n\n /**\n * AI Label size should be mini, 2xs, xs, sm, md, lg, xl.\n */\n @property({ reflect: true })\n size = AI_LABEL_SIZE.EXTRA_SMALL;\n\n /**\n * Specify the text that will be provided to the aria-label of the `AI Label` button\n */\n @property({ attribute: 'button-label' })\n buttonLabel = 'Show information';\n\n @property()\n previousValue;\n\n protected _handleClick = () => {\n if (this.revertActive) {\n this.revertActive = false;\n this.removeAttribute('revert-active');\n } else {\n super._handleClick();\n }\n };\n\n protected _renderToggleTipLabel = () => {\n return html``;\n };\n\n protected _renderTooltipButton = () => {\n const { size, kind, aiText, aiTextLabel, buttonLabel } = this;\n const ariaLabel = `${aiText} - ${buttonLabel}`;\n const classes = classMap({\n [`${prefix}--toggletip-button`]: true,\n [`${prefix}--slug__button`]: true,\n [`${prefix}--slug__button--${size}`]: size,\n [`${prefix}--slug__button--${kind}`]: kind,\n [`${prefix}--slug__button--inline-with-content`]:\n kind === AI_LABEL_KIND.INLINE && aiTextLabel,\n });\n return html`\n <button\n aria-controls=\"${this.id}\"\n @click=\"${this._handleClick}\"\n class=${classes}\n aria-label=\"${ariaLabel}\">\n <span class=\"${prefix}--slug__text\">${aiText}</span>\n ${aiTextLabel && kind === AI_LABEL_KIND.INLINE\n ? html`\n <span class=\"${prefix}--slug__additional-text\">\n ${aiTextLabel}\n </span>\n `\n : ``}\n </button>\n `;\n };\n\n protected _renderInnerContent = () => {\n const { autoalign, revertActive, revertLabel } = this;\n return html`\n ${revertActive\n ? html`\n <cds-custom-icon-button\n ?autoalign=${autoalign}\n kind=\"ghost\"\n size=\"sm\"\n @click=\"${this._handleClick}\">\n <span slot=\"tooltip-content\"> ${revertLabel} </span>\n ${iconLoader(Undo16, { slot: 'icon' })}\n </cds-custom-icon-button>\n `\n : html`\n ${this._renderTooltipButton()} ${this._renderTooltipContent()}\n `}\n `;\n };\n\n attributeChangedCallback(name, old, newValue) {\n super.attributeChangedCallback(name, old, newValue);\n\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment -- https://github.com/carbon-design-system/carbon/issues/20452\n //@ts-ignore typescript does not think requestUpdate() exists on parentElement\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions -- https://github.com/carbon-design-system/carbon/issues/20452\n name === 'revert-active' ? this.parentElement?.requestUpdate() : ``;\n }\n\n static styles = styles;\n}\n\nexport default CDSAILabel;\n"],"names":["customElement"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;AAKG;AAaH;;;;AAIG;AAEH,IAAM,UAAU,GAAhB,MAAM,UAAW,SAAQ,YAAY,CAAA;AAArC,IAAA,WAAA,GAAA;;AACE;;AAEG;QAEH,IAAI,CAAA,IAAA,GAAG,UAAU;AAEjB;;AAEG;QAEH,IAAM,CAAA,MAAA,GAAG,IAAI;AAEb;;AAEG;QAEH,IAAW,CAAA,WAAA,GAAG,EAAE;AAEhB;;AAEG;AAEH,QAAA,IAAA,CAAA,IAAI,GAAG,aAAa,CAAC,OAAO;AAE5B;;AAEG;QAEH,IAAY,CAAA,YAAA,GAAG,KAAK;AAEpB;;AAEG;QAEH,IAAW,CAAA,WAAA,GAAG,oBAAoB;AAElC;;AAEG;AAEH,QAAA,IAAA,CAAA,IAAI,GAAG,aAAa,CAAC,WAAW;AAEhC;;AAEG;QAEH,IAAW,CAAA,WAAA,GAAG,kBAAkB;QAKtB,IAAY,CAAA,YAAA,GAAG,MAAK;AAC5B,YAAA,IAAI,IAAI,CAAC,YAAY,EAAE;AACrB,gBAAA,IAAI,CAAC,YAAY,GAAG,KAAK;AACzB,gBAAA,IAAI,CAAC,eAAe,CAAC,eAAe,CAAC;;iBAChC;gBACL,KAAK,CAAC,YAAY,EAAE;;AAExB,SAAC;QAES,IAAqB,CAAA,qBAAA,GAAG,MAAK;YACrC,OAAO,IAAI,CAAA,CAAA,CAAE;AACf,SAAC;QAES,IAAoB,CAAA,oBAAA,GAAG,MAAK;AACpC,YAAA,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,IAAI;AAC7D,YAAA,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