@carbon/ai-chat-components 0.10.0 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -3
- package/custom-elements.json +4827 -2917
- package/es/components/card/src/card-footer.d.ts +1 -1
- package/es/components/card/src/card-footer.js +2 -1
- package/es/components/card/src/card-footer.js.map +1 -1
- package/es/components/card/src/card-footer.scss.js +1 -1
- package/es/components/card/src/card-steps.d.ts +1 -1
- package/es/components/card/src/card-steps.js +2 -1
- package/es/components/card/src/card-steps.js.map +1 -1
- package/es/components/card/src/card-steps.scss.js +1 -1
- package/es/components/card/src/card.d.ts +1 -1
- package/es/components/card/src/card.js +2 -1
- package/es/components/card/src/card.js.map +1 -1
- package/es/components/card/src/card.scss.js +1 -1
- package/es/components/chain-of-thought/src/chain-of-thought-step.d.ts +1 -1
- package/es/components/chain-of-thought/src/chain-of-thought-step.js +4 -5
- package/es/components/chain-of-thought/src/chain-of-thought-step.js.map +1 -1
- package/es/components/chain-of-thought/src/chain-of-thought-toggle.d.ts +1 -1
- package/es/components/chain-of-thought/src/chain-of-thought-toggle.js +3 -3
- package/es/components/chain-of-thought/src/chain-of-thought-toggle.js.map +1 -1
- package/es/components/chain-of-thought/src/chain-of-thought.d.ts +1 -1
- package/es/components/chain-of-thought/src/chain-of-thought.js +3 -2
- package/es/components/chain-of-thought/src/chain-of-thought.js.map +1 -1
- package/es/components/chain-of-thought/src/chain-of-thought.scss.js +1 -1
- package/es/components/chain-of-thought/src/tool-call-data.d.ts +1 -1
- package/es/components/chain-of-thought/src/tool-call-data.js +2 -1
- package/es/components/chain-of-thought/src/tool-call-data.js.map +1 -1
- package/es/components/chat-button/src/chat-button.d.ts +2 -2
- package/es/components/chat-button/src/chat-button.js +3 -2
- package/es/components/chat-button/src/chat-button.js.map +1 -1
- package/es/components/chat-button/src/chat-button.scss.js +1 -1
- package/es/components/chat-shell/index.d.ts +2 -0
- package/es/components/chat-shell/index.js +1 -0
- package/es/components/chat-shell/index.js.map +1 -1
- package/es/components/chat-shell/src/aria-announcer-manager.d.ts +40 -0
- package/es/components/chat-shell/src/aria-announcer-manager.js +104 -0
- package/es/components/chat-shell/src/aria-announcer-manager.js.map +1 -0
- package/es/components/chat-shell/src/chat-header.d.ts +177 -0
- package/es/components/chat-shell/src/chat-header.js +415 -0
- package/es/components/chat-shell/src/chat-header.js.map +1 -0
- package/es/components/chat-shell/src/chat-header.scss.js +13 -0
- package/es/components/chat-shell/src/chat-header.scss.js.map +1 -0
- package/es/components/chat-shell/src/corner-manager.d.ts +35 -0
- package/es/components/chat-shell/src/corner-manager.js +87 -0
- package/es/components/chat-shell/src/corner-manager.js.map +1 -0
- package/es/components/chat-shell/src/initialization-manager.d.ts +44 -0
- package/es/components/chat-shell/src/initialization-manager.js +88 -0
- package/es/components/chat-shell/src/initialization-manager.js.map +1 -0
- package/es/components/chat-shell/src/panel.d.ts +14 -1
- package/es/components/chat-shell/src/panel.js +32 -4
- package/es/components/chat-shell/src/panel.js.map +1 -1
- package/es/components/chat-shell/src/panel.scss.js +1 -1
- package/es/components/chat-shell/src/resize-observer-manager.d.ts +55 -0
- package/es/components/chat-shell/src/resize-observer-manager.js +219 -0
- package/es/components/chat-shell/src/resize-observer-manager.js.map +1 -0
- package/es/components/chat-shell/src/shell.d.ts +54 -21
- package/es/components/chat-shell/src/shell.js +297 -287
- package/es/components/chat-shell/src/shell.js.map +1 -1
- package/es/components/chat-shell/src/shell.scss.js +1 -1
- package/es/components/chat-shell/src/slot-observer.d.ts +53 -0
- package/es/components/chat-shell/src/slot-observer.js +156 -0
- package/es/components/chat-shell/src/slot-observer.js.map +1 -0
- package/es/components/chat-shell/src/types.d.ts +66 -0
- package/es/components/chat-shell/src/types.js +8 -0
- package/es/components/chat-shell/src/types.js.map +1 -0
- package/es/components/chat-shell/src/workspace-manager.d.ts +12 -1
- package/es/components/chat-shell/src/workspace-manager.js +42 -2
- package/es/components/chat-shell/src/workspace-manager.js.map +1 -1
- package/es/components/code-snippet/index.d.ts +3 -2
- package/es/components/code-snippet/index.js +1 -1
- package/es/components/code-snippet/src/code-snippet.d.ts +58 -15
- package/es/components/code-snippet/src/code-snippet.js +261 -95
- package/es/components/code-snippet/src/code-snippet.js.map +1 -1
- package/es/components/code-snippet/src/code-snippet.scss.js +1 -1
- package/es/components/code-snippet/src/codemirror/codemirror-runtime.d.ts +1 -1
- package/es/components/code-snippet/src/codemirror/codemirror-runtime.js +1 -1
- package/es/components/code-snippet/src/codemirror/editor-manager.d.ts +4 -2
- package/es/components/code-snippet/src/codemirror/editor-manager.js +18 -3
- package/es/components/code-snippet/src/codemirror/editor-manager.js.map +1 -1
- package/es/components/code-snippet/src/codemirror/language-controller.d.ts +1 -0
- package/es/components/code-snippet/src/codemirror/language-controller.js +11 -5
- package/es/components/code-snippet/src/codemirror/language-controller.js.map +1 -1
- package/es/components/code-snippet/src/codemirror/marker-utils.js +2 -1
- package/es/components/code-snippet/src/codemirror/marker-utils.js.map +1 -1
- package/es/components/code-snippet/src/codemirror/theme.d.ts +12 -0
- package/es/components/code-snippet/src/codemirror/theme.js +26 -2
- package/es/components/code-snippet/src/codemirror/theme.js.map +1 -1
- package/es/components/code-snippet/src/dom-utils.d.ts +1 -0
- package/es/components/code-snippet/src/dom-utils.js +12 -1
- package/es/components/code-snippet/src/dom-utils.js.map +1 -1
- package/es/components/code-snippet/src/layout-utils.d.ts +9 -1
- package/es/components/code-snippet/src/layout-utils.js +21 -16
- package/es/components/code-snippet/src/layout-utils.js.map +1 -1
- package/es/components/code-snippet/src/streaming-manager.js +7 -0
- package/es/components/code-snippet/src/streaming-manager.js.map +1 -1
- package/es/components/feedback/src/feedback-buttons.d.ts +2 -0
- package/es/components/feedback/src/feedback-buttons.js +65 -3
- package/es/components/feedback/src/feedback-buttons.js.map +1 -1
- package/es/components/feedback/src/feedback-buttons.scss.js +13 -0
- package/es/components/feedback/src/feedback-buttons.scss.js.map +1 -0
- package/es/components/feedback/src/feedback.d.ts +20 -10
- package/es/components/feedback/src/feedback.js +114 -20
- package/es/components/feedback/src/feedback.js.map +1 -1
- package/es/components/feedback/src/feedback.scss.js +1 -1
- package/es/components/markdown/src/markdown-renderer.d.ts +31 -21
- package/es/components/markdown/src/markdown-renderer.js +57 -48
- package/es/components/markdown/src/markdown-renderer.js.map +1 -1
- package/es/components/markdown/src/markdown.d.ts +34 -31
- package/es/components/markdown/src/markdown.js +221 -138
- package/es/components/markdown/src/markdown.js.map +1 -1
- package/es/components/markdown/src/markdown.scss.js +1 -1
- package/es/components/markdown/src/markdown.template.js +1 -1
- package/es/components/markdown/src/utils.d.ts +0 -4
- package/es/components/markdown/src/utils.js +1 -7
- package/es/components/markdown/src/utils.js.map +1 -1
- package/es/components/processing/src/processing.d.ts +1 -1
- package/es/components/processing/src/processing.js +2 -1
- package/es/components/processing/src/processing.js.map +1 -1
- package/es/components/processing/src/processing.scss.js +1 -1
- package/es/components/reasoning-steps/src/reasoning-step.d.ts +1 -1
- package/es/components/reasoning-steps/src/reasoning-step.js +2 -1
- package/es/components/reasoning-steps/src/reasoning-step.js.map +1 -1
- package/es/components/reasoning-steps/src/reasoning-steps-toggle.d.ts +1 -1
- package/es/components/reasoning-steps/src/reasoning-steps-toggle.js +27 -4
- package/es/components/reasoning-steps/src/reasoning-steps-toggle.js.map +1 -1
- package/es/components/reasoning-steps/src/reasoning-steps-toggle.scss.js +1 -1
- package/es/components/reasoning-steps/src/reasoning-steps.d.ts +1 -1
- package/es/components/reasoning-steps/src/reasoning-steps.js +3 -5
- package/es/components/reasoning-steps/src/reasoning-steps.js.map +1 -1
- package/es/components/table/src/table-pagination.template.js +3 -2
- package/es/components/table/src/table-pagination.template.js.map +1 -1
- package/es/components/table/src/table-skeleton.template.js +8 -6
- package/es/components/table/src/table-skeleton.template.js.map +1 -1
- package/es/components/table/src/table.d.ts +29 -3
- package/es/components/table/src/table.js +99 -6
- package/es/components/table/src/table.js.map +1 -1
- package/es/components/table/src/table.scss.js +1 -1
- package/es/components/table/src/table.template.js +11 -2
- package/es/components/table/src/table.template.js.map +1 -1
- package/es/components/toolbar/src/toolbar.d.ts +32 -5
- package/es/components/toolbar/src/toolbar.js +111 -47
- package/es/components/toolbar/src/toolbar.js.map +1 -1
- package/es/components/toolbar/src/toolbar.scss.js +1 -1
- package/es/components/truncated-text/index.d.ts +9 -0
- package/es/components/truncated-text/index.js +9 -0
- package/es/components/truncated-text/index.js.map +1 -0
- package/es/components/truncated-text/src/truncated-text.d.ts +81 -0
- package/es/components/truncated-text/src/truncated-text.js +282 -0
- package/es/components/truncated-text/src/truncated-text.js.map +1 -0
- package/es/components/truncated-text/src/truncated-text.scss.js +13 -0
- package/es/components/truncated-text/src/truncated-text.scss.js.map +1 -0
- package/es/components/workspace-shell/src/header-collapsible-manager.d.ts +77 -0
- package/es/components/workspace-shell/src/header-collapsible-manager.js +223 -0
- package/es/components/workspace-shell/src/header-collapsible-manager.js.map +1 -0
- package/es/components/workspace-shell/src/workspace-shell-body.d.ts +1 -1
- package/es/components/workspace-shell/src/workspace-shell-body.js +2 -1
- package/es/components/workspace-shell/src/workspace-shell-body.js.map +1 -1
- package/es/components/workspace-shell/src/workspace-shell-footer.d.ts +1 -3
- package/es/components/workspace-shell/src/workspace-shell-footer.js +8 -6
- package/es/components/workspace-shell/src/workspace-shell-footer.js.map +1 -1
- package/es/components/workspace-shell/src/workspace-shell-footer.scss.js +1 -1
- package/es/components/workspace-shell/src/workspace-shell-header.d.ts +11 -1
- package/es/components/workspace-shell/src/workspace-shell-header.js +88 -14
- package/es/components/workspace-shell/src/workspace-shell-header.js.map +1 -1
- package/es/components/workspace-shell/src/workspace-shell-header.scss.js +1 -1
- package/es/components/workspace-shell/src/workspace-shell.d.ts +16 -2
- package/es/components/workspace-shell/src/workspace-shell.js +77 -7
- package/es/components/workspace-shell/src/workspace-shell.js.map +1 -1
- package/es/components/workspace-shell/src/workspace-shell.scss.js +1 -1
- package/es/globals/scss/common.scss.js +13 -0
- package/es/globals/scss/common.scss.js.map +1 -0
- package/es/globals/utils/focus-utils.d.ts +57 -0
- package/es/globals/utils/focus-utils.js +180 -0
- package/es/globals/utils/focus-utils.js.map +1 -0
- package/es/react/card.d.ts +3 -6
- package/es/react/chain-of-thought-step.d.ts +1 -2
- package/es/react/chain-of-thought-toggle.d.ts +1 -2
- package/es/react/chain-of-thought.d.ts +1 -2
- package/es/react/chat-button.d.ts +2 -2
- package/es/react/chat-button.js +1 -1
- package/es/react/chat-header.d.ts +73 -0
- package/es/react/chat-header.js +55 -0
- package/es/react/chat-header.js.map +1 -0
- package/es/react/chat-shell.d.ts +1 -2
- package/es/react/code-snippet.d.ts +35 -2
- package/es/react/code-snippet.js +65 -9
- package/es/react/code-snippet.js.map +1 -1
- package/es/react/feedback-buttons.d.ts +1 -2
- package/es/react/feedback.d.ts +1 -2
- package/es/react/markdown.d.ts +1 -2
- package/es/react/markdown.js +11 -1
- package/es/react/markdown.js.map +1 -1
- package/es/react/panel.d.ts +1 -2
- package/es/react/processing.d.ts +1 -2
- package/es/react/reasoning-step.d.ts +1 -2
- package/es/react/reasoning-steps-toggle.d.ts +1 -2
- package/es/react/reasoning-steps.d.ts +1 -2
- package/es/react/tool-call-data.d.ts +1 -2
- package/es/react/toolbar.d.ts +14 -10
- package/es/react/toolbar.js +2 -0
- package/es/react/toolbar.js.map +1 -1
- package/es/react/utils/withWebComponentBridge.d.ts +5 -2
- package/es/react/utils/withWebComponentBridge.js +49 -1
- package/es/react/utils/withWebComponentBridge.js.map +1 -1
- package/es/react/workspace-shell.d.ts +4 -8
- package/es/testing/PageObjectId.d.ts +22 -0
- package/es/testing/PageObjectId.js +38 -0
- package/es/testing/PageObjectId.js.map +1 -0
- package/es/typings/overflow-menu.d.ts +30 -0
- package/es/typings/overflow-menu.js +8 -0
- package/es/typings/overflow-menu.js.map +1 -0
- package/es-custom/components/card/src/card-footer.d.ts +1 -1
- package/es-custom/components/card/src/card-footer.js +2 -1
- package/es-custom/components/card/src/card-footer.js.map +1 -1
- package/es-custom/components/card/src/card-footer.scss.js +1 -1
- package/es-custom/components/card/src/card-steps.d.ts +1 -1
- package/es-custom/components/card/src/card-steps.js +2 -1
- package/es-custom/components/card/src/card-steps.js.map +1 -1
- package/es-custom/components/card/src/card-steps.scss.js +1 -1
- package/es-custom/components/card/src/card.d.ts +1 -1
- package/es-custom/components/card/src/card.js +2 -1
- package/es-custom/components/card/src/card.js.map +1 -1
- package/es-custom/components/card/src/card.scss.js +1 -1
- package/es-custom/components/chain-of-thought/src/chain-of-thought-step.d.ts +1 -1
- package/es-custom/components/chain-of-thought/src/chain-of-thought-step.js +4 -5
- package/es-custom/components/chain-of-thought/src/chain-of-thought-step.js.map +1 -1
- package/es-custom/components/chain-of-thought/src/chain-of-thought-toggle.d.ts +1 -1
- package/es-custom/components/chain-of-thought/src/chain-of-thought-toggle.js +3 -3
- package/es-custom/components/chain-of-thought/src/chain-of-thought-toggle.js.map +1 -1
- package/es-custom/components/chain-of-thought/src/chain-of-thought.d.ts +1 -1
- package/es-custom/components/chain-of-thought/src/chain-of-thought.js +3 -2
- package/es-custom/components/chain-of-thought/src/chain-of-thought.js.map +1 -1
- package/es-custom/components/chain-of-thought/src/chain-of-thought.scss.js +1 -1
- package/es-custom/components/chain-of-thought/src/tool-call-data.d.ts +1 -1
- package/es-custom/components/chain-of-thought/src/tool-call-data.js +2 -1
- package/es-custom/components/chain-of-thought/src/tool-call-data.js.map +1 -1
- package/es-custom/components/chat-button/src/chat-button.d.ts +2 -2
- package/es-custom/components/chat-button/src/chat-button.js +3 -2
- package/es-custom/components/chat-button/src/chat-button.js.map +1 -1
- package/es-custom/components/chat-button/src/chat-button.scss.js +1 -1
- package/es-custom/components/chat-shell/index.d.ts +2 -0
- package/es-custom/components/chat-shell/index.js +1 -0
- package/es-custom/components/chat-shell/index.js.map +1 -1
- package/es-custom/components/chat-shell/src/aria-announcer-manager.d.ts +40 -0
- package/es-custom/components/chat-shell/src/aria-announcer-manager.js +104 -0
- package/es-custom/components/chat-shell/src/aria-announcer-manager.js.map +1 -0
- package/es-custom/components/chat-shell/src/chat-header.d.ts +177 -0
- package/es-custom/components/chat-shell/src/chat-header.js +415 -0
- package/es-custom/components/chat-shell/src/chat-header.js.map +1 -0
- package/es-custom/components/chat-shell/src/chat-header.scss.js +13 -0
- package/es-custom/components/chat-shell/src/chat-header.scss.js.map +1 -0
- package/es-custom/components/chat-shell/src/corner-manager.d.ts +35 -0
- package/es-custom/components/chat-shell/src/corner-manager.js +87 -0
- package/es-custom/components/chat-shell/src/corner-manager.js.map +1 -0
- package/es-custom/components/chat-shell/src/initialization-manager.d.ts +44 -0
- package/es-custom/components/chat-shell/src/initialization-manager.js +88 -0
- package/es-custom/components/chat-shell/src/initialization-manager.js.map +1 -0
- package/es-custom/components/chat-shell/src/panel.d.ts +14 -1
- package/es-custom/components/chat-shell/src/panel.js +32 -4
- package/es-custom/components/chat-shell/src/panel.js.map +1 -1
- package/es-custom/components/chat-shell/src/panel.scss.js +1 -1
- package/es-custom/components/chat-shell/src/resize-observer-manager.d.ts +55 -0
- package/es-custom/components/chat-shell/src/resize-observer-manager.js +219 -0
- package/es-custom/components/chat-shell/src/resize-observer-manager.js.map +1 -0
- package/es-custom/components/chat-shell/src/shell.d.ts +54 -21
- package/es-custom/components/chat-shell/src/shell.js +297 -287
- package/es-custom/components/chat-shell/src/shell.js.map +1 -1
- package/es-custom/components/chat-shell/src/shell.scss.js +1 -1
- package/es-custom/components/chat-shell/src/slot-observer.d.ts +53 -0
- package/es-custom/components/chat-shell/src/slot-observer.js +156 -0
- package/es-custom/components/chat-shell/src/slot-observer.js.map +1 -0
- package/es-custom/components/chat-shell/src/types.d.ts +66 -0
- package/es-custom/components/chat-shell/src/types.js +8 -0
- package/es-custom/components/chat-shell/src/types.js.map +1 -0
- package/es-custom/components/chat-shell/src/workspace-manager.d.ts +12 -1
- package/es-custom/components/chat-shell/src/workspace-manager.js +42 -2
- package/es-custom/components/chat-shell/src/workspace-manager.js.map +1 -1
- package/es-custom/components/code-snippet/index.d.ts +3 -2
- package/es-custom/components/code-snippet/index.js +1 -1
- package/es-custom/components/code-snippet/src/code-snippet.d.ts +58 -15
- package/es-custom/components/code-snippet/src/code-snippet.js +261 -95
- package/es-custom/components/code-snippet/src/code-snippet.js.map +1 -1
- package/es-custom/components/code-snippet/src/code-snippet.scss.js +1 -1
- package/es-custom/components/code-snippet/src/codemirror/codemirror-runtime.d.ts +1 -1
- package/es-custom/components/code-snippet/src/codemirror/codemirror-runtime.js +1 -1
- package/es-custom/components/code-snippet/src/codemirror/editor-manager.d.ts +4 -2
- package/es-custom/components/code-snippet/src/codemirror/editor-manager.js +18 -3
- package/es-custom/components/code-snippet/src/codemirror/editor-manager.js.map +1 -1
- package/es-custom/components/code-snippet/src/codemirror/language-controller.d.ts +1 -0
- package/es-custom/components/code-snippet/src/codemirror/language-controller.js +11 -5
- package/es-custom/components/code-snippet/src/codemirror/language-controller.js.map +1 -1
- package/es-custom/components/code-snippet/src/codemirror/marker-utils.js +2 -1
- package/es-custom/components/code-snippet/src/codemirror/marker-utils.js.map +1 -1
- package/es-custom/components/code-snippet/src/codemirror/theme.d.ts +12 -0
- package/es-custom/components/code-snippet/src/codemirror/theme.js +26 -2
- package/es-custom/components/code-snippet/src/codemirror/theme.js.map +1 -1
- package/es-custom/components/code-snippet/src/dom-utils.d.ts +1 -0
- package/es-custom/components/code-snippet/src/dom-utils.js +12 -1
- package/es-custom/components/code-snippet/src/dom-utils.js.map +1 -1
- package/es-custom/components/code-snippet/src/layout-utils.d.ts +9 -1
- package/es-custom/components/code-snippet/src/layout-utils.js +21 -16
- package/es-custom/components/code-snippet/src/layout-utils.js.map +1 -1
- package/es-custom/components/code-snippet/src/streaming-manager.js +7 -0
- package/es-custom/components/code-snippet/src/streaming-manager.js.map +1 -1
- package/es-custom/components/feedback/src/feedback-buttons.d.ts +2 -0
- package/es-custom/components/feedback/src/feedback-buttons.js +65 -3
- package/es-custom/components/feedback/src/feedback-buttons.js.map +1 -1
- package/es-custom/components/feedback/src/feedback-buttons.scss.js +13 -0
- package/es-custom/components/feedback/src/feedback-buttons.scss.js.map +1 -0
- package/es-custom/components/feedback/src/feedback.d.ts +20 -10
- package/es-custom/components/feedback/src/feedback.js +114 -20
- package/es-custom/components/feedback/src/feedback.js.map +1 -1
- package/es-custom/components/feedback/src/feedback.scss.js +1 -1
- package/es-custom/components/markdown/src/markdown-renderer.d.ts +31 -21
- package/es-custom/components/markdown/src/markdown-renderer.js +57 -48
- package/es-custom/components/markdown/src/markdown-renderer.js.map +1 -1
- package/es-custom/components/markdown/src/markdown.d.ts +34 -31
- package/es-custom/components/markdown/src/markdown.js +221 -138
- package/es-custom/components/markdown/src/markdown.js.map +1 -1
- package/es-custom/components/markdown/src/markdown.scss.js +1 -1
- package/es-custom/components/markdown/src/markdown.template.js +1 -1
- package/es-custom/components/markdown/src/utils.d.ts +0 -4
- package/es-custom/components/markdown/src/utils.js +1 -7
- package/es-custom/components/markdown/src/utils.js.map +1 -1
- package/es-custom/components/processing/src/processing.d.ts +1 -1
- package/es-custom/components/processing/src/processing.js +2 -1
- package/es-custom/components/processing/src/processing.js.map +1 -1
- package/es-custom/components/processing/src/processing.scss.js +1 -1
- package/es-custom/components/reasoning-steps/src/reasoning-step.d.ts +1 -1
- package/es-custom/components/reasoning-steps/src/reasoning-step.js +2 -1
- package/es-custom/components/reasoning-steps/src/reasoning-step.js.map +1 -1
- package/es-custom/components/reasoning-steps/src/reasoning-steps-toggle.d.ts +1 -1
- package/es-custom/components/reasoning-steps/src/reasoning-steps-toggle.js +27 -4
- package/es-custom/components/reasoning-steps/src/reasoning-steps-toggle.js.map +1 -1
- package/es-custom/components/reasoning-steps/src/reasoning-steps-toggle.scss.js +1 -1
- package/es-custom/components/reasoning-steps/src/reasoning-steps.d.ts +1 -1
- package/es-custom/components/reasoning-steps/src/reasoning-steps.js +3 -5
- package/es-custom/components/reasoning-steps/src/reasoning-steps.js.map +1 -1
- package/es-custom/components/table/src/table-pagination.template.js +3 -2
- package/es-custom/components/table/src/table-pagination.template.js.map +1 -1
- package/es-custom/components/table/src/table-skeleton.template.js +8 -6
- package/es-custom/components/table/src/table-skeleton.template.js.map +1 -1
- package/es-custom/components/table/src/table.d.ts +29 -3
- package/es-custom/components/table/src/table.js +99 -6
- package/es-custom/components/table/src/table.js.map +1 -1
- package/es-custom/components/table/src/table.scss.js +1 -1
- package/es-custom/components/table/src/table.template.js +11 -2
- package/es-custom/components/table/src/table.template.js.map +1 -1
- package/es-custom/components/toolbar/src/toolbar.d.ts +32 -5
- package/es-custom/components/toolbar/src/toolbar.js +111 -47
- package/es-custom/components/toolbar/src/toolbar.js.map +1 -1
- package/es-custom/components/toolbar/src/toolbar.scss.js +1 -1
- package/es-custom/components/truncated-text/index.d.ts +9 -0
- package/es-custom/components/truncated-text/index.js +9 -0
- package/es-custom/components/truncated-text/index.js.map +1 -0
- package/es-custom/components/truncated-text/src/truncated-text.d.ts +81 -0
- package/es-custom/components/truncated-text/src/truncated-text.js +282 -0
- package/es-custom/components/truncated-text/src/truncated-text.js.map +1 -0
- package/es-custom/components/truncated-text/src/truncated-text.scss.js +13 -0
- package/es-custom/components/truncated-text/src/truncated-text.scss.js.map +1 -0
- package/es-custom/components/workspace-shell/src/header-collapsible-manager.d.ts +77 -0
- package/es-custom/components/workspace-shell/src/header-collapsible-manager.js +223 -0
- package/es-custom/components/workspace-shell/src/header-collapsible-manager.js.map +1 -0
- package/es-custom/components/workspace-shell/src/workspace-shell-body.d.ts +1 -1
- package/es-custom/components/workspace-shell/src/workspace-shell-body.js +2 -1
- package/es-custom/components/workspace-shell/src/workspace-shell-body.js.map +1 -1
- package/es-custom/components/workspace-shell/src/workspace-shell-footer.d.ts +1 -3
- package/es-custom/components/workspace-shell/src/workspace-shell-footer.js +8 -6
- package/es-custom/components/workspace-shell/src/workspace-shell-footer.js.map +1 -1
- package/es-custom/components/workspace-shell/src/workspace-shell-footer.scss.js +1 -1
- package/es-custom/components/workspace-shell/src/workspace-shell-header.d.ts +11 -1
- package/es-custom/components/workspace-shell/src/workspace-shell-header.js +88 -14
- package/es-custom/components/workspace-shell/src/workspace-shell-header.js.map +1 -1
- package/es-custom/components/workspace-shell/src/workspace-shell-header.scss.js +1 -1
- package/es-custom/components/workspace-shell/src/workspace-shell.d.ts +16 -2
- package/es-custom/components/workspace-shell/src/workspace-shell.js +77 -7
- package/es-custom/components/workspace-shell/src/workspace-shell.js.map +1 -1
- package/es-custom/components/workspace-shell/src/workspace-shell.scss.js +1 -1
- package/es-custom/globals/scss/common.scss.js +13 -0
- package/es-custom/globals/scss/common.scss.js.map +1 -0
- package/es-custom/globals/utils/focus-utils.d.ts +57 -0
- package/es-custom/globals/utils/focus-utils.js +180 -0
- package/es-custom/globals/utils/focus-utils.js.map +1 -0
- package/es-custom/react/card.d.ts +3 -6
- package/es-custom/react/chain-of-thought-step.d.ts +1 -2
- package/es-custom/react/chain-of-thought-toggle.d.ts +1 -2
- package/es-custom/react/chain-of-thought.d.ts +1 -2
- package/es-custom/react/chat-button.d.ts +2 -2
- package/es-custom/react/chat-button.js +1 -1
- package/es-custom/react/chat-header.d.ts +73 -0
- package/es-custom/react/chat-header.js +55 -0
- package/es-custom/react/chat-header.js.map +1 -0
- package/es-custom/react/chat-shell.d.ts +1 -2
- package/es-custom/react/code-snippet.d.ts +35 -2
- package/es-custom/react/code-snippet.js +65 -9
- package/es-custom/react/code-snippet.js.map +1 -1
- package/es-custom/react/feedback-buttons.d.ts +1 -2
- package/es-custom/react/feedback.d.ts +1 -2
- package/es-custom/react/markdown.d.ts +1 -2
- package/es-custom/react/markdown.js +11 -1
- package/es-custom/react/markdown.js.map +1 -1
- package/es-custom/react/panel.d.ts +1 -2
- package/es-custom/react/processing.d.ts +1 -2
- package/es-custom/react/reasoning-step.d.ts +1 -2
- package/es-custom/react/reasoning-steps-toggle.d.ts +1 -2
- package/es-custom/react/reasoning-steps.d.ts +1 -2
- package/es-custom/react/tool-call-data.d.ts +1 -2
- package/es-custom/react/toolbar.d.ts +14 -10
- package/es-custom/react/toolbar.js +2 -0
- package/es-custom/react/toolbar.js.map +1 -1
- package/es-custom/react/utils/withWebComponentBridge.d.ts +5 -2
- package/es-custom/react/utils/withWebComponentBridge.js +49 -1
- package/es-custom/react/utils/withWebComponentBridge.js.map +1 -1
- package/es-custom/react/workspace-shell.d.ts +4 -8
- package/es-custom/testing/PageObjectId.d.ts +22 -0
- package/es-custom/testing/PageObjectId.js +38 -0
- package/es-custom/testing/PageObjectId.js.map +1 -0
- package/es-custom/typings/overflow-menu.d.ts +30 -0
- package/es-custom/typings/overflow-menu.js +8 -0
- package/es-custom/typings/overflow-menu.js.map +1 -0
- package/package.json +6 -4
- package/scss/_custom-properties.scss +70 -0
- package/scss/_modifiers.scss +231 -0
- package/scss/_tokens-component.scss +30 -0
- package/scss/_tokens-layout.scss +29 -0
- package/scss/_utilities.scss +32 -0
- package/scss/common.scss +150 -0
- package/scss/grid.scss +11 -0
- package/scss/themes.scss +33 -0
- package/scss/vars.scss +12 -0
- package/telemetry.yml +73 -33
- package/es/components/code-snippet/src/code-snippet-card.d.ts +0 -63
- package/es/components/code-snippet/src/code-snippet-card.js +0 -187
- package/es/components/code-snippet/src/code-snippet-card.js.map +0 -1
- package/es/components/feedback/src/feedback-buttons.template.d.ts +0 -4
- package/es/components/feedback/src/feedback-buttons.template.js +0 -79
- package/es/components/feedback/src/feedback-buttons.template.js.map +0 -1
- package/es/components/feedback/src/feedback.template.d.ts +0 -12
- package/es/components/feedback/src/feedback.template.js +0 -115
- package/es/components/feedback/src/feedback.template.js.map +0 -1
- package/es/components/reasoning-steps/src/reasoning-steps-toggle.template.d.ts +0 -3
- package/es/components/reasoning-steps/src/reasoning-steps-toggle.template.js +0 -43
- package/es/components/reasoning-steps/src/reasoning-steps-toggle.template.js.map +0 -1
- package/es/react/code-snippet-card.d.ts +0 -4
- package/es/react/code-snippet-card.js +0 -31
- package/es/react/code-snippet-card.js.map +0 -1
- package/es-custom/components/code-snippet/src/code-snippet-card.d.ts +0 -63
- package/es-custom/components/code-snippet/src/code-snippet-card.js +0 -187
- package/es-custom/components/code-snippet/src/code-snippet-card.js.map +0 -1
- package/es-custom/components/feedback/src/feedback-buttons.template.d.ts +0 -4
- package/es-custom/components/feedback/src/feedback-buttons.template.js +0 -79
- package/es-custom/components/feedback/src/feedback-buttons.template.js.map +0 -1
- package/es-custom/components/feedback/src/feedback.template.d.ts +0 -12
- package/es-custom/components/feedback/src/feedback.template.js +0 -115
- package/es-custom/components/feedback/src/feedback.template.js.map +0 -1
- package/es-custom/components/reasoning-steps/src/reasoning-steps-toggle.template.d.ts +0 -3
- package/es-custom/components/reasoning-steps/src/reasoning-steps-toggle.template.js +0 -43
- package/es-custom/components/reasoning-steps/src/reasoning-steps-toggle.template.js.map +0 -1
- package/es-custom/react/code-snippet-card.d.ts +0 -4
- package/es-custom/react/code-snippet-card.js +0 -31
- package/es-custom/react/code-snippet-card.js.map +0 -1
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2025
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { __decorate } from 'tslib';
|
|
9
|
+
import { LitElement, nothing, html } from 'lit';
|
|
10
|
+
import { property } from 'lit/decorators.js';
|
|
11
|
+
import { carbonElement } from '../../../globals/decorators/carbon-element.js';
|
|
12
|
+
import { iconLoader } from '@carbon/web-components/es/globals/internal/icon-loader.js';
|
|
13
|
+
import '@carbon/web-components/es/components/button/index.js';
|
|
14
|
+
import '@carbon/web-components/es/components/overflow-menu/index.js';
|
|
15
|
+
import '../../toolbar/src/toolbar.js';
|
|
16
|
+
import prefix from '../../../globals/settings.js';
|
|
17
|
+
import { PageObjectId } from '../../../testing/PageObjectId.js';
|
|
18
|
+
import { tryFocus } from '../../../globals/utils/focus-utils.js';
|
|
19
|
+
import styles from './chat-header.scss.js';
|
|
20
|
+
|
|
21
|
+
/*
|
|
22
|
+
* Copyright IBM Corp. 2025
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
25
|
+
* LICENSE file in the root directory of this source tree.
|
|
26
|
+
*
|
|
27
|
+
* @license
|
|
28
|
+
*/
|
|
29
|
+
var CdsAiChatChatHeader_1;
|
|
30
|
+
/**
|
|
31
|
+
* Chat Header component that wraps the Toolbar component.
|
|
32
|
+
* Provides a consistent header for chat interfaces with support for
|
|
33
|
+
* navigation, title, actions, and decorators (like AI labels).
|
|
34
|
+
*
|
|
35
|
+
* @element cds-aichat-chat-header
|
|
36
|
+
* @slot navigation - Navigation controls (e.g., back button, overflow menu)
|
|
37
|
+
* @slot title - Title and name content (can also use title/name properties)
|
|
38
|
+
* @slot decorator - Decorative elements like AI labels
|
|
39
|
+
* @slot fixed-actions - Actions that never overflow (allows passing custom components)
|
|
40
|
+
*/
|
|
41
|
+
let CdsAiChatChatHeader = CdsAiChatChatHeader_1 = class CdsAiChatChatHeader extends LitElement {
|
|
42
|
+
constructor() {
|
|
43
|
+
super(...arguments);
|
|
44
|
+
/**
|
|
45
|
+
* Array of actions that can overflow into a menu when space is limited.
|
|
46
|
+
*/
|
|
47
|
+
this.actions = [];
|
|
48
|
+
/**
|
|
49
|
+
* Enable overflow behavior for actions.
|
|
50
|
+
*/
|
|
51
|
+
this.overflow = false;
|
|
52
|
+
/**
|
|
53
|
+
* Optional header title text to display.
|
|
54
|
+
*/
|
|
55
|
+
this.headerTitle = "";
|
|
56
|
+
/**
|
|
57
|
+
* Optional name text to display after the title.
|
|
58
|
+
*/
|
|
59
|
+
this.headerName = "";
|
|
60
|
+
/**
|
|
61
|
+
* Type of navigation to display: 'back', 'overflow', or 'none'.
|
|
62
|
+
*/
|
|
63
|
+
this.navigationType = "none";
|
|
64
|
+
/**
|
|
65
|
+
* Label/tooltip text for the back button.
|
|
66
|
+
*/
|
|
67
|
+
this.navigationBackLabel = "";
|
|
68
|
+
/**
|
|
69
|
+
* Label/tooltip text for the overflow menu button.
|
|
70
|
+
*/
|
|
71
|
+
this.navigationOverflowLabel = "";
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Attempts to focus an element if it's focusable and not disabled.
|
|
75
|
+
* Uses the enhanced tryFocus utility from focus-utils which checks
|
|
76
|
+
* visibility, accessibility attributes, and proper focusability.
|
|
77
|
+
*
|
|
78
|
+
* @param element - The element to attempt to focus
|
|
79
|
+
* @returns True if focus was successfully set, false otherwise
|
|
80
|
+
*/
|
|
81
|
+
tryFocusElement(element) {
|
|
82
|
+
return tryFocus(element);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Attempts to focus buttons within a named slot.
|
|
86
|
+
* Reduces duplication by centralizing slot querying logic.
|
|
87
|
+
*
|
|
88
|
+
* @param slotName - The name of the slot to query
|
|
89
|
+
* @param selectors - CSS selector string for buttons to find
|
|
90
|
+
* @returns True if a button was focused, false otherwise
|
|
91
|
+
*/
|
|
92
|
+
tryFocusSlotButtons(slotName, selectors) {
|
|
93
|
+
const slot = this.shadowRoot?.querySelector(`slot[name="${slotName}"]`);
|
|
94
|
+
if (!slot) {
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
for (const el of slot.assignedElements()) {
|
|
98
|
+
const button = el.querySelector(selectors);
|
|
99
|
+
if (button instanceof HTMLElement && this.tryFocusElement(button)) {
|
|
100
|
+
return true;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
return false;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Requests focus on the best available focusable element within the component.
|
|
107
|
+
* This method implements a generic focus management pattern that can be used
|
|
108
|
+
* across all web components.
|
|
109
|
+
*
|
|
110
|
+
* Priority order:
|
|
111
|
+
* 1. First enabled button in navigation (either slotted or rendered from properties)
|
|
112
|
+
* 2. First enabled button in fixed-actions slot (usually close button)
|
|
113
|
+
* 3. First enabled action button from toolbar (rendered by actions array)
|
|
114
|
+
* 4. Any other focusable element (last resort)
|
|
115
|
+
*
|
|
116
|
+
* @returns True if focus was successfully set, false otherwise
|
|
117
|
+
*/
|
|
118
|
+
requestFocus() {
|
|
119
|
+
// Check if navigation is rendered from properties
|
|
120
|
+
const hasNavigationProps = this.navigationType && this.navigationType !== "none";
|
|
121
|
+
// Define focus strategies in priority order
|
|
122
|
+
const focusStrategies = [
|
|
123
|
+
// 1. Try navigation - either slotted or rendered from properties
|
|
124
|
+
() => {
|
|
125
|
+
if (hasNavigationProps) {
|
|
126
|
+
// Navigation rendered from properties - query toolbar's navigation slot
|
|
127
|
+
const toolbar = this.shadowRoot?.querySelector(`${prefix}-toolbar`);
|
|
128
|
+
const navSlot = toolbar?.shadowRoot?.querySelector('slot[name="navigation"]');
|
|
129
|
+
if (navSlot) {
|
|
130
|
+
// Get the assigned elements from the toolbar's navigation slot
|
|
131
|
+
const assignedElements = navSlot.assignedElements();
|
|
132
|
+
for (const el of assignedElements) {
|
|
133
|
+
// The element itself might be the button (e.g., cds-icon-button)
|
|
134
|
+
if (this.tryFocusElement(el)) {
|
|
135
|
+
return true;
|
|
136
|
+
}
|
|
137
|
+
// Or it might be a wrapper div containing the button
|
|
138
|
+
const button = el.querySelector(CdsAiChatChatHeader_1.NAV_BUTTON_SELECTORS);
|
|
139
|
+
if (button && this.tryFocusElement(button)) {
|
|
140
|
+
return true;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
return false;
|
|
145
|
+
}
|
|
146
|
+
else {
|
|
147
|
+
// Navigation slotted - query slot for buttons
|
|
148
|
+
return this.tryFocusSlotButtons("navigation", CdsAiChatChatHeader_1.NAV_BUTTON_SELECTORS);
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
// 2. Try fixed-actions slot
|
|
152
|
+
() => this.tryFocusSlotButtons("fixed-actions", CdsAiChatChatHeader_1.BUTTON_SELECTORS),
|
|
153
|
+
// 3. Try toolbar action buttons
|
|
154
|
+
() => {
|
|
155
|
+
const toolbar = this.shadowRoot?.querySelector(`${prefix}-toolbar`);
|
|
156
|
+
const buttons = toolbar?.shadowRoot?.querySelectorAll(CdsAiChatChatHeader_1.TOOLBAR_ACTION_SELECTOR);
|
|
157
|
+
return (buttons?.[0] instanceof HTMLElement &&
|
|
158
|
+
this.tryFocusElement(buttons[0]));
|
|
159
|
+
},
|
|
160
|
+
// 4. Try any focusable element as last resort
|
|
161
|
+
() => {
|
|
162
|
+
const focusable = this.shadowRoot?.querySelector(CdsAiChatChatHeader_1.FOCUSABLE_SELECTORS);
|
|
163
|
+
return (focusable instanceof HTMLElement && this.tryFocusElement(focusable));
|
|
164
|
+
},
|
|
165
|
+
];
|
|
166
|
+
// Execute strategies until one succeeds
|
|
167
|
+
return focusStrategies.some((strategy) => strategy());
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Renders the overflow menu items.
|
|
171
|
+
*/
|
|
172
|
+
renderOverflowMenuItems() {
|
|
173
|
+
return this.navigationOverflowItems?.map((item) => html `
|
|
174
|
+
<cds-overflow-menu-item
|
|
175
|
+
@click=${item.onClick}
|
|
176
|
+
href=${item.href || nothing}
|
|
177
|
+
target=${item.href ? item.target || "_self" : nothing}
|
|
178
|
+
?disabled=${item.disabled}
|
|
179
|
+
?danger=${item.danger}
|
|
180
|
+
danger-description=${item.dangerDescription || nothing}
|
|
181
|
+
?divider=${item.divider}
|
|
182
|
+
data-testid=${item.testId || nothing}
|
|
183
|
+
>
|
|
184
|
+
${item.text}
|
|
185
|
+
</cds-overflow-menu-item>
|
|
186
|
+
`);
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* Checks if back navigation should be rendered.
|
|
190
|
+
* @returns True if back navigation type is set and icon is provided
|
|
191
|
+
*/
|
|
192
|
+
shouldRenderBackNavigation() {
|
|
193
|
+
return this.navigationType === "back" && !!this.navigationBackIcon;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Checks if overflow navigation should be rendered.
|
|
197
|
+
* @returns True if overflow navigation type is set and items are available
|
|
198
|
+
*/
|
|
199
|
+
shouldRenderOverflowNavigation() {
|
|
200
|
+
return (this.navigationType === "overflow" &&
|
|
201
|
+
!!this.navigationOverflowItems?.length);
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Gets the configuration object for overflow menu icon.
|
|
205
|
+
* @returns Icon loader configuration with class and slot
|
|
206
|
+
*/
|
|
207
|
+
getOverflowIconConfig() {
|
|
208
|
+
return {
|
|
209
|
+
class: `${prefix}-chat-header-overflow-icon`,
|
|
210
|
+
slot: "icon",
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Renders the back navigation button.
|
|
215
|
+
* @returns Template result for back button
|
|
216
|
+
*/
|
|
217
|
+
renderBackNavigation() {
|
|
218
|
+
return html `
|
|
219
|
+
<div slot="navigation">
|
|
220
|
+
<cds-icon-button
|
|
221
|
+
kind="ghost"
|
|
222
|
+
size="md"
|
|
223
|
+
tooltip-alignment=${CdsAiChatChatHeader_1.NAV_TOOLTIP_CONFIG.alignment}
|
|
224
|
+
tooltip-position=${CdsAiChatChatHeader_1.NAV_TOOLTIP_CONFIG.position}
|
|
225
|
+
enter-delay-ms=${CdsAiChatChatHeader_1.NAV_TOOLTIP_CONFIG.enterDelayMs}
|
|
226
|
+
leave-delay-ms=${CdsAiChatChatHeader_1.NAV_TOOLTIP_CONFIG.leaveDelayMs}
|
|
227
|
+
@click=${this.navigationBackOnClick}
|
|
228
|
+
>
|
|
229
|
+
${iconLoader(this.navigationBackIcon, CdsAiChatChatHeader_1.BACK_ICON_CONFIG)}
|
|
230
|
+
<span slot="tooltip-content">${this.navigationBackLabel}</span>
|
|
231
|
+
</cds-icon-button>
|
|
232
|
+
</div>
|
|
233
|
+
`;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Renders the overflow navigation menu.
|
|
237
|
+
* @returns Template result for overflow menu
|
|
238
|
+
*/
|
|
239
|
+
renderOverflowNavigation() {
|
|
240
|
+
// Check if RTL direction is set
|
|
241
|
+
const isRTL = document.dir === "rtl" || document.documentElement.dir === "rtl";
|
|
242
|
+
// For LTR: menu opens right
|
|
243
|
+
// For RTL: menu opens left
|
|
244
|
+
const menuAlignment = isRTL ? "left" : "right";
|
|
245
|
+
return html `
|
|
246
|
+
<div
|
|
247
|
+
slot="navigation"
|
|
248
|
+
data-floating-menu-container
|
|
249
|
+
class="${prefix}-chat-header-overflow-wrapper"
|
|
250
|
+
>
|
|
251
|
+
<cds-overflow-menu
|
|
252
|
+
align=${menuAlignment}
|
|
253
|
+
tooltip-alignment=${CdsAiChatChatHeader_1.NAV_TOOLTIP_CONFIG.alignment}
|
|
254
|
+
tooltip-position=${CdsAiChatChatHeader_1.NAV_TOOLTIP_CONFIG.position}
|
|
255
|
+
enter-delay-ms=${CdsAiChatChatHeader_1.NAV_TOOLTIP_CONFIG.enterDelayMs}
|
|
256
|
+
leave-delay-ms=${CdsAiChatChatHeader_1.NAV_TOOLTIP_CONFIG.leaveDelayMs}
|
|
257
|
+
@click=${this.navigationOverflowOnClick}
|
|
258
|
+
>
|
|
259
|
+
${this.navigationOverflowIcon
|
|
260
|
+
? iconLoader(this.navigationOverflowIcon, this.getOverflowIconConfig())
|
|
261
|
+
: nothing}
|
|
262
|
+
<span slot="tooltip-content">${this.navigationOverflowLabel}</span>
|
|
263
|
+
<cds-overflow-menu-body>
|
|
264
|
+
${this.renderOverflowMenuItems()}
|
|
265
|
+
</cds-overflow-menu-body>
|
|
266
|
+
</cds-overflow-menu>
|
|
267
|
+
</div>
|
|
268
|
+
`;
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Renders the navigation content based on navigationType.
|
|
272
|
+
* Uses guard clauses and extracted methods for clarity.
|
|
273
|
+
* @returns Template result for navigation or nothing
|
|
274
|
+
*/
|
|
275
|
+
renderNavigation() {
|
|
276
|
+
if (!this.navigationType || this.navigationType === "none") {
|
|
277
|
+
return nothing;
|
|
278
|
+
}
|
|
279
|
+
if (this.shouldRenderBackNavigation()) {
|
|
280
|
+
return this.renderBackNavigation();
|
|
281
|
+
}
|
|
282
|
+
if (this.shouldRenderOverflowNavigation()) {
|
|
283
|
+
return this.renderOverflowNavigation();
|
|
284
|
+
}
|
|
285
|
+
return nothing;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Renders the title content based on headerTitle and headerName properties.
|
|
289
|
+
* @returns Template result for title content or title slot
|
|
290
|
+
*/
|
|
291
|
+
renderTitle() {
|
|
292
|
+
const hasTitle = this.headerTitle || this.headerName;
|
|
293
|
+
if (!hasTitle) {
|
|
294
|
+
return html `<slot name="title"></slot>`;
|
|
295
|
+
}
|
|
296
|
+
return html `
|
|
297
|
+
<div slot="title" class="cds-aichat-chat-header__title">
|
|
298
|
+
${this.headerTitle
|
|
299
|
+
? html `
|
|
300
|
+
<span
|
|
301
|
+
class="cds-aichat-chat-header__title-text"
|
|
302
|
+
data-testid=${PageObjectId.HEADER_TITLE}
|
|
303
|
+
>
|
|
304
|
+
${this.headerTitle}
|
|
305
|
+
</span>
|
|
306
|
+
`
|
|
307
|
+
: nothing}
|
|
308
|
+
${this.headerName
|
|
309
|
+
? html `
|
|
310
|
+
<span
|
|
311
|
+
class="cds-aichat-chat-header__name-text"
|
|
312
|
+
data-testid=${PageObjectId.HEADER_NAME}
|
|
313
|
+
>
|
|
314
|
+
${this.headerName}
|
|
315
|
+
</span>
|
|
316
|
+
`
|
|
317
|
+
: nothing}
|
|
318
|
+
</div>
|
|
319
|
+
`;
|
|
320
|
+
}
|
|
321
|
+
render() {
|
|
322
|
+
// Determine if we should render navigation from props or use slot
|
|
323
|
+
const hasNavigationProps = this.navigationType && this.navigationType !== "none";
|
|
324
|
+
const navigationContent = hasNavigationProps
|
|
325
|
+
? this.renderNavigation()
|
|
326
|
+
: html `<slot name="navigation"></slot>`;
|
|
327
|
+
return html `
|
|
328
|
+
<cds-aichat-toolbar
|
|
329
|
+
.actions=${this.actions}
|
|
330
|
+
?overflow=${this.overflow}
|
|
331
|
+
titleText=${this.headerTitle || nothing}
|
|
332
|
+
nameText=${this.headerName || nothing}
|
|
333
|
+
data-testid=${PageObjectId.CHAT_HEADER}
|
|
334
|
+
>
|
|
335
|
+
${navigationContent}
|
|
336
|
+
${!this.headerTitle && !this.headerName ? this.renderTitle() : nothing}
|
|
337
|
+
<slot name="fixed-actions" slot="fixed-actions"></slot>
|
|
338
|
+
<slot name="decorator" slot="decorator"></slot>
|
|
339
|
+
</cds-aichat-toolbar>
|
|
340
|
+
`;
|
|
341
|
+
}
|
|
342
|
+
};
|
|
343
|
+
CdsAiChatChatHeader.styles = styles;
|
|
344
|
+
/**
|
|
345
|
+
* Selector strings for finding focusable elements.
|
|
346
|
+
*
|
|
347
|
+
* Design rationale:
|
|
348
|
+
* - BUTTON_SELECTORS: Used for fixed-actions slot. Targets Carbon buttons and native buttons.
|
|
349
|
+
* - NAV_BUTTON_SELECTORS: Used for navigation slot. Includes overflow menu for navigation patterns.
|
|
350
|
+
* - TOOLBAR_ACTION_SELECTOR: Specifically targets toolbar icon buttons (most common action type).
|
|
351
|
+
* - FOCUSABLE_SELECTORS: Fallback selector for any focusable element. Uses "*" because the
|
|
352
|
+
* tryFocus() utility already performs comprehensive validation including:
|
|
353
|
+
* - Visibility checks (display, visibility, hidden, inert, aria-hidden)
|
|
354
|
+
* - Focusability validation (handles standard elements and custom elements with delegatesFocus)
|
|
355
|
+
* - Actual focus verification (checks if document.activeElement changed)
|
|
356
|
+
* This approach avoids duplicating validation logic and properly handles Carbon components.
|
|
357
|
+
*/
|
|
358
|
+
CdsAiChatChatHeader.BUTTON_SELECTORS = "cds-button, cds-icon-button, button";
|
|
359
|
+
CdsAiChatChatHeader.NAV_BUTTON_SELECTORS = "cds-button, cds-icon-button, cds-overflow-menu, button";
|
|
360
|
+
CdsAiChatChatHeader.FOCUSABLE_SELECTORS = "*";
|
|
361
|
+
CdsAiChatChatHeader.TOOLBAR_ACTION_SELECTOR = "cds-icon-button:not([disabled])";
|
|
362
|
+
/**
|
|
363
|
+
* Configuration constants for navigation elements.
|
|
364
|
+
*/
|
|
365
|
+
CdsAiChatChatHeader.BACK_ICON_CONFIG = { slot: "icon" };
|
|
366
|
+
CdsAiChatChatHeader.NAV_TOOLTIP_CONFIG = {
|
|
367
|
+
alignment: "end",
|
|
368
|
+
position: "right",
|
|
369
|
+
enterDelayMs: "0",
|
|
370
|
+
leaveDelayMs: "0",
|
|
371
|
+
};
|
|
372
|
+
__decorate([
|
|
373
|
+
property({ type: Array, attribute: false })
|
|
374
|
+
], CdsAiChatChatHeader.prototype, "actions", void 0);
|
|
375
|
+
__decorate([
|
|
376
|
+
property({ type: Boolean, attribute: "overflow", reflect: true })
|
|
377
|
+
], CdsAiChatChatHeader.prototype, "overflow", void 0);
|
|
378
|
+
__decorate([
|
|
379
|
+
property({ type: String, attribute: "header-title" })
|
|
380
|
+
], CdsAiChatChatHeader.prototype, "headerTitle", void 0);
|
|
381
|
+
__decorate([
|
|
382
|
+
property({ type: String, attribute: "header-name" })
|
|
383
|
+
], CdsAiChatChatHeader.prototype, "headerName", void 0);
|
|
384
|
+
__decorate([
|
|
385
|
+
property({ type: String, attribute: "navigation-type" })
|
|
386
|
+
], CdsAiChatChatHeader.prototype, "navigationType", void 0);
|
|
387
|
+
__decorate([
|
|
388
|
+
property({ type: Object, attribute: false })
|
|
389
|
+
], CdsAiChatChatHeader.prototype, "navigationBackIcon", void 0);
|
|
390
|
+
__decorate([
|
|
391
|
+
property({ type: String, attribute: "navigation-back-label" })
|
|
392
|
+
], CdsAiChatChatHeader.prototype, "navigationBackLabel", void 0);
|
|
393
|
+
__decorate([
|
|
394
|
+
property({ type: Object, attribute: false })
|
|
395
|
+
], CdsAiChatChatHeader.prototype, "navigationBackOnClick", void 0);
|
|
396
|
+
__decorate([
|
|
397
|
+
property({ type: Array, attribute: false })
|
|
398
|
+
], CdsAiChatChatHeader.prototype, "navigationOverflowItems", void 0);
|
|
399
|
+
__decorate([
|
|
400
|
+
property({ type: String, attribute: "navigation-overflow-label" })
|
|
401
|
+
], CdsAiChatChatHeader.prototype, "navigationOverflowLabel", void 0);
|
|
402
|
+
__decorate([
|
|
403
|
+
property({ type: Object, attribute: false })
|
|
404
|
+
], CdsAiChatChatHeader.prototype, "navigationOverflowIcon", void 0);
|
|
405
|
+
__decorate([
|
|
406
|
+
property({ type: Object, attribute: false })
|
|
407
|
+
], CdsAiChatChatHeader.prototype, "navigationOverflowOnClick", void 0);
|
|
408
|
+
CdsAiChatChatHeader = CdsAiChatChatHeader_1 = __decorate([
|
|
409
|
+
carbonElement(`${prefix}-chat-header`)
|
|
410
|
+
], CdsAiChatChatHeader);
|
|
411
|
+
var CdsAiChatChatHeader$1 = CdsAiChatChatHeader;
|
|
412
|
+
// Made with Bob
|
|
413
|
+
|
|
414
|
+
export { CdsAiChatChatHeader, CdsAiChatChatHeader$1 as default };
|
|
415
|
+
//# sourceMappingURL=chat-header.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-header.js","sources":["../../../../src/components/chat-shell/src/chat-header.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;AAOG;;AAuBH;;;;;;;;;;AAUG;AAEH,IAAM,mBAAmB,GAAA,qBAAA,GAAzB,MAAM,mBAAoB,SAAQ,UAAU,CAAA;AAA5C,IAAA,WAAA,GAAA;;AAqKE;;AAEG;QAEH,IAAA,CAAA,OAAO,GAAa,EAAE;AAEtB;;AAEG;QAEH,IAAA,CAAA,QAAQ,GAAG,KAAK;AAEhB;;AAEG;QAEH,IAAA,CAAA,WAAW,GAAG,EAAE;AAEhB;;AAEG;QAEH,IAAA,CAAA,UAAU,GAAG,EAAE;AAEf;;AAEG;QAEH,IAAA,CAAA,cAAc,GAAiC,MAAM;AAQrD;;AAEG;QAEH,IAAA,CAAA,mBAAmB,GAAG,EAAE;AAcxB;;AAEG;QAEH,IAAA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SE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { css } from 'lit';
|
|
9
|
+
|
|
10
|
+
var styles = css([":host{box-sizing:border-box;display:block;inline-size:100%}.cds-aichat-chat-header-overflow-wrapper{position:relative}.cds-aichat-chat-header-overflow-wrapper cds-overflow-menu{border-start-start-radius:calc(var(--cds-aichat-border-radius-start-start, var(--cds-aichat-border-radius)) - .0625rem)}.cds-aichat-chat-header-overflow-wrapper cds-overflow-menu::part(button){border-start-start-radius:calc(var(--cds-aichat-border-radius-start-start, var(--cds-aichat-border-radius)) - .0625rem)}.cds-aichat-chat-header-overflow-icon{color:var(--cds-icon-primary,#161616)}.cds-aichat-chat-header__title{color:var(--cds-text-primary,#161616);inline-size:100%;min-inline-size:4rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cds-aichat-chat-header__name-text{font-weight:700}"]);
|
|
11
|
+
|
|
12
|
+
export { styles as default };
|
|
13
|
+
//# sourceMappingURL=chat-header.scss.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chat-header.scss.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*
|
|
4
|
+
* Copyright IBM Corp. 2025
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
9
|
+
import { CornerConfig, CornerStyle, CornerPosition } from "./types.js";
|
|
10
|
+
/**
|
|
11
|
+
* Manages rounded corner calculations and CSS variable updates for the chat shell.
|
|
12
|
+
* Handles the logic for determining effective corner styles and applying them
|
|
13
|
+
* to CSS custom properties.
|
|
14
|
+
*/
|
|
15
|
+
export declare class CornerManager {
|
|
16
|
+
private readonly shellRoot;
|
|
17
|
+
private config;
|
|
18
|
+
constructor(shellRoot: HTMLElement, config: CornerConfig);
|
|
19
|
+
/**
|
|
20
|
+
* Update corner configuration and apply CSS variables
|
|
21
|
+
*/
|
|
22
|
+
updateCorners(config: CornerConfig): void;
|
|
23
|
+
/**
|
|
24
|
+
* Check if any corner is rounded
|
|
25
|
+
*/
|
|
26
|
+
hasAnyRoundedCorner(): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Get the effective corner value (individual corner overrides cornerAll)
|
|
29
|
+
*/
|
|
30
|
+
getEffectiveCorner(position: CornerPosition): CornerStyle;
|
|
31
|
+
/**
|
|
32
|
+
* Updates CSS custom properties for corner radii based on corner configuration
|
|
33
|
+
*/
|
|
34
|
+
private updateCornerCSSVariables;
|
|
35
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright IBM Corp. 2025
|
|
3
|
+
*
|
|
4
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
5
|
+
* LICENSE file in the root directory of this source tree.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @license
|
|
10
|
+
*
|
|
11
|
+
* Copyright IBM Corp. 2025
|
|
12
|
+
*
|
|
13
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
14
|
+
* LICENSE file in the root directory of this source tree.
|
|
15
|
+
*/
|
|
16
|
+
/**
|
|
17
|
+
* Manages rounded corner calculations and CSS variable updates for the chat shell.
|
|
18
|
+
* Handles the logic for determining effective corner styles and applying them
|
|
19
|
+
* to CSS custom properties.
|
|
20
|
+
*/
|
|
21
|
+
class CornerManager {
|
|
22
|
+
constructor(shellRoot, config) {
|
|
23
|
+
this.shellRoot = shellRoot;
|
|
24
|
+
this.config = config;
|
|
25
|
+
this.updateCornerCSSVariables();
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Update corner configuration and apply CSS variables
|
|
29
|
+
*/
|
|
30
|
+
updateCorners(config) {
|
|
31
|
+
this.config = config;
|
|
32
|
+
this.updateCornerCSSVariables();
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Check if any corner is rounded
|
|
36
|
+
*/
|
|
37
|
+
hasAnyRoundedCorner() {
|
|
38
|
+
return (this.config.cornerAll === "round" ||
|
|
39
|
+
this.config.cornerStartStart === "round" ||
|
|
40
|
+
this.config.cornerStartEnd === "round" ||
|
|
41
|
+
this.config.cornerEndStart === "round" ||
|
|
42
|
+
this.config.cornerEndEnd === "round");
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Get the effective corner value (individual corner overrides cornerAll)
|
|
46
|
+
*/
|
|
47
|
+
getEffectiveCorner(position) {
|
|
48
|
+
switch (position) {
|
|
49
|
+
case "start-start":
|
|
50
|
+
return this.config.cornerStartStart ?? this.config.cornerAll;
|
|
51
|
+
case "start-end":
|
|
52
|
+
return this.config.cornerStartEnd ?? this.config.cornerAll;
|
|
53
|
+
case "end-start":
|
|
54
|
+
return this.config.cornerEndStart ?? this.config.cornerAll;
|
|
55
|
+
case "end-end":
|
|
56
|
+
return this.config.cornerEndEnd ?? this.config.cornerAll;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Updates CSS custom properties for corner radii based on corner configuration
|
|
61
|
+
*/
|
|
62
|
+
updateCornerCSSVariables() {
|
|
63
|
+
if (!this.shellRoot) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
const radiusValue = (corner) => corner === "round" ? "0.5rem" : "0";
|
|
67
|
+
// Calculate effective values for each corner
|
|
68
|
+
const startStartValue = radiusValue(this.getEffectiveCorner("start-start"));
|
|
69
|
+
const startEndValue = radiusValue(this.getEffectiveCorner("start-end"));
|
|
70
|
+
const endStartValue = radiusValue(this.getEffectiveCorner("end-start"));
|
|
71
|
+
const endEndValue = radiusValue(this.getEffectiveCorner("end-end"));
|
|
72
|
+
// Set -base variables (source of truth for per-corner control)
|
|
73
|
+
this.shellRoot.style.setProperty("--cds-aichat-border-radius-start-start-base", startStartValue);
|
|
74
|
+
this.shellRoot.style.setProperty("--cds-aichat-border-radius-start-end-base", startEndValue);
|
|
75
|
+
this.shellRoot.style.setProperty("--cds-aichat-border-radius-end-start-base", endStartValue);
|
|
76
|
+
this.shellRoot.style.setProperty("--cds-aichat-border-radius-end-end-base", endEndValue);
|
|
77
|
+
// Also set regular variables for direct usage (backward compatibility)
|
|
78
|
+
this.shellRoot.style.setProperty("--cds-aichat-border-radius-start-start", startStartValue);
|
|
79
|
+
this.shellRoot.style.setProperty("--cds-aichat-border-radius-start-end", startEndValue);
|
|
80
|
+
this.shellRoot.style.setProperty("--cds-aichat-border-radius-end-start", endStartValue);
|
|
81
|
+
this.shellRoot.style.setProperty("--cds-aichat-border-radius-end-end", endEndValue);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
// Made with Bob
|
|
85
|
+
|
|
86
|
+
export { CornerManager };
|
|
87
|
+
//# sourceMappingURL=corner-manager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"corner-manager.js","sources":["../../../../src/components/chat-shell/src/corner-manager.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;AAAA;;;;;;;AAOG;AAIH;;;;AAIG;MACU,aAAa,CAAA;IAGxB,WAAA,CACmB,SAAsB,EACvC,MAAoB,EAAA;QADH,IAAA,CAAA,SAAS,GAAT,SAAS;AAG1B,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM;QACpB,IAAI,CAAC,wBAAwB,EAAE;IACjC;AAEA;;AAEG;AACH,IAAA,aAAa,CAAC,MAAoB,EAAA;AAChC,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM;QACpB,IAAI,CAAC,wBAAwB,EAAE;IACjC;AAEA;;AAEG;IACH,mBAAmB,GAAA;AACjB,QAAA,QACE,IAAI,CAAC,MAAM,CAAC,SAAS,KAAK,OAAO;AACjC,YAAA,IAAI,CAAC,MAAM,CAAC,gBAAgB,KAAK,OAAO;AACxC,YAAA,IAAI,CAAC,MAAM,CAAC,c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AI,CAAC,SAAS,CAAC,KAAK,CAAC,WAAW,CAC9B,2CAA2C,EAC3C,aAAa,CACd;QACD,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,WAAW,CAC9B,2CAA2C,EAC3C,aAAa,CACd;QACD,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,WAAW,CAC9B,yCAAyC,EACzC,WAAW,CACZ;;QAGD,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,WAAW,CAC9B,wCAAwC,EACxC,eAAe,CAChB;QACD,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,WAAW,CAC9B,sCAAsC,EACtC,aAAa,CACd;QACD,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,WAAW,CAC9B,sCAAsC,EACtC,aAAa,CACd;QACD,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,WAAW,CAC9B,oCAAoC,EACpC,WAAW,CACZ;IACH;AACD;AAED;;;;"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*
|
|
4
|
+
* Copyright IBM Corp. 2025
|
|
5
|
+
*
|
|
6
|
+
* This source code is licensed under the Apache-2.0 license found in the
|
|
7
|
+
* LICENSE file in the root directory of this source tree.
|
|
8
|
+
*/
|
|
9
|
+
import { InitialStateKey } from "./types.js";
|
|
10
|
+
/**
|
|
11
|
+
* Manages component initialization state tracking.
|
|
12
|
+
* Tracks when various initial state properties have been set and determines
|
|
13
|
+
* when initialization is complete to prevent visible layout thrashing.
|
|
14
|
+
*/
|
|
15
|
+
export declare class InitializationManager {
|
|
16
|
+
private initialStateSet;
|
|
17
|
+
private isInitializing;
|
|
18
|
+
private onCompleteCallback?;
|
|
19
|
+
/**
|
|
20
|
+
* Mark a specific initial state property as set
|
|
21
|
+
*/
|
|
22
|
+
markStateSet(key: InitialStateKey): void;
|
|
23
|
+
/**
|
|
24
|
+
* Check if initialization is complete
|
|
25
|
+
*/
|
|
26
|
+
isInitializationComplete(): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* Get the current initializing state
|
|
29
|
+
*/
|
|
30
|
+
getInitializingState(): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Set callback to be called when initialization completes
|
|
33
|
+
*/
|
|
34
|
+
onComplete(callback: () => void): void;
|
|
35
|
+
/**
|
|
36
|
+
* Reset initialization state (useful for testing or re-initialization)
|
|
37
|
+
*/
|
|
38
|
+
reset(): void;
|
|
39
|
+
/**
|
|
40
|
+
* Check if all initial state properties have been set
|
|
41
|
+
* and mark initialization as complete if so
|
|
42
|
+
*/
|
|
43
|
+
private checkInitializationComplete;
|
|
44
|
+
}
|